Announcement

Collapse
No announcement yet.

How do I set usergroupid to a custom user field?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How do I set usergroupid to a custom user field?

    Take a look at the second-to-last line (DB_site).

    Code:
    // ###################### Start do moderate and coppa #######################
    if ($HTTP_POST_VARS['action']=="domoderate") {
    
      while (list($key,$val)=each($validate)) {
        if ($val==1) {
    
          $user=$DB_site->query_first("SELECT username,email FROM user WHERE userid=$key");
          $username=unhtmlspecialchars($user[username]);
    
          eval("\$message = \"".ereg_replace("\"","\\\"",$email)."\";");
          eval("\$subject = \"".ereg_replace("\"","\\\"",$subject)."\";");
    
          mail ($user[email],$subject,$message,"From: $webmasteremail");
    
          $DB_site->query("UPDATE user SET usergroupid=2 WHERE userid=$key");
        }
      }
    
      echo "<p>Accounts validated and users notified</p>";
    
    }
    Where it says SET usergroupid=2, I would like instead for it to set the usergroupid to a custom user field number that is selected at registration.

    So, instead of SET usergroupid=2, I'd like it to say, SET usergroupid=field8.

    Except, this doesn't work - I don't know how to properly insert the value of field8 into usergroupid. Any suggestions?

  • #2
    This question will have to asked at www.vbulletin.org.
    Translations provided by Google.

    Wayne Luke
    The Rabid Badger - a vBulletin Cloud demonstration site.
    vBulletin 5 API - Full / Mobile
    Vote for your favorite feature requests and the bugs you want to see fixed.

    Comment


    • #3
      I posted my question at vbulletin.org also - but prospects aren't good, as I've had only 2 views so far.

      If you can help me out, that'd be great. If you don't have any idea, let me know that, too!

      If it's better to post a reply to my thread on vbulletin.org, then by all means, please do. My user name is Galen.

      Thanks!
      Galen

      Comment


      • #4
        Actually, I have a good idea on what you need to do. However we can't discuss third party modifications on this site. That is why vBulletin.org was created. I am not trying to be stubborn or troublesome but if we start handling code changes for one customer, then people will expect us to support all code changes they make and we simply don't have the resources for that.
        Translations provided by Google.

        Wayne Luke
        The Rabid Badger - a vBulletin Cloud demonstration site.
        vBulletin 5 API - Full / Mobile
        Vote for your favorite feature requests and the bugs you want to see fixed.

        Comment

        widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
        Working...
        X