![]() | |
| 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,730
Join Date: May 2009 Experience: Advanced Forums Admin/Mod: 2 Software: vBulletin Forum: YouTube Backgrounds ![]() ![]() ![]() ![]() ![]() | 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 | ||||
| ThinkBigTopeka.com ![]() ![]() Experience: Master Forum: General Forums | Great thread, thanks for the info Nick and Wayne | I've been offering Web Services since 2006, here are some past vBulletin Clients Some of our popular forums: Entertainment | General Discussions | News Nebula Create your own blog on a 10 year old domain! -> AlienSoup | | |

| | #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: 298
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: 24
Join Date: Feb 2010 Software: vbulletin 4.0 publishing suite ![]() | wow excel formula used in vb wow |
| | |

| | #26 | ||
| Novice
Posts: 45
Join Date: Apr 2010 Location: New Meadows, Idaho Experience: Intermediate Forums Admin/Mod: 2 Software: Vbulletin 4.0.2 Forum: Mopar1973Man Forum ![]() | Quote:
Whoa... hold the horse a sec... I don't need a complete list that big... But common and basic variable that are already use in most of the templates. Username, post count, etc. Then tell me where and where not they can be used... | ||
| | |||
| | |
| | #27 | ||||
![]() Join Date: Jan 2008 | Okay I'lll give it a shot. I know my syntax is off, especially with 4.0. But for laymans terms. The templates take conditional variables which in effect are codes. So say you want the bring over a profile field. Depending on where you want to show it versus what info you want to display will determine what the variable is. Say you just want a profile field to show in each post. <vb:if condition = $post[fieldx]>Display field x</vb:if> But say you want it to show next to their name on the forumdisplay page. <vb:if condition = $bbuserinfo['fieldx']>Display field x</vb:if> See where the variable differs? Now to really boggle the mind. You can add extra conditionals. <vb:if condition=$bbuserinfo['fieldx'] == 'true'>Display field x if true</vb:if> Which is where that long list is going. Each script and some templates have different sets of variables to use. That's what this thread is for is to list some of the common ones. I think it would be great if we can continue this thread for vb4 and get a list going. | June -- Luna Procer _____________________________________ ** giving hugs to the new members ** Vos planto mihi sentio bonus. | | |
| | #28 | |
| Novice
Posts: 45
Join Date: Apr 2010 Location: New Meadows, Idaho Experience: Intermediate Forums Admin/Mod: 2 Software: Vbulletin 4.0.2 Forum: Mopar1973Man Forum ![]() | Nevermind... I'm just going to give up... (sigh) I want to re-design the template and layout but I don't have enough information about the variables... There is no information or help on how to work with the templates properly. Of course if you ask anyone that build themes/skins they will ak you to open your wallet... My site is operated on donated funds so I'm extremely limited... I like to sit down with a screen print and label out the current variables lets say on the main forum page. Then take a new piece of paper and re-draw the forum page the way I would like it. But I want to add or change information displayed... Let say I like to draw out a blue print first before I go hacking up a page. Then everything just goes smoothly. Like having a Service Manual for your Dodge pickup. Then you know how tight to make all the bolts for your particular part or project. I'm not asking for every single variable but the common one used in the templates (that display information) would be prefect... I'm getting tried of the software really quick... I've spent my entire winter in front of a computer gained nearly 30 pounds and all I got to show for it is a re-colorized forum... ![]() | |
| | ||
| | |
| | #29 | ||||
![]() Join Date: Jan 2008 | Sorry to hear that. I do know what you mean. I don't know how many times such an animal has been asked for. You would think someone would have published a cheat sheet by now. To point out though most that skin forums don't ask you to open your wallet. They just won't do the work for you. Most of us learned by doing searches at the various vb sites, playing around with variables and when all else fails asking. With vb the best way is to do a rough sketch and then define the content. I'm more than willing and probably others here too will help. If you have that blueprint ready and know what information you are seeking to put somewhere. | June -- Luna Procer _____________________________________ ** giving hugs to the new members ** Vos planto mihi sentio bonus. | | |
| | #30 | |
| Novice
Posts: 45
Join Date: Apr 2010 Location: New Meadows, Idaho Experience: Intermediate Forums Admin/Mod: 2 Software: Vbulletin 4.0.2 Forum: Mopar1973Man Forum ![]() | I'm guessin' this is a variable I'm talking about... (Pulled from ForumHome tepmplate) HTML Code: {vb:raw totalonline}
Now what variables can I use lets say on the ForumHome? There is a ton of them in the template but I got no idea what some of them do or don't do? So how can I draw up a blue print when I don't know what I'm allowed to use or not allowed to use here??? Like saying I want to build a six story building in McCall, ID but the McCall building code says "5 Stories max hieght". I can still build the building but knowing I've got a limitation... So what variables are there and what can I use? I'm trying to gather up my information now so I can draw a blueprint design and see if it can be done... ![]() Then knowing the variables is like knowing if I got 2x4x8 or 2x4x10, etc... I know if it get to nail it together or screw it together... What do I got to work with? | |
|
Last edited by Mopar1973Man; April 14th, 2010 at 09:11 PM..
| ||
| | |

![]() |
| 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 |
| |