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)

BirdOPrey5 08-02-2012 07:37 PM

Look in the postbit or postbit_legacy template for the signature code:

There is already a conditional you can edit:

Code:

<vb:if condition="$post['signature']">

To allow the signatures on all forums except forum 2

Code:

<vb:if condition="$post['signature'] AND $thread['forumid'] != 2">

To allow the signatures on all forums except forum 2, but OK in forum 2 is staff

Code:

<vb:if condition="$post['signature'] AND ($thread['forumid'] != 2 OR is_member_of($post, 5,6,7))">

I haven't tested this but try it. If not it may need to be:

Code:

<vb:if condition="$post['signature'] AND ($thread['forumid'] != 2 OR in_array($post['usergroupid'], array(5,6,7)))">

chikuru 08-03-2012 06:17 AM

thanks, its working now...

BirdOPrey5 08-03-2012 01:30 PM

Well you basically have

Code:

condition="XXX"
Where XXX is something like:

Code:

$post['signature'] == 'Value'
or such.

You just need to add additional statements with AND or OR depending on what you want.

Use parentheses to keep the logic correct/easy to follow

Code:

condition="(XXX) OR ((YYY) AND (ZZZ))"
For example... if XXX is true OR if YYY and ZZZ are true regardless of the value of XXX.

Budget101 08-24-2012 03:35 PM

I would like to add an "if condition" based on style id, but am having difficulty with the correct syntax to use...

For example - if vbDefault style id =2 and NewGreat Style id = 4

I would like to be able to add an if condition to the widget templates- if browsing with vb default style id #2 - Display the widget; otherwise if browsing with NewGreat Style Id #4 - (DO Not Display the widget!)

Anyone willing to offer some assistance? Thanks so much, greatly appreciated!

Code:

<vb:if condition="$styleid=2">
Display widget
<vb:else />
Do not Display widget
</vb:else>


BirdOPrey5 08-26-2012 02:16 PM

Code:

<vb:if condition="$bbuserinfo['styleid'] == 2">

tareqbd 08-27-2012 04:36 AM

Quote:

<vb:if condition="in_array($forum['forumid'], array(1,2,3))">Show this to forum 1, 2 and 3</vb:if>
Not working in vbulleting 4.2.0
Anybody help please.

BirdOPrey5 08-27-2012 11:12 AM

Quote:

Originally Posted by tareqbd (Post 2360348)
Not working in vbulleting 4.2.0
Anybody help please.

It works but only on some pages... use

Code:

$GLOBALS['fourmid']
instead of

Code:

$forums['forumid']
to work on all pages (forums and threads)

ChiNa 08-30-2012 05:13 PM

Thank you so much, one of the greatest so far in the articles area,,,

dougdirac 09-05-2012 04:57 AM

Is there a conditional for a forum and all its sub-forums?

vbxmod 09-07-2012 07:08 PM

Is it possible to add conditional registration usergroup submission. If the user select group x then the user will automatically added in that user group or it will go to default registration group.
Thank you for your attention.


All times are GMT. The time now is 07:02 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.04038 seconds
  • Memory Usage 1,741KB
  • 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
  • (11)bbcode_code_printable
  • (2)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