vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Any conditionals experts out there? I need assistance... (https://vborg.vbsupport.ru/showthread.php?t=99549)

Sal Collaziano 10-28-2005 08:37 PM

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...

peterska2 10-28-2005 08:51 PM

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.

Sal Collaziano 10-30-2005 12:54 PM

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...

Paul M 10-30-2005 01:02 PM

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".

akanevsky 10-30-2005 01:10 PM

Code:

<if condition="!$bbuserinfo['userid']">
<p>guest</p>
<else />
<p>registered</p>
</if>


Sal Collaziano 10-30-2005 01:29 PM

Thank you.. Is it supposed to say "userid" with the actual usergroup "number" in there somewhere? Like 'userid=1'?

Paul M 10-30-2005 02:24 PM

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>


Sal Collaziano 11-03-2005 04:55 PM

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>

TyleR 11-03-2005 05:13 PM

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>


Sal Collaziano 11-03-2005 05:28 PM

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...


All times are GMT. The time now is 03:50 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.01082 seconds
  • Memory Usage 1,747KB
  • 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
  • (4)bbcode_code_printable
  • (3)bbcode_html_printable
  • (3)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