AdminAddict

Join Us Members List Today's Posts
Go Back   AdminAddict > Forum and Community Development > Community/Forum Software > vBulletin

Discuss vBulletin 4 Template Conditionals List in vBulletin at AdminAddict
This is an updated list of conditionals with the syntax used in vBulletin 4. A preview of the syntax was ...

Welcome to the AdminAddict.

Hello and welcome to AdminAddict! The one-stop resource for forum and community administrators.

We offer a variety of content and resources, but in order to have access to all of our free tips and tools, you need to register a FREE account.

Registration is free, quick and easy.



(Register to remove this advertisement)
Reply
 
Share Thread Tools Search this Thread
Old September 7th, 2009, 02:10 PM   #1
Nick's Avatar
Posts: 7,328


Default vBulletin 4 Template Conditionals List

This is an updated list of conditionals with the syntax used in vBulletin 4. A preview of the syntax was made available on Wayne Luke's site, vBCodex and is the basis from which I have formed this list.

As of writing, vB 4 isn't even out yet (it's in Alpha testing) so this won't be of use to you just yet, but at least you know it's here and we have it. Might as well add it to your bookmarks now so you have it when you need it.

------

Viewer is a guest
Code:
<vb:if condition="$show['guest']"> </vb:if>
Viewer is a member
Code:
<vb:if condition="$show['member']"> </vb:if>
Viewer is in a specific usergroup (In this example, 6 is the usergroup ID. You can add more using commas)
Code:
<vb:if condition="$is_member_of($bbuserinfo,6)" /></vb:if>
Viewer has a specific User ID (user ID = X)
Code:
<vb:if condition="$bbuserinfo['userid'] == X"> </vb:if>
------


This list will be updated and maintained as time goes on and more information becomes available.
Best Regards,
Nick


Support AdminAddict // Purchase from the following reputable vendors:
HostGator / Liquid Web / DriveThruOnline - Professional vBulletin Products / NameCheap Domains

Compare Hosting Plans
VPSDedicated Servers


Nick is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiTwitterShare on Facebook
Reply With Quote

2 out of 2 members found this post helpful.
Old September 7th, 2009, 02:12 PM   #2
Zealot
Posts: 1,730
Join Date: May 2009

Experience: Advanced
Forums Admin/Mod: 2
Software: vBulletin

Michael is a glorious beacon of lightMichael is a glorious beacon of lightMichael is a glorious beacon of lightMichael is a glorious beacon of lightMichael is a glorious beacon of light
Default

Awesome Nick, I have bookmarked!
Message Boards Directory - Free Directory for forums with over 10,000 posts.

Teen Forum
Michael is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiTwitterShare on Facebook
Reply With Quote

Old September 7th, 2009, 05:21 PM   #3
Grand Master


Default

any reason why the moved from the easy format of

<if condition="$show[member]">

to the new syntax?

Is the <vb: part of it, so it can be broken down to application specific sections? Like their new CMS

<cms: if condition="$show['guest']"> </cms:if>
Looking for web hosting? Look no further than Web Hosting Review Shop be sure to leave your hosting experience as well.
Personal Blog of BS


Last edited by David McHenry; September 7th, 2009 at 05:24 PM..
David McHenry is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiTwitterShare on Facebook
Reply With Quote

Old September 7th, 2009, 05:29 PM   #4
Zealot
Posts: 1,730
Join Date: May 2009

Experience: Advanced
Forums Admin/Mod: 2
Software: vBulletin

Michael is a glorious beacon of lightMichael is a glorious beacon of lightMichael is a glorious beacon of lightMichael is a glorious beacon of lightMichael is a glorious beacon of light
Default

Quote:
Originally Posted by BSMedia View Post
any reason why the moved from the easy format of

<if condition="$show[member]">

to the new syntax?

Is the <vb: part of it, so it can be broken down to application specific sections? Like their new CMS

<cms: if condition="$show['guest']"> </cms:if>
I wouldnt be surprised if that is true, sounds dead on to me
Message Boards Directory - Free Directory for forums with over 10,000 posts.

Teen Forum
Michael is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiTwitterShare on Facebook
Reply With Quote

Old September 7th, 2009, 05:30 PM   #5
Nick's Avatar
Posts: 7,328


Default

Quote:
Originally Posted by BSMedia View Post
any reason why the moved from the easy format of

<if condition="$show[member]">

to the new syntax?

Is the <vb: part of it, so it can be broken down to application specific sections? Like their new CMS

<cms: if condition="$show['guest']"> </cms:if>
Wayne explains some of the reasons for the changes, here:

Quote:
The problem though with template hooks, <if> conditionals and <phrase> tags is that it made it very difficult to work with templates in tools like Dreamweaver and Go Live!. Syntax highlighting was off, variables didn't render and preview was a general mess. With the move to an object oriented template system in vBulletin 4, this would have become even worse over time. So the developers decided to move vBulletin's proprietary tags to their own namespace and create a better way of presenting variables within the templates.
Template First Look at vBulletin 4 Template Variables - vBCodex
Best Regards,
Nick


Support AdminAddict // Purchase from the following reputable vendors:
HostGator / Liquid Web / DriveThruOnline - Professional vBulletin Products / NameCheap Domains

Compare Hosting Plans
VPSDedicated Servers


Nick is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiTwitterShare on Facebook
Reply With Quote

Old September 7th, 2009, 05:50 PM   #6
Champion
Posts: 329
Join Date: Aug 2009

Experience: Advanced
Forums Admin/Mod: 4
Software: Various

twhiting9275 is on a distinguished road
Default

So in order to help those that can't do the job right, we get stuck with more complicated templates. NOT good
twhiting9275 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiTwitterShare on Facebook
Reply With Quote

Old September 8th, 2009, 07:24 AM   #7
Grand Master
kneel's Avatar
Posts: 541
Join Date: Jun 2009
Location: 0HI0

Experience: Intermediate
Forums Admin/Mod: 4
Software: 3.8.5

kneel will become famous soon enoughkneel will become famous soon enough
Default

waynes site is an amazing thing...

thanks for this mane!!
Also Make Sure To TheMysteryDistrict.com!!
kneel is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiTwitterShare on Facebook
Reply With Quote

Old September 8th, 2009, 02:56 PM   #8
Grand Master
cheat-master30's Avatar
Posts: 793
Join Date: Jul 2009

Experience: Advanced
Forums Admin/Mod: 1
Software: vBulletin 3.8.x

cheat-master30 is just really nicecheat-master30 is just really nicecheat-master30 is just really nicecheat-master30 is just really nice
View cheat-master30's YouTube Channel View cheat-master30's Twitter Profile
Default

Thanks for the list Nick. This should help anyone who wants to start converting the simpler modifications on their forum to vBulletin 4 versions.
DS Ultimate Forums- A Nintendo DS forum

-cheat-master30; Someone who probably posts way more on forums than anyone ever should.
cheat-master30 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiTwitterShare on Facebook
Reply With Quote

Old September 8th, 2009, 04:04 PM   #9
Champion
Lynne's Avatar
Posts: 325
Location: California

Experience: Advanced
Forums Admin/Mod: 2
Software: vBulletin 3.8.x

Default

Quote:
Originally Posted by twhiting9275 View Post
So in order to help those that can't do the job right, we get stuck with more complicated templates. NOT good
How is simply sticking a vb: in front of the if "more complicated". It really is just that simple.

Lynne is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiTwitterShare on Facebook
Reply With Quote

Old September 8th, 2009, 04:11 PM   #10
Zealot
Posts: 1,730
Join Date: May 2009

Experience: Advanced
Forums Admin/Mod: 2
Software: vBulletin

Michael is a glorious beacon of lightMichael is a glorious beacon of lightMichael is a glorious beacon of lightMichael is a glorious beacon of lightMichael is a glorious beacon of light
Default

Quote:
Originally Posted by Lynne View Post
How is simply sticking a vb: in front of the if "more complicated". It really is just that simple.
I think adding anything extra to the code which is already there may make it more daunting for beginners to look at. The normal ifs when I first seen them looked really hard to use and with adding vb: or other prefixes it may make the first look of them even more daunting to beginners to the software.
Message Boards Directory - Free Directory for forums with over 10,000 posts.

Teen Forum
Michael is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiTwitterShare on Facebook
Reply With Quote

Old September 8th, 2009, 05:04 PM   #11
This means something...
Chani's Avatar
Posts: 885
Join Date: Sep 2009
Location: MN

Experience: Intermediate
Forums Admin/Mod: 3
Software: vBulletin 3.8.x

Chani is a splendid one to beholdChani is a splendid one to beholdChani is a splendid one to beholdChani is a splendid one to beholdChani is a splendid one to beholdChani is a splendid one to beholdChani is a splendid one to behold
Default

I both like this and dislike this.

I think it'll be cool to be able to add PHP into your templates, but then again, having PHP and HTML separate (gently merged) in vB's current form is one of the things that makes it so easy to edit. (Ever templated a Zen-Cart site??? )

As long as the code remains somewhat portable within the site, I'm sure I'll get used to it.
10% of all purchases using this link will go to AA.
Don't forget Coupon Code 10FOR2010 for a 10% discount.
Chani is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiTwitterShare on Facebook
Reply With Quote

Old September 8th, 2009, 05:12 PM   #12
Default

The problem is the current syntax is invalid and causes validation to fail if you check just a template. However by adding a namespace, you can get around that and it is the proper way to code it.

The most important part though is that is modular and expandable. The new system allows the use of loops in templates as well as special variable syntax for parsing things like dates, times, and numbers within the templates instead of the PHP Code. This allows you to present more customized experiences to your end users as an administrator without worrying about the PHP code. It allows programmers to give you more tools through addons to customize it even more.

I doubt there will be PHP in the templates and the new syntax is less PHP-like than before. You'll need to keep your PHP in plugins where it belongs.
vBCodex - Get help building your vBulletin community.
Get Gravatar support for your vBulletin community.
-- Please do not contact me via PM for vBulletin Support.
Wayne Luke is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiTwitterShare on Facebook
Reply With Quote

Old September 8th, 2009, 05:28 PM   #13
Grand Master


Default

Quote:
Originally Posted by Wayne Luke View Post
The problem is the current syntax is invalid and causes validation to fail if you check just a template. However by adding a namespace, you can get around that and it is the proper way to code it.

The most important part though is that is modular and expandable. The new system allows the use of loops in templates as well as special variable syntax for parsing things like dates, times, and numbers within the templates instead of the PHP Code. This allows you to present more customized experiences to your end users as an administrator without worrying about the PHP code. It allows programmers to give you more tools through addons to customize it even more.

I doubt there will be PHP in the templates and the new syntax is less PHP-like than before. You'll need to keep your PHP in plugins where it belongs.

Thanks for the update on why the change occurred. I personally don't find it any more difficult to stick vb in front of a condition.
Looking for web hosting? Look no further than Web Hosting Review Shop be sure to leave your hosting experience as well.
Personal Blog of BS
David McHenry is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiTwitterShare on Facebook
Reply With Quote

Old September 14th, 2009, 08:22 PM   #14
Webmist's Avatar
Join Date: Jan 2008


Default

You know this reminds me of coding for Joomla.

Do you think we'll have an actual list of conditionals? I would really like to see that in the release.
June -- Luna Procer
_____________________________________
** giving hugs to the new members **
Vos planto mihi sentio bonus.
Webmist is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiTwitterShare on Facebook
Reply With Quote

Old September 14th, 2009, 08:46 PM   #15
Grand Master


Default

Quote:
Originally Posted by Webmist View Post
You know this reminds me of coding for Joomla.

Do you think we'll have an actual list of conditionals? I would really like to see that in the release.

From the looks of it, they aren't really changing over current conditionals. I'd imagine there maybe some new ones, and some small changes/tweaks to the current ones, but for the most part it seems its simply a new syntax to prefix the conditional with <vb:
Looking for web hosting? Look no further than Web Hosting Review Shop be sure to leave your hosting experience as well.
Personal Blog of BS
David McHenry is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiTwitterShare on Facebook
Reply With Quote

Reply

Tags
conditionals, List, template, vBulletin

AdminAddict > Forum and Community Development > Community/Forum Software > vBulletin > vBulletin 4 Template Conditionals List


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 08:02 PM.
Powered by vBulletin®, ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
Copyright ©2008-2010 AdminAddict, All Rights Reserved


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53