vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   vBulletin Condition code that affects profile, rather than the viewer. (https://vborg.vbsupport.ru/showthread.php?t=320693)

Skyrider 11-03-2015 09:56 PM

vBulletin Condition code that affects profile, rather than the viewer.
 
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

Quote:

Originally Posted by Dave (Post 2558171)
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

Quote:

Originally Posted by Dave (Post 2558174)
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!

Code:

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


All times are GMT. The time now is 01:33 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01044 seconds
  • Memory Usage 1,720KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete