View Full Version : [HowTo][306] End-user Switch getnew/getdaily


Floris
14th February 2005, 05:56 AM
[HowTo][306] End-user Switch getnew/getdaily



This guide will show you the benefits of custom profile fields, in this case to let give your members the choice to switch between getnew/getdaily; respectivly to the navbar showing either 'New Posts' or 'Today's Posts'.

First, go to the admin control panel > user profile fields > add a new profile field:
single selection menu, and give it a title & description, set it up like you want it and enter as value, getnew, getdaily (each on a new line) in the big text area.

Check in the profile field manager what the field id is and remember it.

Now open the navbar template and find the 'new post' code .. notice that it is a conditional for guests & members .. we are extending it:

here is the code.


<td class="vbmenu_control">
<if condition="$show['member']">
<if condition="$bbuserinfo['field12'] == 'getdaily'">
<a href="search.php?$session[sessionurl]do=getdaily" accesskey="2">$vbphrase[todays_posts]</a>
<else />
<a href="search.php?$session[sessionurl]do=getnew" accesskey="2">$vbphrase[new_posts_nav]</a>
</if>
<else />
<a href="search.php?$session[sessionurl]do=getdaily" accesskey="2">$vbphrase[todays_posts]</a>
</if>
</td>



I'm sure you can figure it out!
enjoy.