vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=242)
-   -   vB4 Template Conditionals List (https://vborg.vbsupport.ru/showthread.php?t=231525)

Flyte 05-03-2010 10:02 PM

is there a way to get this to work in a CMS article? or maybe with bbcode?

TimberFloorAu 05-17-2010 08:55 PM

Can we set conditional to ONLY show if user has filled in Profile Field ? Otherwise it is blank

spillage 05-31-2010 12:37 PM

I've been working with some of the code provided here to show Adsense ads to non members only.

I found that using <vb:if condition... gave an error when trying to save the code.
Missing if statment relative to the </vb:if>

The following worked
Code:

<if condition="in_array($bbuserinfo['usergroupid'], array(1,3,4,8))">
Adsense code here
</if>


merk_aus 06-13-2010 03:15 AM

Wow thanks for this greatly appreciated; I have dedicated this entire day to me to fix up all the little things on my site such as all of the template edits, permissions and most importantly all of the conditionals and so this thread and the time taken to create it is greatly appreciated.

malmazan 06-16-2010 04:18 PM

Quote:

Originally Posted by BBR-APBT (Post 1941139)
Show in several forums:
Code:

<vb:if condition="in_array($forum['forumid'], array(1,2,3))">Show this to forum 1, 2 and 3</vb:if>

I all templates i edit the above did not work.

What did work was:
Code:

<if condition="!in_array($GLOBALS[forumid], array(1,2,3))">Show this to forum 1, 2 and 3</vb:if>
Though your conditional may work in some other templates.

merk_aus 06-18-2010 12:53 AM

Can someone tell me if this is right to put in our footer to not have something show on the CMS and to not show it to guests:

Code:

<vb:if condition="THIS_SCRIPT != 'CMS'"><vb:if condition="is_member_of($bbuserinfo, 1,2,3)">Code here!</vb:if></vb:if>
I just want someone to tell me if it is correct, if not what is correct.

Lizard King 06-19-2010 02:02 PM

The correct this_script for CMS is

HTML Code:

<vb:if condition="THIS_SCRIPT == 'vbcms'"></vb:if>

Trek 06-22-2010 02:31 AM

****UPDATE***

Ok, finally figured it out, had to pass in usergroups in the $show variable from the plugin.

So in the plugin:

$show[gm_ugs] = explode(',', trim($vbulletin->options['gm_user_groups_allowed']));

and in the template, the condition is:

<vb:if condition="is_member_of($bbuserinfo, $show[gm_ugs])">

I'm sure that's obvious to most of you, but... just incase someone else has the same question, hopefully that helps.

--------------------------

How do you check multiple usergroups in a template?

Such as:

<vb:if condition="is_member_of($bbuserinfo, $usergroups)">

where $usergroups = "6,15,10"

Specifically:

<vb:if condition="is_member_of($bbuserinfo, array($vboptions['gm_user_groups_allowed']))">

Is what I am trying, but it only seems to work if $vboptions['gm_user_groups_allowed'] is not an array and is a single value.

Webmist 06-23-2010 03:26 AM

Quote:

Originally Posted by SledgeHead (Post 1950116)
How would I make it so a profile option could disable a toolbar? To be more specific I am trying to make Tweetboard and Wibiya Toolbars optional via user options.



I have profile field 8 with radio single selection as the type. It's set with options of yes and no. It seems to be working.


Code:

<vb:if condition="in_array($bbuserinfo['field8'], array(yes))">
Script or code here
</vb:if>


noppid 06-23-2010 04:28 AM

Quote:

Originally Posted by Webmist (Post 2057874)
I have profile field 8 with radio single selection as the type. It's set with options of yes and no. It seems to be working.


Code:

<vb:if condition="in_array($bbuserinfo['field8'], array(yes))">
Script or code here
</vb:if>


This would use many many less clock cycles and allocate less memory.

Code:

<vb:if condition="$bbuserinfo[field8] == 'yes'">
Script or code here
</vb:if>

And watch how you spell 'yes' when you create your custom fields, case matters.


All times are GMT. The time now is 06:21 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.01593 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
  • (7)bbcode_code_printable
  • (1)bbcode_html_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (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