Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
Ad
Old 10-30-2006, 12:56 PM   15 links from elsewhere to this Post. Click to view. #1
Supporters
vBulletin Owner
 
Brandon Sheley's Avatar
 
Join Date: Jul 2006
Location: Topeka, KS
Posts: 14,142
Blog Entries: 35
Brandon Sheley is a splendid one to beholdBrandon Sheley is a splendid one to beholdBrandon Sheley is a splendid one to beholdBrandon Sheley is a splendid one to beholdBrandon Sheley is a splendid one to beholdBrandon Sheley is a splendid one to behold
Send a message via AIM to Brandon Sheley Send a message via MSN to Brandon Sheley Send a message via Yahoo to Brandon Sheley
vBulletin Template Conditionals List

vBulletin is an excellent product that gives the admin amazing control over their vBulletin Forum directly from the templates themselves. You can use PHP if conditionals directly within the template system thanks to vBulletin.

There are too many possible ways to use conditionals to be able to list every single way but we can tackle some of the most popular ones.

I will first explain what the conditional is doing and then list the conditional below it.

If Viewer is a Member
--------------------------------------------------
If you want to show a link only to registered members you would use this conditional.
HTML Code:
<if condition="$show['member']"></if> 
If Viewer is in the Following Usergroups Array. Enter the Usergroup Number(s) Seperated by a Comma
--------------------------------------------------
If you want to show an advertisement to viewers that are unregistered, registered members and awaiting email confirmation you would use the usergroup ids 1,2,3 within the array.
HTML Code:
<if condition="is_member_of($vbulletin->userinfo, 1, 2, 3)"></if> 
If This Script Is or Is Not XXX
--------------------------------------------------
If this script is index (as used in the example below) then it will show the code within the conditional. You can use it to show a piece of code only on Forumhome if you have to put it in a template that is global such as the header. To find out what the script is per page open up the php file that loads the page like for instance showthread.php and look for
PHP Code:
define('THIS_SCRIPT''showthread'); 
and the showthread part is what you would use.
HTML Code:
<if condition="THIS_SCRIPT == 'index'"></if> 
and here you can show information on every page but the index page by using this conditional
HTML Code:
<if condition="THIS_SCRIPT != 'index'"></if> 
If this user equals or does not equal xxx
--------------------------------------------------
What this conditional will do is only show certain information if the person viewing the page has the same userid as defined within the conditional. So if you put userid 667 inside the conditional below and put a link inside the conditional tags only the user that has the userid 667 will see that link.
HTML Code:
<if condition="$bbuserinfo['userid'] == 667"></if> 
and it works the opposite way as well if you do not want information to show for 667 but you want it to show for everyone else you would use
HTML Code:
<if condition="$bbuserinfo['userid'] != 667"></if> 
Display Information To Guests Only
--------------------------------------------------
The following conditional will display information only to guests and no one else. This is helpful in displaying a welcome message that you only wish for guests to see.
HTML Code:
<if condition="$show['guest']"></if> 
Display Information On a Per Forum Basis
--------------------------------------------------
This conditional allows you to display information on a per forum basis. This can be helpful if you wish to display different advertisements depending on what forum that the user is in. You would simply replace X with the forum id that you wish the information to appear in.
HTML Code:
<if condition="$forum[forumid] == X"></if> 
and on the other hand you can use the ! to do the opposite and display the information in every forum but the id you list
HTML Code:
<if condition="$forum[forumid] != X"></if> 
or if you have multiple forums you wish to include something with you can use an array such as this
HTML Code:
<if condition="in_array($forum['forumid'], array(1,2,3,6))"></if> 
If Usergroup Is or Is Not X
--------------------------------------------------
If the user is a member of the x usergroup then show the code
HTML Code:
<if condition="$post['usergroupid'] == 6"></if> 
and then you can use the ! to tell it to not show it to the x usergroup but show it to everyone else.
HTML Code:
<if condition="$post['usergroupid'] != 6"></if> 
If Users Birthday is Less Than or Greater Than XXXX-XX-XX Do Something
--------------------------------------------------
Just to show the power of vBulletin here is a cool conditional that will show information based on the birthday of the user. The one below will show "Too Young" if they were born after 01-01-1980.
HTML Code:
<if condition="$bbuserinfo['birthday_search'] > '1980-01-01'">Too Young</if> 
and this one will show you "Too Young" if the user was born before 01-01-1980
HTML Code:
<if condition="$bbuserinfo['birthday_search'] < '1980-01-01'">Too Young</if> 
If Thread is or is not in X Forum Execute Code
--------------------------------------------------
For instance if you want a piece of code to appear within thread in a particular forum you can do so with this conditional.
HTML Code:
<if condition="$thread['forumid'] == X"></if> 
If you want to show the piece of code on every new reply on every thread but 1 forum you can use this which says if thread is in forum x do not show the code but show it for all the other threads out side of forum x.
HTML Code:
<if condition="$thread['forumid'] != X"></if> 
and of course you can define multiple forum ids with the array
HTML Code:
<if conditional="in_array($thread['forumid'], array(1,2,3,6))"></if> 
Is user moderator of any forum?
--------------------------------------------------
If the user is a moderator execute code.
HTML Code:
<if condition="can_moderate()"></if> 
Is user moderator of current forum?
--------------------------------------------------
If the user is a moderator of the current forum execute code
HTML Code:
<if condition="can_moderate($forum['forumid'])"></if> 
Is user moderator of x Forum?
--------------------------------------------------
If the user is a moderator of x forum execute code.
HTML Code:
<if condition="can_moderate($forum['x'])"></if> 
Note: can_moderate() may add queries to your page.

Is user the thread starter?
--------------------------------------------------
Is the user the thread creator? If so execute code.
HTML Code:
<if condition="$threadinfo['postuserid'] == $bbuserinfo['userid']"></if> 
Is user the thread starter?
--------------------------------------------------
If the thread is closed execute code.
HTML Code:
<if condition="!$show['closethread']"></if> 
Place Information After First Post
--------------------------------------------------
Useful for adding a advertisement or other information after the first post on every page.
HTML Code:
<if condition="!$GLOBALS['FIRSTPOSTID']"></if> 
Place Information After x Post On Every Page
--------------------------------------------------
This will add your code directly after the post number you define on each page. If you put 2 in place of x the code will appear on every page after the second post.
HTML Code:
<if condition="$post['postcount'] % $vboptions['maxposts'] == x"></if> 
Using If Else in Templates
--------------------------------------------------
You can also use If Else conditionals within your templates. The below shows you how to correctly do this.
HTML Code:
<if condition="$show['guest']">
    Show Guest This Message
<else />
    Show Everyone but guests this message
</if> 
Contributors:
- Chroder
- SirAdrian

Other Useful Sources:
- vBulletin Manual - Template Conditionals
- vBulletin Community Forum - View Single Post - How to do 3 if conditionials?

Last edited by Brandon Sheley; 02-07-2008 at 05:09 PM.
Brandon Sheley is offline   Reply With Quote
Old 11-04-2006, 02:24 AM   #2
vBulletin Owner
 
SirAdrian's Avatar
 
Join Date: Nov 2006
Posts: 42
SirAdrian will become famous soon enough
Nice list... I'm just going to post a few minor corrections / improvements:

Instead of
Code:
<if condition="in_array($bbuserinfo[usergroupid], array(1,2,3,5,6))"></if>
You should use
Code:
<if condition="is_member_of($vbulletin->userinfo, 1, 2, 3)">
or
Code:
<if condition="is_member_of($vbulletin->userinfo, array(1, 2, 3))">
The is_member_of() function will return true if you are a primary or secondary user of any of the included groups.

Second one... [more of a lecture] you should quote your array keys in these conditions. Most people think that because it's inside a template, quoting them will cause errors, but inside of template conditions is another story. Without the quotes, the interpreter will first check if they are constants and then issue an E_NOTICE. Generally this isn't a big deal since vBulletin hides them anyway, but it's good practice to do it this way. An example of this would be
Code:
<if condition="$vbulletin->userinfo[userid] == 1">
This should be replaced with
Code:
<if condition="$vbulletin->userinfo['userid'] == 1">
One good example of this is vbJournal; it completely killed it for PHP5 because of the 'private' field (PHP 5 keyword).

The final reason for this, and though it's mainly theoretical, it's a bit disturbing. You can kill about 50% of hacks by using this code:
PHP Code:
define('userid''whatever');
define('forumid''whatever');
define('usergroupid''whatever');
define('postid''whatever');
define('threadid''whatever');
// etc 

-- you can merge the changes into your post and delete this one if you'd like
SirAdrian is offline   Reply With Quote
Old 11-04-2006, 09:47 AM   #3
vBulletin Owner
 
Join Date: Oct 2006
Posts: 120
mike will become famous soon enough
Appreciate the additional information siradrian. I really love having these conditionals all narrowed down to one easy to find location.
mike is offline   Reply With Quote
Old 11-05-2006, 07:32 PM   #4
Brent
Guest
 
Posts: n/a
Thanks for these tips I will add them to my post.
  Reply With Quote
Old 12-13-2006, 05:48 AM   #5
rebelde
Guest
 
Posts: n/a
Thanks for the great resource.

Within the newreply template, neither of these would work:
HTML Code:
<if condition="$forum[forumid] == X"></if>
<if condition="in_array($thread['forumid'], array(1,2,3,6))"></if> 
I found a work around. This works!:
HTML Code:
<if condition="$forumid == 41"> 
What confuses me is that I can't get this to work:
HTML Code:
<if condition="in_array($forumid, array(1,2,3,6))"></if> 
Does anyone have any ideas on making the last one work?
  Reply With Quote
Old 12-20-2006, 09:42 AM   #6
vBulletin Owner
 
sinjix_media's Avatar
 
Join Date: Dec 2006
Posts: 19
sinjix_media will become famous soon enough
im trying to show something if its the forumhome and no other index page
is there a conditional forum forumhome?
sinjix_media is offline   Reply With Quote
Old 12-28-2006, 06:39 PM   #7
Supporters
vBulletin Owner
 
Brandon Sheley's Avatar
 
Join Date: Jul 2006
Location: Topeka, KS
Posts: 14,142
Blog Entries: 35
Brandon Sheley is a splendid one to beholdBrandon Sheley is a splendid one to beholdBrandon Sheley is a splendid one to beholdBrandon Sheley is a splendid one to beholdBrandon Sheley is a splendid one to beholdBrandon Sheley is a splendid one to behold
Send a message via AIM to Brandon Sheley Send a message via MSN to Brandon Sheley Send a message via Yahoo to Brandon Sheley
Quote:
Originally Posted by Brent View Post
Try using this one
HTML Code:
<if condition="THIS_SCRIPT != 'arcade' AND != 'adv_index'"></if> 


Code:
Parse error: parse error, unexpected T_IS_NOT_EQUAL in /home/content/r/s/o/rsoto23/html/includes/adminfunctions_template.php(3593) : eval()'d code on line 26

I think the client is just going to remove the column

thanks anyways
__________________
I've been offering Web Services since 2006, here are some past vBulletin Clients
A few of my forums & post count Entertainment | General Discussions | News Nebula
Create your own blog on a 10 year old domain! -> AlienSoup
Brandon Sheley is offline   Reply With Quote
Old 12-28-2006, 09:32 PM   #8
Brent
Guest
 
Posts: n/a
That is odd why that isnt' working
  Reply With Quote
Old 01-05-2007, 11:42 PM   #9
vBulletin Owner
 
SirAdrian's Avatar
 
Join Date: Nov 2006
Posts: 42
SirAdrian will become famous soon enough
<if condition="THIS_SCRIPT != 'arcade' AND THIS_SCRIPT != 'adv_index'"></if>
SirAdrian is offline   Reply With Quote
Old 01-11-2007, 10:38 AM   #10
Supporters
vBulletin Owner
 
Brandon Sheley's Avatar
 
Join Date: Jul 2006
Location: Topeka, KS
Posts: 14,142
Blog Entries: 35
Brandon Sheley is a splendid one to beholdBrandon Sheley is a splendid one to beholdBrandon Sheley is a splendid one to beholdBrandon Sheley is a splendid one to beholdBrandon Sheley is a splendid one to beholdBrandon Sheley is a splendid one to behold
Send a message via AIM to Brandon Sheley Send a message via MSN to Brandon Sheley Send a message via Yahoo to Brandon Sheley
After looking at it, I think there was some code in the header and on the actual portal templates too ?
either way, it's looking like they want now, thanks for the help both of you
__________________
I've been offering Web Services since 2006, here are some past vBulletin Clients
A few of my forums & post count Entertainment | General Discussions | News Nebula
Create your own blog on a 10 year old domain! -> AlienSoup
Brandon Sheley is offline   Reply With Quote
Old 01-30-2007, 04:36 PM   #11
vBulletin Owner
 
SirAdrian's Avatar
 
Join Date: Nov 2006
Posts: 42
SirAdrian will become famous soon enough
Sorry I just noticed a typo that a few of you have quoted. I updated post #9

missed the array( ... ) around the list of items.
SirAdrian is offline   Reply With Quote
Old 02-01-2007, 11:52 AM   #12
Get Shorty
Guest
 
Posts: n/a
Quote:
Originally Posted by SirAdrian View Post
Code:
<if condition="!in_array(THIS_SCRIPT, array('arcade', 'adv_index'))"> ... </if>
You just helped me out a bunch.
  Reply With Quote
Old 02-01-2007, 06:54 PM   #13
Supporters
vBulletin Owner
 
Brandon Sheley's Avatar
 
Join Date: Jul 2006
Location: Topeka, KS
Posts: 14,142
Blog Entries: 35
Brandon Sheley is a splendid one to beholdBrandon Sheley is a splendid one to beholdBrandon Sheley is a splendid one to beholdBrandon Sheley is a splendid one to beholdBrandon Sheley is a splendid one to beholdBrandon Sheley is a splendid one to behold
Send a message via AIM to Brandon Sheley Send a message via MSN to Brandon Sheley Send a message via Yahoo to Brandon Sheley
okay, I have another question for the pros

a client has a side column and would like to she the 5 newest post to show.

is there an easy variable or code that we can place in the column and it'll show the 5 newest post ?

thank you

-Brandon
__________________
I've been offering Web Services since 2006, here are some past vBulletin Clients
A few of my forums & post count Entertainment | General Discussions | News Nebula
Create your own blog on a 10 year old domain! -> AlienSoup
Brandon Sheley is offline   Reply With Quote
Old 02-19-2007, 02:08 AM   #14
Brent
Guest
 
Posts: n/a
RSS would be the best way to do that wouldn't it?

I need a conditional that will only show an item on the first page of the thread.
  Reply With Quote
Old 03-06-2007, 06:22 AM   #15
devil dawgg
Guest
 
Posts: n/a
I have a stupied question where do i put these codes you guys are posting for example the ones in the very first post?
  Reply With Quote
Old 03-10-2007, 03:53 PM   #16
Brent
Guest
 
Posts: n/a
Quote:
Originally Posted by devil dawgg View Post
I have a stupied question where do i put these codes you guys are posting for example the ones in the very first post?
In any template where you want them to take effect.
  Reply With Quote
Old 04-05-2007, 02:55 AM   #17
Antivirus
Guest
 
Posts: n/a
nice list brent! It's a good collection which I have been referring to lately. Thanks.
  Reply With Quote
Old 04-05-2007, 02:59 PM   #18
Brent
Guest
 
Posts: n/a
Thanks and welcome to the site
  Reply With Quote
Old 04-08-2007, 12:55 PM   #19
aku
Guest
 
Posts: n/a
hi,
found a link for this article via vb.org
really needed this thanks!

I tried using:

<if condition="$post['usergroupid'] != 25">
<img src="yadayada.com/12.gif">
</if>

To display a banner to everyone except that user group.

However even that usergroup sees the banner.

I think the problem is being caused because it is not a primary usergroup, but an additional one.

Can someone kindly guide me how I would use an IF statement to check if the person is a member of the additional usergroup or not?

Thanks
aku
  Reply With Quote
Old 04-16-2007, 01:16 AM   #20
vBulletin Owner
 
RedMatrix's Avatar
 
Join Date: Sep 2006
Location: ForumAdminDojo.com
Posts: 207
RedMatrix is just really niceRedMatrix is just really nice
Maybe try the long way:

HTML Code:
<if condition="is_member_of($vbulletin->userinfo, 1, 2, 3, 4, 5, 6, 7, ... 24, 26, 27 .. N)">
 <img src="yadayada.com/12.gif">
</if> 
Just put all the other user group numbers that you use except 25 and see if that works.
RedMatrix is offline   Reply With Quote
Old 06-01-2007, 04:32 PM   #21
vBulletin Owner
 
sinjix_media's Avatar
 
Join Date: Dec 2006
Posts: 19
sinjix_media will become famous soon enough
Re: vBulletin Template Conditionals List

I'm using
Code:
<ul>
    <li <if condition="THIS_SCRIPT != 'index'">id="current"</if>><a href="$vboptions[bburl]">Home</a></li>
    <li <if condition="THIS_SCRIPT != 'index'">id="current"</if>><a href="$vboptions[bburl]">Forums</a></li>
    <li <if condition="THIS_SCRIPT != 'ppindex'">id="current"</if>><a href="$vboptions[bburl]">Gallery</a></li>
    <li <if condition="THIS_SCRIPT != 'usercp'">id="current"</if>><a href="$vboptions[bburl]/usercp">Profile</a></li>
    <li <if condition="THIS_SCRIPT != 'Tags'">id="current"</if>><a href="$vboptions[bburl]/tags/">Tags</a></li>
  </ul>
It's not working.
What am I doing wrong?
sinjix_media is offline   Reply With Quote
Old 06-01-2007, 05:06 PM   #22
Supporters
vBulletin Owner
 
Brandon Sheley's Avatar
 
Join Date: Jul 2006
Location: Topeka, KS
Posts: 14,142
Blog Entries: 35
Brandon Sheley is a splendid one to beholdBrandon Sheley is a splendid one to beholdBrandon Sheley is a splendid one to beholdBrandon Sheley is a splendid one to beholdBrandon Sheley is a splendid one to beholdBrandon Sheley is a splendid one to behold
Send a message via AIM to Brandon Sheley Send a message via MSN to Brandon Sheley Send a message via Yahoo to Brandon Sheley
Re: vBulletin Template Conditionals List

I see 2 ">>" and you want all links to point to the forum ?
__________________
I've been offering Web Services since 2006, here are some past vBulletin Clients
A few of my forums & post count Entertainment | General Discussions | News Nebula
Create your own blog on a 10 year old domain! -> AlienSoup
Brandon Sheley is offline   Reply With Quote
Old 07-22-2007, 02:07 AM   #23
Supporters
vBulletin Owner
 
Michael Biddle's Avatar
 
Join Date: Aug 2006
Location: Anaheim, CA
Posts: 1,656
Michael Biddle is just really niceMichael Biddle is just really niceMichael Biddle is just really nice
Test

test
test
test
__________________
I hate that someone changed my signature.
Michael Biddle is offline   Reply With Quote
Old 08-30-2007, 02:30 PM   #24
Supporters
vBulletin Owner
 
Michael Biddle's Avatar
 
Join Date: Aug 2006
Location: Anaheim, CA
Posts: 1,656
Michael Biddle is just really niceMichael Biddle is just really niceMichael Biddle is just really nice
vBulletin Template Condition List

vBulletin is an excellent product that gives the admin amazing control over their vBulletin Forum directly from the templates themselves. You can use PHP if conditionals directly within the template system thanks to vBulletin.

There are too many possible ways to use conditionals to be able to list every single way but we can tackle some of the most popular ones.

I will first explain what the conditional is doing and then list the conditional below it.

If Viewer is a Member
--------------------------------------------------
If you want to show a link only to registered members you would use this conditional.
HTML Code:
<if condition="$show['member']"></if> 
If Viewer is in the Following Usergroups Array. Enter the Usergroup Number(s) Seperated by a Comma
--------------------------------------------------
If you want to show an advertisement to viewers that are unregistered, registered members and awaiting email confirmation you would use the usergroup ids 1,2,3 within the array.
HTML Code:
<if condition="is_member_of($vbulletin->userinfo, 1, 2, 3)"></if> 
If This Script Is or Is Not XXX
--------------------------------------------------
If this script is index (as used in the example below) then it will show the code within the conditional. You can use it to show a piece of code only on Forumhome if you have to put it in a template that is global such as the header. To find out what the script is per page open up the php file that loads the page like for instance showthread.php and look for
PHP Code:
define('THIS_SCRIPT''showthread'); 
and the showthread part is what you would use.
HTML Code:
<if condition="THIS_SCRIPT == 'index'"></if> 
and here you can show information on every page but the index page by using this conditional
HTML Code:
<if condition="THIS_SCRIPT != 'index'"></if> 
If this user equals or does not equal xxx
--------------------------------------------------
What this conditional will do is only show certain information if the person viewing the page has the same userid as defined within the conditional. So if you put userid 667 inside the conditional below and put a link inside the conditional tags only the user that has the userid 667 will see that link.
HTML Code:
<if condition="$bbuserinfo['userid'] == 667"></if> 
and it works the opposite way as well if you do not want information to show for 667 but you want it to show for everyone else you would use
HTML Code:
<if condition="$bbuserinfo['userid'] != 667"></if> 
Display Information To Guests Only
--------------------------------------------------
The following conditional will display information only to guests and no one else. This is helpful in displaying a welcome message that you only wish for guests to see.
HTML Code:
<if condition="$show['guest']"></if> 
Display Information On a Per Forum Basis
--------------------------------------------------
This conditional allows you to display information on a per forum basis. This can be helpful if you wish to display different advertisements depending on what forum that the user is in. You would simply replace X with the forum id that you wish the information to appear in.
HTML Code:
<if condition="$forum[forumid] == X"></if> 
and on the other hand you can use the ! to do the opposite and display the information in every forum but the id you list
HTML Code:
<if condition="$forum[forumid] != X"></if> 
or if you have multiple forums you wish to include something with you can use an array such as this
HTML Code:
<if condition="in_array($forum['forumid'], array(1,2,3,6))"></if> 
If Usergroup Is or Is Not X
--------------------------------------------------
If the user is a member of the x usergroup then show the code
HTML Code:
<if condition="$post['usergroupid'] == 6"></if> 
and then you can use the ! to tell it to not show it to the x usergroup but show it to everyone else.
HTML Code:
<if condition="$post['usergroupid'] != 6"></if> 
If Users Birthday is Less Than or Greater Than XXXX-XX-XX Do Something
--------------------------------------------------
Just to show the power of vBulletin here is a cool conditional that will show information based on the birthday of the user. The one below will show "Too Young" if they were born after 01-01-1980.
HTML Code:
<if condition="$bbuserinfo['birthday_search'] > '1980-01-01'">Too Young</if> 
and this one will show you "Too Young" if the user was born before 01-01-1980
HTML Code:
<if condition="$bbuserinfo['birthday_search'] < '1980-01-01'">Too Young</if> 
If Thread is or is not in X Forum Execute Code
--------------------------------------------------
For instance if you want a piece of code to appear within thread in a particular forum you can do so with this conditional.
HTML Code:
<if condition="$thread['forumid'] == X"></if> 
If you want to show the piece of code on every new reply on every thread but 1 forum you can use this which says if thread is in forum x do not show the code but show it for all the other threads out side of forum x.
HTML Code:
<if condition="$thread['forumid'] != X"></if> 
and of course you can define multiple forum ids with the array
HTML Code:
<if conditional="in_array($thread['forumid'], array(1,2,3,6))"></if> 
Is user moderator of any forum?
--------------------------------------------------
If the user is a moderator execute code.
HTML Code:
<if condition="can_moderate()"></if> 
Is user moderator of current forum?
--------------------------------------------------
If the user is a moderator of the current forum execute code
HTML Code:
<if condition="can_moderate($forum['forumid'])"></if> 
Is user moderator of x Forum?
--------------------------------------------------
If the user is a moderator of x forum execute code.
HTML Code:
<if condition="can_moderate($forum['x'])"></if> 
Note: can_moderate() may add queries to your page.

Is user the thread starter?
--------------------------------------------------
Is the user the thread creator? If so execute code.
HTML Code:
<if condition="$threadinfo['postuserid'] == $bbuserinfo['userid']"></if> 
Is user the thread starter?
--------------------------------------------------
If the thread is closed execute code.
HTML Code:
<if condition="!$show['closethread']"></if> 
Place Information After First Post
--------------------------------------------------
Useful for adding a advertisement or other information after the first post on every page.
HTML Code:
<if condition="!$GLOBALS['FIRSTPOSTID']"></if> 
Place Information After x Post On Every Page
--------------------------------------------------
This will add your code directly after the post number you define on each page. If you put 2 in place of x the code will appear on every page after the second post.
HTML Code:
<if condition="$post['postcount'] % $vboptions['maxposts'] == x"></if> 
Using If Else in Templates
--------------------------------------------------
You can also use If Else conditionals within your templates. The below shows you how to correctly do this.
HTML Code:
<if condition="$show['guest']">
    Show Guest This Message
<else />
    Show Everyone but guests this message
</if> 
Contributors:
- Chroder
- SirAdrian

Other Useful Sources:
- vBulletin Manual - Template Conditionals
- vBulletin Community Forum - View Single Post - How to do 3 if conditionials?
- vBulletin Setup - Thanks
__________________
I hate that someone changed my signature.
Michael Biddle is offline   Reply With Quote
Old 08-30-2007, 06:02 PM   #25
Supporters
vBulletin Owner
 
Brandon Sheley's Avatar
 
Join Date: Jul 2006
Location: Topeka, KS
Posts: 14,142
Blog Entries: 35
Brandon Sheley is a splendid one to beholdBrandon Sheley is a splendid one to beholdBrandon Sheley is a splendid one to beholdBrandon Sheley is a splendid one to beholdBrandon Sheley is a splendid one to beholdBrandon Sheley is a splendid one to behold
Send a message via AIM to Brandon Sheley Send a message via MSN to Brandon Sheley Send a message via Yahoo to Brandon Sheley
Re: vBulletin Template Condition List

I don't know how many times I've came to this list to figure out how to hide something

Thanks for posting it Mike
Brandon Sheley is offline   Reply With Quote
Old 08-31-2007, 09:58 AM   #26
vBulletin Owner
 
Norman's Avatar
 
Join Date: Feb 2007
Location: [Italy]
Posts: 48
Norman will become famous soon enough
Send a message via MSN to Norman
Re: vBulletin Template Condition List

Thanks!
Norman is offline   Reply With Quote
Old 10-30-2007, 12:52 AM   #27
vBulletin Owner
 
Join Date: Oct 2007
Posts: 3
StupiDeity will become famous soon enough
Re: vBulletin Template Conditionals List

Hi

I am almost a n00b with vB. I've been trying to find the conditional for the user join date but have been unsuccessful till now.

Anybody know how I can get to that piece of user data?

Cheers!
StupiDeity is offline   Reply With Quote
Old 10-30-2007, 03:18 AM   #28
vBulletin Owner
 
Ross's Avatar
 
Join Date: May 2007
Posts: 109
Ross has a spectacular aura about
Re: vBulletin Template Conditionals List

$vbphrase[join_date]: <strong>$userinfo[datejoined]</strong>

That is what I am using

Hope this helps,

Ross
Ross is offline   Reply With Quote
Old 10-30-2007, 05:31 AM   #29
vBulletin Owner
 
Join Date: Oct 2007
Posts: 3
StupiDeity will become famous soon enough
Re: vBulletin Template Conditionals List

Hey thanx dude!

I will try it out tonight.

May the forks be with you

Cheers!
StupiDeity is offline   Reply With Quote
Old 12-05-2007, 01:39 AM   #30
vBulletin Owner
 
Norman's Avatar
 
Join Date: Feb 2007
Location: [Italy]
Posts: 48
Norman will become famous soon enough
Send a message via MSN to Norman
Re: vBulletin Template Conditionals List

Nice list! Thank you.
Norman is offline   Reply With Quote
Reply 

Tags
conditionals, list, template, vbulletin

Thread Tools
Display Modes

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


LinkBacks (?)
LinkBack to this Thread: http://forum.vbulletinsetup.com/f18/vbulletin-template-conditionals-list-2185.html
Posted By For Type Date
if condition show code only in forumid in forumdiplay - vBulletin Community Forum This thread Refback 07-27-2009 12:32 PM
Adding text to show in the first post of every thread - WJunction This thread Refback 07-23-2009 01:17 PM
Condition - vBulletin-Germany.org Forum This thread Refback 07-09-2009 01:44 PM
Sidebar Help - vBulletin.org Forum This thread Refback 07-07-2009 02:27 PM
Can you set it up so signatures do not appear in certain sections? - vBulletin Community Forum This thread Refback 07-05-2009 03:29 PM
Vbulletin Template Ad Code This thread Refback 06-11-2009 10:16 PM
Tune vBulletin: 11 vB AdSense resources for your forum This thread Refback 06-11-2009 09:32 AM
AdSense inside post for vBulletin This thread Refback 03-26-2009 05:39 PM
vBulletin Template Conditionals List - ForumThemes Forums This thread Pingback 01-15-2009 02:40 PM
Chatbox to appear in a thread / its own page? - vBulletin.org Forum This thread Refback 11-22-2008 10:11 AM
Modifying Footer template - vBulletin.org Forum This thread Refback 11-05-2008 06:56 PM
Critique my Site: GridironFans.com - vBulletin SEO Forums This thread Pingback 10-15-2008 08:34 PM
<if> statement based on forum ID? - vBulletin.org Forum This thread Refback 09-24-2008 11:26 AM
Lista Condizionali dei Template vBulletin - vB-Italy.org This thread Refback 08-08-2008 06:41 AM
Only show for X usergroup - vBulletin.org Forum This thread Refback 09-23-2007 11:47 AM
ads on forum pages - vBulletin Modifications This thread Refback 09-08-2007 01:02 PM

Similar Threads
Thread Thread Starter Forum Replies Last Post
vBulletin Template for Sale - $50 - SOLD! Mikey Graphics/Design/Logos 13 07-14-2009 03:10 PM
vBulletin Variables List Brandon Sheley Troubleshooting vBulletin Problems 27 05-19-2009 05:36 PM
How to make a vBAdvanced module from vBulletin custom template? valdet Troubleshooting vBulletin Problems 6 12-04-2008 04:59 AM
List your vBulletin Modifications Rocket 442 Troubleshooting vBulletin Problems 19 05-13-2008 09:31 AM
Make your vBulletin SHOWTHREAD_SHOWPOST template Search Engine Friendly Code Monkey vBulletin Tutorials 10 10-19-2006 01:40 PM


All times are GMT -8. The time now is 07:31 AM.

Powered by vBulletin®Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
vBulletin Setup © 2009 is in no way affiliated with Jelsoft



Design by: vBulletinSetup