PDA

View Full Version : Add Logout Button to Navbar


MultiSync77F
12-10-2009, 05:40 PM
I am using a style from this website, and I love it but there is one problem, for some reason the developer didn't include any logout links on any pages.

So I wanted to just add one to my header "Log Out" that will show on every page. Problem is what do I use for the text?

When I look at a logout link the href is


http://www.community.domain.com/login.php?do=logout&logouthash=1260473826-191a5f067c098e7250adf6f3cb90daa4b8c2b491


I tried using


http://www.community.domain.com/login.php?do=logout


but it doesn't work. I guess I need that hash part on the end? How do I get that? I'm assuming it will change for every user. So what do I need my href link to look like in order to get my log out button to work?

Thanks!

bmckinley
12-11-2009, 11:36 PM
Go to admincp>style manager>your style>edit templates>navbar template

add this:


$template_hook[navbar_buttons_right]
<if condition="$show['member']">
<td class="vbmenu_control"><a href="login.php?$session[sessionurl]do=logout&amp;logouthash=$bbuserinfo[logouthash]" onclick="return log_out('$vbphrase[sure_you_want_to_log_out]')">$vbphrase[log_out]</a></td>
</if>



directly above this:


</tr>
</table>
</div>
<!-- / nav buttons bar -->
<br />
<if condition="$show['notices']">


I think that will work.:)