PDA

View Full Version : vBulletin Condition code that affects profile, rather than the viewer.


Skyrider
11-03-2015, 09:56 PM
I'm looking for a condition code that affects the view on a profile that depends on the user itself, rather than the person viewing the profile. I've added additional code to add an extra tab on the users profile, but should show different text depending on the users usergroup.

For example, lets say I am visiting a member profile on /members/1-testuser and he's located in usergroup A. Now on the profile, I'm visiting his "test" tab that I added. And I added the text "test a" within the template for everyone to see.. works great, no problems. Now.. I'd like the condition code where it shows another text IF the testuser is in for example, Usergroup B.

Thus far I've tried a few conditions (including usergroup array, etc). But the problem is that this affects the user itself (the client viewing the profile, depending on his usergroup) rather than the profile/User ID.

I hope you can make sense of this. I appreciate the help.

Regards,
Skyrider

Dave
11-03-2015, 10:03 PM
Could you post the code here of what you have so far?

Skyrider
11-03-2015, 10:07 PM
Could you post the code here of what you have so far?
I have nothing thus far, as I currently have no idea where to start/begin (yet).

But I can however, give a bit more details/info before I head to bed.

Visiting Users Profile named testuser -> Checking the profile tab "test" -> The profile (member) is in Usergroup A -> Show some stuff here

What I'd like is:

Visiting Users Profile named testuser -> Checking the profile tab "test" -> The profile (member) is in Usergroup A -> Show some stuff here -> IF testuser is in Usergroup B -> Show other stuff.

Dave
11-03-2015, 10:16 PM
If you register the variable $userinfo to the template of your new tab, you can use that in the is_member_of function to check if the user you're viewing is member of a certain usergroup.

Skyrider
11-04-2015, 07:49 AM
If you register the variable $userinfo to the template of your new tab, you can use that in the is_member_of function to check if the user you're viewing is member of a certain usergroup.
Thanks, I shall go try that out!

<vb:if condition="is_member_of($userinfo, x)">
^ Should be correct, right?