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 10-28-2005, 08:37 PM
Sal Collaziano Sal Collaziano is offline
 
Join Date: Dec 2001
Location: Royal Palm Beach, Florida
Posts: 232
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Any conditionals experts out there? I need assistance...

I'd like to display information at the very top of my forum - different for guests, registered members and supporting members. Am I on the right track with the code I've typed below? It doesn't work for me so would somebody mind helping me out?

Thanks in advance...

HTML Code:
<if condition="$bbuserinfo['userid'] == 1">
<p>guest</p>
<else />
<if condition="$bbuserinfo['userid'] == 2">
<p>registered</p>
<else />
<p>not guest or registered</p>
</if>
</if>
Guests get "not guest or registered".
I'm in my own usergroup and I get "guest".

Any help would be appreciated...
Reply With Quote
  #2  
Old 10-28-2005, 08:51 PM
peterska2 peterska2 is offline
 
Join Date: Oct 2003
Location: Manchester, UK
Posts: 6,504
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try

Code:
<if condition="$show[registerbutton]">
<p>Guest</p>
<else />
<if condition="$bbuserinfo['usergroupid'] == 2">
<p>registered</p>
<else />
<p>not guest or registered</p>
</if>
</if>
Note: This only works in the navbar. Elsewhere it may have to be tweaked.
Reply With Quote
  #3  
Old 10-30-2005, 12:54 PM
Sal Collaziano Sal Collaziano is offline
 
Join Date: Dec 2001
Location: Royal Palm Beach, Florida
Posts: 232
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you.. Well.. I'm actually trying to get this information to display at the very top of the page.. At the very beginning of the header.. Would anyone happen to know the trick for that?

Thank you...
Reply With Quote
  #4  
Old 10-30-2005, 01:02 PM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Sal Collaziano
I'd like to display information at the very top of my forum - different for guests, registered members and supporting members. Am I on the right track with the code I've typed below? It doesn't work for me so would somebody mind helping me out?

Thanks in advance...

HTML Code:
<if condition="$bbuserinfo['userid'] == 1">
<p>guest</p>
<else />
<if condition="$bbuserinfo['userid'] == 2">
<p>registered</p>
<else />
<p>not guest or registered</p>
</if>
</if>
Guests get "not guest or registered".
I'm in my own usergroup and I get "guest".

Any help would be appreciated...
You appear to be using "userid" in your tests instead of "usergroupid".
Reply With Quote
  #5  
Old 10-30-2005, 01:10 PM
akanevsky akanevsky is offline
 
Join Date: Apr 2005
Posts: 3,972
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Code:
<if condition="!$bbuserinfo['userid']">
<p>guest</p>
<else />
<p>registered</p>
</if>
Reply With Quote
  #6  
Old 10-30-2005, 01:29 PM
Sal Collaziano Sal Collaziano is offline
 
Join Date: Dec 2001
Location: Royal Palm Beach, Florida
Posts: 232
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you.. Is it supposed to say "userid" with the actual usergroup "number" in there somewhere? Like 'userid=1'?
Reply With Quote
  #7  
Old 10-30-2005, 02:24 PM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

For different user groups, the easiest method is ;

HTML Code:
<if condition="$bbuserinfo['usergroupid'] == 1">
<p>Group 1 message (Guests)</p>
</if>

<if condition="$bbuserinfo['usergroupid'] == 2">
<p>Group 2 message (Normal registered users)</p>
</if>

<if condition="$bbuserinfo['usergroupid'] == 9">
<p>Group 9 message</p>
</if>
Reply With Quote
  #8  
Old 11-03-2005, 04:55 PM
Sal Collaziano Sal Collaziano is offline
 
Join Date: Dec 2001
Location: Royal Palm Beach, Florida
Posts: 232
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you.. That's exactly what I needed.

Okay. Just one more request... If I want to give the same message to several usergroups, would it be done like this?:

<if condition="$bbuserinfo['usergroupid'] == 1,2,3,4,5">
<p>Message here</p>
</if>
Reply With Quote
  #9  
Old 11-03-2005, 05:13 PM
TyleR's Avatar
TyleR TyleR is offline
 
Join Date: Nov 2004
Location: North Carolina
Posts: 349
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Sal Collaziano
Thank you.. That's exactly what I needed.

Okay. Just one more request... If I want to give the same message to several usergroups, would it be done like this?:

<if condition="$bbuserinfo['usergroupid'] == 1,2,3,4,5">
<p>Message here</p>
</if>
Nope, would be like this:

Code:
<if condition="is_member_of($bbuserinfo[usergroupid], array(1,2,3,4,5))">
<p>Message here</p>
</if>
Reply With Quote
  #10  
Old 11-03-2005, 05:28 PM
Sal Collaziano Sal Collaziano is offline
 
Join Date: Dec 2001
Location: Royal Palm Beach, Florida
Posts: 232
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by TyleR
Nope, would be like this:

Code:
<if condition="is_member_of($bbuserinfo[usergroupid], array(1,2,3,4,5))">
<p>Message here</p>
</if>
I couldn't get this one to work for some reason... Of course, I replaced the array numbers with my own usergroups...
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:15 AM.


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.04208 seconds
  • Memory Usage 2,255KB
  • Queries Executed 11 (?)
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
  • (4)bbcode_code
  • (3)bbcode_html
  • (3)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_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