vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Secondary Usergroups Question (https://vborg.vbsupport.ru/showthread.php?t=217383)

Glenn379 06-29-2009 03:25 AM

Secondary Usergroups Question
 
Hey everyone.

I have another odd question I hope someone can answer. I just started to use a template mod for adding images based on usergroups. The following is an example of what I have:

Code:

<if condition="$post[usergroupid] == 10">
<img src="fainte/postbit/crimson_blades.gif" border="0">
<br>
</if>

<if condition="$post[usergroupid] == 11">
<img src="fainte/postbit/crimson_blades_officer.gif" border="0">
<br>
</if>

The problem is that I want to be able to display multiple images for each member based on their additional usergroups as well. Right now I have myself set up to both of those groups but only one image will display because it's my primary usergroup. Does anyone know if there is a code for secondary usergroups versus primaries? Does anyone have any other ideas? Thanks

HMBeaty 06-29-2009 04:20 AM

Try this....it's also XHTML compliant :D
Code:

<if condition="is_member_of($vbulletin->userinfo, 10)">
<img src="fainte/postbit/crimson_blades.gif" alt="" border="0" />
<br />
</if>

<if condition="is_member_of($vbulletin->userinfo, 11)">
<img src="fainte/postbit/crimson_blades_officer.gif" alt="" border="0" />
<br />
</if>


Glenn379 06-29-2009 04:38 AM

Quote:

Originally Posted by Redlinemotorsports (Post 1839287)
Try this....it's also XHTML compliant :D
Code:

<if condition="is_member_of($vbulletin->userinfo, 10)">
<img src="fainte/postbit/crimson_blades.gif" alt="" border="0" />
<br />
</if>

<if condition="is_member_of($vbulletin->userinfo, 11)">
<img src="fainte/postbit/crimson_blades_officer.gif" alt="" border="0" />
<br />
</if>


Thanks redline! I tried it but now nothing shows up :(

HMBeaty 06-29-2009 04:45 AM

Ok, try THIS one, lol
HTML Code:

<if condition="in_array($bbuserinfo[usergroupid], array(10))">
<img src="fainte/postbit/crimson_blades.gif" alt="" border="0" />
<br />
</if>

<if condition="in_array($bbuserinfo[usergroupid], array(11))">
<img src="fainte/postbit/crimson_blades_officer.gif" alt="" border="0" />
<br />
</if>


Glenn379 06-29-2009 04:56 AM

Quote:

Originally Posted by Redlinemotorsports (Post 1839313)
Ok, try THIS one, lol

It has the original problem. it shows the primary but not the secondary

HMBeaty 06-29-2009 05:00 AM

ERRR!!! I used to know a conditional that checked if the users groups were primary and seconday but I can't remember it. I THOUGHT it was the first one I posted. The bad thing about these, is there's so many ways to do it. So, try this one...
HTML Code:

<if condition="is_member_of($bbuserinfo, 10)">
<img src="fainte/postbit/crimson_blades.gif" alt="" border="0" />
<br />
</if>

<if condition="is_member_of($bbuserinfo, 11)">
<img src="fainte/postbit/crimson_blades_officer.gif" alt="" border="0" />
<br />
</if>

--------------- Added [DATE]1246256287[/DATE] at [TIME]1246256287[/TIME] ---------------

I'm assuming you got this working?

Glenn379 06-29-2009 05:18 AM

Quote:

Originally Posted by Redlinemotorsports (Post 1839326)
ERRR!!! I used to know a conditional that checked if the users groups were primary and seconday but I can't remember it. I THOUGHT it was the first one I posted. The bad thing about these, is there's so many ways to do it. So, try this one...

Yay! Third one's the charm. :) Thank you!

The only issue is that everyone else on that page has the same thing now. Any ideas?

HMBeaty 06-29-2009 05:21 AM

Quote:

Originally Posted by Glenn379 (Post 1839333)
The only issue is that everyone else on that page has the same thing now. Any ideas?

What do you mean?

Glenn379 06-29-2009 05:24 AM

There are two people registered ATM. We are both in userID 9. I have added myself to 9 with 10 and 11 as secondaries. The three images now show up where I want them but for whatever reason all three show up in his postbit too even though he isn't in all three.

HMBeaty 06-29-2009 05:32 AM

Not sure about the answer to that one. Have you checked his profile in the AdminCP to make sure the other user doesn't have any additional usergroups selected?


All times are GMT. The time now is 09:15 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.01165 seconds
  • Memory Usage 1,743KB
  • 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
  • (3)bbcode_code_printable
  • (2)bbcode_html_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete