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)

Bisha 04-14-2011 05:53 PM

One more thing...

how to do a OR condition.

<vb:if condition="$xxx" OR condition="$yyy" >
With OR and || is not working...

BirdOPrey5 04-14-2011 05:56 PM

Quote:

Originally Posted by Bisha (Post 2184680)
One more thing...

how to do a OR condition.

<vb:if condition="$xxx" OR condition="$yyy" >
With OR and || is not working...

it's...

Code:

<vb:if condition="($x == $y) OR ($x == $z)">

Bisha 04-14-2011 06:08 PM

Thank you BirdOPrey5

:)

Alan_SP 04-18-2011 02:31 PM

I want to restrict some custom BBcodes to only certain usergroups (moderators and higher).

I tried to wrap BBcode inside this statment, but it doesn't work:

Code:

<vb:if condition="$post['usergroupid'] == 6">
Any idea how BBcode use could be restricted only to certain usergroups?

BirdOPrey5 04-18-2011 08:14 PM

Conditionals like these (Template Conditionals) only work in templates, they don't work in BB Codes.

There is a mod, "Advanced BB Code Manager" that is for an older version of vBulletin but still works on the latest 4.x it has been reported.

Only way of doing this without writing your own mod.

Alan_SP 04-19-2011 09:30 PM

Thank you. It would be good if someone makes new mod for managing BBcode. Hopefully someone would...

Lpspider 04-19-2011 10:18 PM

Is there a condition for all pages/content with a certain section of the cms?

StarBuG 04-30-2011 11:27 AM

Some more conditions you can add to your list:

Show only if vBulletin notices are not shown
Code:

<vb:if condition="!$show['notices']">
</vb:if>

For use in template navbar: Show only in Forum ID X
Code:

<vb:if condition="$GLOBALS[forumid] == X">
</vb:if>


But I have one question.
Is there a condition to show something only in the second post of each thread and page?
Something like "isfirstshown" just for the second post?

BirdOPrey5 05-03-2011 04:30 PM

There's no condition specifically for 2nd posts but if you set your forum to a set number of posts per page you could make a condition like:

Code:

<vb:if condition="$post[postcount] == 2 OR $post[postcount] == 12  OR$post[postcount] == 22 OR $post[postcount] == 32 OR $post[postcount] == 42 OR $post[postcount] == 52 OR $post[postcount] == 62">
</vb:if>

...and so on... Assuming 10 posts per page- Yeah at some point the condition won't work anymore but how many threads really go X number of pages anyway. I assume you want it to show an ad so if it works in 95% of thread pages it should be good enough.

Otherwise I'd imagine a plugin could be written to keep count and be true only for 2nd posts.

Hasanudin 05-26-2011 01:16 PM

how is conditional syntax for the thread that has been closed?

example:

<vb:if condition="closed thread???"> show message cause thread that has been closed </vb:if>


All times are GMT. The time now is 06:36 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.03368 seconds
  • Memory Usage 1,738KB
  • 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
  • (5)bbcode_code_printable
  • (1)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