1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Hide custom profile field to usergroups?

Discussion in 'vBulletin' started by Alex210, Apr 8, 2012.

  1. #1
    Ok, so i have made a custom profile field that should be visible to admins and mods only. The thing is that, i dont see any option in order to do this and i wonder if anyone has any idea on how to do it:confused:
    SEMrush
    The forum is vB 3.8.7
     
    Alex210, Apr 8, 2012 IP
    SEMrush
  2. aayush93

    aayush93 Active Member

    Messages:
    28
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    58
    #2
    When you are creating new custom profile field in admincp
    SET Private Field - NO
    ------------

    Now in usergroup manager, edit any group (for ex - edit registered users)

    Find : Can View Private Custom Fields


    Now if you select yes, then all members of registered user group will be able to see that custom profile field and if you select no then can't see custom profile field of any user.
     
    aayush93, Apr 22, 2012 IP
  3. Alex210

    Alex210 Well-Known Member

    Messages:
    214
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    150
    #3
    Thank you, but i was wondering if someone could tell how to do this with an if condition since there is no option built in. Lets say i want to create more fields, and each field should be available to a specific usergroup.
     
    Alex210, Apr 22, 2012 IP
  4. aayush93

    aayush93 Active Member

    Messages:
    28
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    58
    #4
    For Hiding Custom Profile Field From Specific Group, Follow Following steps -:

    1. Open User Profile Field Manager and note down the number after field name of that custom field. (ex: field5 - 5)

    Note: If you want to show an customfield to admin and moderator usergroup you would use the usergroup ids 6, 7 within the array.

    2. Now, Open Plugin Manager and create new plugin

    Product - VBulletin
    Hook Location - member_profileblock_profilefieldbit
    Execution Order - 5
    Plugin PHP Code -
    
    if ($profilefield[profilefieldid] == 5) { 
    
    if (!is_member_of($this->registry->userinfo, 6, 7) AND $this->registry->userinfo['userid'] != $this->profile->userinfo['userid']) 
    {
    $profilefield['value'] = '';
    }
    }
    
    PHP:

    Plugin is Active - Yes
    and save it..
     
    aayush93, Apr 22, 2012 IP
  5. warpaint

    warpaint Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Hey there, I think this is what I need! However I want some profile fields to be actually viewable by everyone, I just want only a certain amount of usergroups to be able to edit them. Will this plugin work if I set it in one of the usercp custom profile field templates?

    Essentially I want to hide some profile fields in the User cp edit page to a select amount of usergroups.
    I hope I make sense?
     
    warpaint, Jul 1, 2012 IP
  6. jchan24

    jchan24 Peon

    Messages:
    23
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Does anyone know how to create a VBulletin mod to allow for "Member Search by custom fields"

    For instance, if I want to find all members who are "female" and from "california" and "age 21"?
     
    jchan24, Jul 31, 2012 IP