vb.org Archive

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

theArchitect 09-06-2005 04:46 AM

Conditionals
 
I am running 3.5.0 RC 2 and I am having problems writing a conditional. I have made a template change to my forum home page but only want certain user groups to be able to see it.

How do I enclose the html in a conditional so that it is only visable to specified user groups?

At the moment I am using this code that I found on here

Code:

<if condition="!is_member_of($userinfo, 25)">
Your ad code
</if>

Only problem is that it doesn't seem to work.

Adrian Schneider 09-06-2005 05:02 AM

That looks fine, just note that the ! means NOT. If you only want to show it to group 25, and show it to all but 25, remove the !.

theArchitect 09-06-2005 05:36 AM

Quote:

Originally Posted by SirAdrian
That looks fine, just note that the ! means NOT. If you only want to show it to group 25, and show it to all but 25, remove the !.

Thanks, but when I use this nothing shows up and I get an

array_merge error in in "function.array-merge" /includes/functions.php (1033) : eval()'d code in line 2

and the same thing error but in line 4 also.

Clearly I am doing somehing wrong.

merk 09-06-2005 05:49 AM

Try replacing $userinfo in the conditional itself to $vbulletin->userinfo. (And you will have to be a member of group 25 for it to work even if you are an administrator)

theArchitect 09-06-2005 05:54 AM

Many thanks. That has done the trick. Though, I am still getting the array_merge error.

merk 09-06-2005 05:56 AM

Have you added any other conditionals with "$userinfo" in them?

If you remove the conditional does the array merge error go away?

Adrian Schneider 09-06-2005 05:24 PM

Where are you using this? $userinfo is only available (AFAIK) when viewing a user's profile.

$bbuserinfo / $vbulletin->userinfo = current user

theArchitect 09-06-2005 10:33 PM

Quote:

Originally Posted by SirAdrian
Where are you using this? $userinfo is only available (AFAIK) when viewing a user's profile.

$bbuserinfo / $vbulletin->userinfo = current user

I am using it on the forum home page. I only ended up with the $userinfo as I found another post on here asking about conditionals and this was the answer.

https://vborg.vbsupport.ru/showthread.php?t=95494


All times are GMT. The time now is 10:28 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.01159 seconds
  • Memory Usage 1,722KB
  • 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
  • (8)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