Monday 30 March 2009

VBulletin : Front page message that only displays if logged in

On a job to update vBulletin here is a code snippet that so you can display a personalised message for your logged in users. Or display another message if their not.

This is just an example as this text is already include by default, howwever you may want to change it to something else.

<!-- welcome msg start DJ -->
<if condition="THIS_SCRIPT == 'index'">
<if condition="$bbuserinfo['userid'] == 0">
<br>
<table class="tborder" cellpadding="6" cellspacing="1" border="1" width="100%" align="center">
<thead>
<tr align="left">
<td class="tcat"> Welcome to the Forum.
</td>
</tr>
<tr align="center">
<td class="alt1"> If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. tst
</td>
</tr>
</thead>
</table>
<br>
<else />
<br>
<table class="tborder" cellpadding="6" cellspacing="1" border="1" width="100%" align="center">
<thead>
<tr align="left">
<td class="tcat">
Welcome back, $bbuserinfo[username].
</td>
</tr>
<tr align="center">
<td class="alt1"> <a href="search.php?do=getnew">Click here to view new posts</a>.</td>
</tr>
</thead>
</table>
<br>

There's a really handy list of conditional commands for vBulletin at this address
http://forum.vbulletinsetup.com/f18/vbulletin-template-conditionals-list-2185.html


</if>
</if>

<!-- welcome msg end DJ -->

No comments: