userinfo

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • DarkDelight.net
    Senior Member
    • Jul 2003
    • 1358
    • 3.0.3

    userinfo

    I have a userid and I need to know the usergroupid and membergroupids.

    Is there a function that I can pass the userid and it will return userinfo?

    Thanks
    Sig? What sig?
  • Jake Bunce
    Senior Member
    • Dec 2000
    • 46598
    • 3.6.x

    #2
    I don't think there is a separate function for that. Or at least I can't find it.

    This code will get the information you want:

    Code:
    $userinfo = $DB_site->query_first("SELECT userid, usergroupid, membergroupids FROM " . TABLE_PREFIX . "user WHERE userid = [color=red]X[/color]");
    Where X is the userid of the user.

    Now $userinfo will contain the user's userid, usergroupid, and membergroupids:

    $userinfo[userid]
    $userinfo[usergroupid]
    $userinfo[membergroupids]

    Comment

    • Freddie Bingham
      Former vBulletin Developer
      • May 2000
      • 14057
      • 1.1.x

      #3
      $userinfo = fetch_userinfo($userid);

      Then access $userinfo['usergroupid' and $userinfo['membergroupids']

      I suggest not using this in a loop though.

      Comment

      • DarkDelight.net
        Senior Member
        • Jul 2003
        • 1358
        • 3.0.3

        #4
        Thanks to both of you.

        I wanted to get a permission based off the userid of posts.

        Will doing it this way add another query for every post on every page?
        Sig? What sig?

        Comment

        • Jake Bunce
          Senior Member
          • Dec 2000
          • 46598
          • 3.6.x

          #5
          Yes, it's an extra query with either method.

          Comment

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