The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Show User Profile Field only to certain usergroup?
Is there a way to make a user profile field show up only to members of a certain usergroup?
Here's my problem: I have several public forums and one private forum. The private forum is only visible by members of a particular usergroup. These people know each other in person ("real life"), so we want them to be able to figure out their real names. Regardless of what name they register under (CoolDude, GreatGal, whatever), I want users in the private forum to be able to see their real first name. I figured I could let them put their real first name in a custom User Profile Field, but then everyone (in the public & private forums) would see their real name. Then I thought maybe I could set permissions or something to allow only members of the private forum/usergroup to see the FirstName user profile field. Is there any way to do that? Thanks! P.S.--I bought that new vBulletin book from PACKT publishing, and it doesn't seem to discuss this at all. |
#2
|
||||
|
||||
My guess is that you want the names to appear in the posbit of the private forum. So try this. Add a (private) Custom Profile Field in Admin CP. Make sure that you've disabled viewing in Members List and Search. After you have finished in the Usergroups option, set the option to "Can View Private Custom Fields". For all other Usergroups that option should be disabled. Now for that selected Usergroup they can enter their names into the Custom Profile Field.
The next step is to set a conditional so that only the selected Usergroup can see the names in posbits. The code can work for both postbit and posbit_legacy layouts. The conditional is as follows: Anywhere near the postbit or posbit_legacy template Username's column: Code:
<if condition="$post['fieldx'] AND $thread['forumid'] == y AND !is_member_of($bbuserinfo, z)"> $post[fieldx] </if> The conditional basically states that if the custom field was entered + it's in this private forum + the user is a member of this Usergroup then the entry will display in posbit. To test it add any text in the Custom Profile Field after you've entered the code and see if that text displays only in the private forum postbit. I haven't tested it but it should work. If not let me know and we'll easily fix it. |
#3
|
|||
|
|||
Very good post .. how about if i need it to be in the member.php=1 also ?
|
#4
|
|||
|
|||
Excellent! You da man, Freesteyelz.
I just had to remove the '!' before "is_member_of". |
#5
|
||||
|
||||
Actually, if you are tyring to make this go in a post, then this would not work:
Code:
<if condition="$post['fieldx'] AND $thread['forumid'] == y AND !is_member_of($bbuserinfo, z)"> $post[fieldx] </if> Code:
<if condition="$post['fieldx'] AND $thread['forumid'] == y AND is_member_of($post, z)"> $post[fieldx] </if> |
#6
|
|||
|
|||
After further testing, I'm finding that I have to enable "Can View Private Custom Fields" for the group the member is in. Is there any way around this? I don't want them to see all the private custom fields, just this one.
Maybe vBulletin is being too smart for me? |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|