![]() |
| Join Us | Members List | Today's Posts | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||
| From the looks of it yeah it shouldn't be to hard to adjust. But you gotta admit it does remind ... |
| Welcome to the AdminAddict. |
![]() Hello and welcome to AdminAddict! The one-stop resource for forum and community administrators. |
![]() |
| | Share | Thread Tools | Search this Thread |
| | #16 | |||
![]() Join Date: Jan 2008 | From the looks of it yeah it shouldn't be to hard to adjust. But you gotta admit it does remind look like one. I like my smarty templates so these type of conditionals wheree....different to get used to. I'm actually quite comfortable with the ones for vB. Still hope the make a list though. | June -- Luna Procer _____________________________________ ** giving hugs to the new members ** Vos planto mihi sentio bonus. | | |
| | #17 | |||
| | It would be almost impossible list all conditionals available for vBulletin. Any variable available to templates can be used in a conditional and than in any combination allowed for conditional constructs in PHP. Just taking the 458 settings/options and the 60 odd fields in the user table gives you 27480 potential conditionals using the && operator alone. Now not all would be viable or worthwhile but they are possible. That doesn't account for combinations where you can use ==. !=. >=, <=, || or compound conditionals. It also doesn't account for usergroups, permissions, forum information, custom profile fields and about 300 other variables that are available on every page. Next you have to account for scope. For instance the userinfo array is not available in the postbit. You have to use the postinfo array. Then you would have to account for conditionals that are available in specific templates. Especially since variables have to be registered with templates before they are available in vBulletin. So you won't necessarily be able to use a conditional you saw in the footer inside the header template. Needless to say any sort of comprehensive list will be larger than the current vBulletin manual which is over 500 pages. It would take hundreds of hours to produce. The benefit just isn't there. It is much easier to answer threads that ask what conditional to use and a vBulletin staff member posts it for them. | vBCodex - Get help building your vBulletin community. Get Gravatar support for your vBulletin community. -- Please do not contact me via PM for vBulletin Support. | | 1 out of 1 members found this post helpful. |
| | #18 | |
| Zealot
Posts: 1,668
Join Date: May 2009 Experience: Advanced Forums Admin/Mod: 2 Software: vBulletin Forum: Puberty ![]() ![]() ![]() ![]() ![]() | Quote:
| |
| | |
| | #19 | |
| Quote:
Thanks for posting these Nick and to Wayne for the codex. I am always just so dang happy that I have vBulletin that if you told me I had to use these conditionals while wearing purple pajamas with koala bears on them and singing Yankee Doodle Dandy on BlogTV in front of 50,000 people, I'd still be happy as long as I never have to try to do a hack in phpBB ever again as long as I live. | ||
| | |
| | #20 | ||||
| 家族生活を楽しむ ![]() ![]() Experience: Master Forum: General Forums | Great thread, thanks for the info Nick and Wayne | Do you know how to Strengthen your Community w/ Social Media ? 11 Facts and Figures on Twitter | I live in Google Kansas We're working on building the largest General Forums on the web. (vBulletin) I also enjoy (IPB) | | |

| | #21 |
| Addict
Posts: 70
Join Date: Dec 2009 Software: MyBB ![]() | Thanks for this list Nick, but how do I go about adding the user's avatar in the header? I tried some things, but with no luck. Thanks. |
| | |
| | #22 |
| Newcomer
Posts: 9
Join Date: Jun 2009 Location: Maryland Experience: Advanced Forums Admin/Mod: 1 Software: vBulletin Forum: Bully Breed Resource ![]() | Here is my list I made for vBulletin.org 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: Code: <vb:if condition="$show['member']">Show this to members only</vb:if> Code: <vb:if condition="$show['guest']">Show this to guest only</vb:if> Code: <vb:if condition="is_member_of($bbuserinfo, 1,2,3)">Show this to user group 1, 2, and 3</vb:if> Code: <vb:if condition="$bbuserinfo['userid'] == 318713">Show this only to the member with the user id of 318713</vb:if> Code: <vb:if condition="$bbuserinfo['userid'] != 318713">Show this to every one but the member with the user id of 318713</vb:if> Code: <vb:if condition="can_moderate()">Show this to all moderators</vb:if> Code: <vb:if condition="can_moderate($forum['x])">Show this if moderator is moderator of the forum with the id of x</vb:if> Code: <vb:if condition="can_moderate($forum['forumid'])">Show this to the moderator of the current forum</vb:if> Code: <vb:if condition="$forum[forumid] == x">Show this if forum id is x</vb:if> Code: <vb:if condition="$forum[forumid] != x">Show this if forum id is not x</vb:if> Code: <vb:if condition="in_array($forum['forumid'], array(1,2,3))">Show this to forum 1, 2 and 3</vb:if> Code: <vb:if condition="THIS_SCRIPT == 'calendar'">Show this only on calendar.php</vb:if> Code: <vb:if condition="THIS_SCRIPT != 'calendar'">Show this only on calendar.php</vb:if> Code: <vb:if condition="$customvar">Show this if $customvar is set</vb:if> Code: <vb:if condition="$customvar == blah">Show this if $customvar equals blah</vb:if> Code: <vb:if condition="$customvar != blah">Show this if $customvar does not equal blah</vb:if> Code: <vb:if condition="$show['guest']"> Show this to only guest. <vb:else /> Show this to all registered users </vb:if> Code: <vb:if condition="$show['guest']"> Show this to only guest. <vb:elseif condition="is_member_of($bbuserinfo, 5,6)" /> Show this to user group 5 and 6 which is mods and admins <vb:else /> Show this to all registered users </vb:if> Please feel free to add any I forgot and I will add them to this list and give you credit. You may have to register the variable depending where you use it. |
| | 1 out of 1 members found this post helpful. |
| | #23 | |
| Champion
Posts: 297
Join Date: Jun 2009 Location: Cincinnati, Ohio Experience: Master Forums Admin/Mod: 4 Software: vBulletin 3.8.x, vBulletin 4.0.x, ImperialBB 1.0.x Forum: Final Fantasy Crystal Cosmo ![]() ![]() ![]() ![]() ![]() | Question. Do variables have to be registered by the template engine in order to be used within a conditional, or do they work similar to vB3 (any set variable can be used, regardless of registration in the template engine)? I'm preparing to start coding for vBulletin 4, and I'd really like to know this ahead of time. ![]() | |
| Regards, Ryan Ashbrook Support Team Coordinator; Developer (ImperialBB 1.0.0 Alpha 1 is live!) www.ryanashbrook.com | ||
| | |
| | #24 | |
| Newcomer
Posts: 9
Join Date: Jun 2009 Location: Maryland Experience: Advanced Forums Admin/Mod: 1 Software: vBulletin Forum: Bully Breed Resource ![]() | Quote:
| |
| | |
| | #25 |
| Newcomer
Posts: 22
Join Date: Feb 2010 Software: vbulletin 4.0 publishing suite ![]() | wow excel formula used in vb wow |
| | |

![]() |
| Tags |
| conditionals, List, template, vBulletin |
| > vBulletin 4 Template Conditionals List |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| |