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)

moonclamp 09-04-2010 09:38 AM

Quote:

Originally Posted by moonclamp (Post 2093328)
I'll have a go with the above a bit later (when nobody is on my site), thanks :)

That didn't work either. I don't think the problem is the actual conditional though ... I just think that the plugin isn't accessing the profile information in order to apply it.

derbi 09-13-2010 02:29 PM

Quote:

Originally Posted by malmazan (Post 2054569)
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.

thanks for the correct code!

BirdOPrey5 09-13-2010 07:15 PM

Quote:

Originally Posted by derbi (Post 2097590)
thanks for the correct code!

There is no possible way the code you quoted works... It starts of as VB3 condition with just: <if condition="..."> and ends with the VB4 conditional </vb:if>... so that code won't work in any version... In VB3 you don't use the "vb:" at all, in VB4 you need to use it every time.

utahwildlife 09-28-2010 10:56 AM

1 Attachment(s)
I am trying to insert a an unique image heard for each of main page, HOME, Forum, What's New etc. How would you do that with condition?

Fore example: If you are on the Home page include home heard image, If you are on the Forum page include Forum image, and so on.

Please see attachments.

BirdOPrey5 09-28-2010 01:34 PM

Quote:

Originally Posted by utahwildlife (Post 2104170)
I am trying to insert a an unique image heard for each of main page, HOME, Forum, What's New etc. How would you do that with condition?

Fore example: If you are on the Home page include home heard image, If you are on the Forum page include Forum image, and so on.

Please see attachments.

You'd use this condition:

Code:

<vb:if condition="THIS_SCRIPT == 'calendar'">Show this only on calendar.php</vb:if>
You need to find out what the script names are for each page you want to show... I think home is "index" and forums is "forumdisplay"

So basically...
Code:


<vb:if condition="THIS_SCRIPT == 'index'">Image 1</vb:if>
<vb:if condition="THIS_SCRIPT == 'forumdisplay'">Index 2</vb:if>

Any other pages (like "showthread" and "calendar") won't show an image at all...

--------------- Added [DATE]1285699615[/DATE] at [TIME]1285699615[/TIME] ---------------

NEW POST HERE-- Stupid Auto Merge:rolleyes:


FYI This is a useful conditional if you want to hide the Facebook Like button in forums that aren't open to the public. If someone "Likes" a thread in a private forum people will be greeted with a no-permission "have to register" message which usually people will just get annoyed at rather than register. In fact if it's a private forum they may not even have access even after registering.

To use this conditional edit the SHOWTHREAD template... find the code:
Code:

<vb:if condition="$show['fb_likebutton']">
and change it too:
Code:

<vb:if condition="$show['fb_likebutton'] AND !in_array($threadinfo['forumid'], array(3,4,5))">
Where 3,4,5 are forum id's of the forums you want to hide the button in.

adom7 10-22-2010 10:34 AM

any "if condition" to show text/html only once on a certain place?

I am using CMS on my live site, and it has 1x2 content column on front page. I tried to place text/html/adsense code after first column however it always displays the text on all columns.

Any recommendations for that?

WreckRman2 12-15-2010 09:33 PM

<vb:if condition="is_member_of($bbuserinfo, 1,2,3)">Show this to user group 1, 2, and 3</vb:if>

what if I move someone to a group and then i wanted to show an image in the postbit for everyone to see IF that member is in a certain group.

BirdOPrey5 12-16-2010 12:39 AM

In postbit you can use this to see if a member is in usergroup x.

Code:

<vb:if condition="$post['usergroupid'] == x">
-stuff-
</vb:if>


bond010007 12-19-2010 09:54 AM

<font color="DarkGreen">Great work i love it
</font>

attroll 01-06-2011 06:45 PM

I have tried this code below in my footer ad location and it display in all my usergroups. Is there something wrong with the code?

Code:

<vb:if condition="is_member_of($bbuserinfo, 1,2,3)">Show this to user group 1, 2, and 3</vb:if>


All times are GMT. The time now is 01:27 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.02127 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
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)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