Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 06-29-2009, 03:25 AM
Glenn379's Avatar
Glenn379 Glenn379 is offline
 
Join Date: Aug 2002
Location: San Francisco, California
Posts: 111
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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
Reply With Quote
  #2  
Old 06-29-2009, 04:20 AM
HMBeaty's Avatar
HMBeaty HMBeaty is offline
 
Join Date: Sep 2005
Posts: 4,141
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try this....it's also XHTML compliant
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>
Reply With Quote
  #3  
Old 06-29-2009, 04:38 AM
Glenn379's Avatar
Glenn379 Glenn379 is offline
 
Join Date: Aug 2002
Location: San Francisco, California
Posts: 111
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Redlinemotorsports View Post
Try this....it's also XHTML compliant
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
Reply With Quote
  #4  
Old 06-29-2009, 04:45 AM
HMBeaty's Avatar
HMBeaty HMBeaty is offline
 
Join Date: Sep 2005
Posts: 4,141
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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>
Reply With Quote
  #5  
Old 06-29-2009, 04:56 AM
Glenn379's Avatar
Glenn379 Glenn379 is offline
 
Join Date: Aug 2002
Location: San Francisco, California
Posts: 111
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Redlinemotorsports View Post
Ok, try THIS one, lol
It has the original problem. it shows the primary but not the secondary
Reply With Quote
  #6  
Old 06-29-2009, 05:00 AM
HMBeaty's Avatar
HMBeaty HMBeaty is offline
 
Join Date: Sep 2005
Posts: 4,141
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #7  
Old 06-29-2009, 05:18 AM
Glenn379's Avatar
Glenn379 Glenn379 is offline
 
Join Date: Aug 2002
Location: San Francisco, California
Posts: 111
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Redlinemotorsports View Post
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?
Reply With Quote
  #8  
Old 06-29-2009, 05:21 AM
HMBeaty's Avatar
HMBeaty HMBeaty is offline
 
Join Date: Sep 2005
Posts: 4,141
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Glenn379 View Post
The only issue is that everyone else on that page has the same thing now. Any ideas?
What do you mean?
Reply With Quote
  #9  
Old 06-29-2009, 05:24 AM
Glenn379's Avatar
Glenn379 Glenn379 is offline
 
Join Date: Aug 2002
Location: San Francisco, California
Posts: 111
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #10  
Old 06-29-2009, 05:32 AM
HMBeaty's Avatar
HMBeaty HMBeaty is offline
 
Join Date: Sep 2005
Posts: 4,141
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.11650 seconds
  • Memory Usage 2,273KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_code
  • (2)bbcode_html
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete