![]() |
|
Article Options |
vB4 Template Conditionals List
by
![]() I put this together because it seems lots of people are having problems with the new syntax for conditionals. First off remember you can not use {vb:raw var} in template conditionals. Show only members:
Show only guest:
Show specific user groups :
Show one member:
Show every one but one member:
Show only moderators of any forum:
Show Moderator of one forum: Remember to change x
Show Moderator of current forum:
Show in one forum: Remember to change x
Show is every forum but one: Remember to change x
Show in several forums:
Show in only one file: Look for define('THIS_SCRIPT', 'calendar'); in the top of the php file you want it to show in.
Show in every file but one: Look for define('THIS_SCRIPT', 'calendar'); in the top of the php file you do not want it to show in.
If $customvar is set:
If $customvar equals:
If $customvar does not equal:
vBulletin else statement:
vBulletin else if statement:
This is all that I can think of right now off the top of my head. Please feel free to add any I forgot and I will add them to this list and give you credit. Last edited by BBR-APBT; 29 Dec 2009 at 17:16.. Reason: Added custom variables. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Views: 126943
|
Comments |
#3
|
|||
|
|||
Thanks for this list!
![]() No members have liked this post.
|
#4
|
||||
|
||||
Excuse me a question, to the undersigned not work conditions with $forum[forumid] is the variable that changed?
thanks PS example <vb:if condition="!in_array($forum[forumid], array(18,19))"> text text </vb:if> No members have liked this post.
Last edited by Asterix_ita; 30 Dec 2009 at 16:16. Reason: add example |
#5
|
||||
|
||||
very nice, this has helped me understand all the conditionals much better.
__________________
Gamerz Needs - For All Your Gaming Needs! No members have liked this post.
|
#6
|
||||
|
||||
subscribe too..
nice, thx u
__________________
Salam Hangat Selalu No members have liked this post.
|
#7
|
|||
|
|||
this is so clutch...nice
No members have liked this post.
|
#8
|
||||
|
||||
super, thanks & happy new yeahr
![]()
__________________
rbc No members have liked this post.
|
#9
|
|||
|
|||
thank you very much
No members have liked this post.
|
#10
|
|||
|
|||
Originally Posted by Asterix_ita
$forum[forumid] have to be registered to the template.![]()
There's an other article here. No members have liked this post.
|
#11
|
||||
|
||||
thanks, I must enter the new logic. Happy New Year
No members have liked this post.
|
#12
|
||||
|
||||
Hi - thanks for this post, however, can you provide conditionals for CMS sections please?
__________________
No signature - please check back later No members have liked this post.
|
#13
|
||||
|
||||
Originally Posted by MikeWarner
I don't have the CMS and most of these will work for the CMS.![]()
You may have to preregister the var. No members have liked this post.
|
#14
|
|||
|
|||
Thanks
No members have liked this post.
|
#15
|
||||||||||||
|
||||||||||||
Hello everybody! I have one problem with porting one of my products to VB4.
I have the setting for a product called vfsms_can_stick_by_sms - it's comma separated list of forum-sections where this product is turned on. In this product I have the following plugin:
And in template SHOWTHREAD I have next conditional:
I have few problems: 1. variable $vfsms_allowed4sticky_forums can be accessed only as a {vb:raw vfsms_allowed4sticky_forums} and I can not put it to the condition 2. variable $forumid is not accessible anymore Please, somebody, help me! --------------- Added 05 Jan 2010 at 23:28 --------------- but everything is ok if I pass variable directly from the showthread.php:
and in template also replace $forumid on $thread[forumid] This is absolutely wrong way of doing the thing I need, pls tell me how to do it without changes in showthread.php! No members have liked this post.
Last edited by hochun; 05 Jan 2010 at 23:28. Reason: Auto-Merged DoublePost |
![]() |
«
Previous Article
|
Next Article
»
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Article Options | |
|
|
New To Site? | Need Help? |
All times are GMT. The time now is 13:28.