• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.2 logout on moderator bar

Adam Howard

Well-known member
#1
So the goal is to add a log-out link (button) on the moderator bar. This sounded a lot easier than it I thought it would be.

This is how far I've gotten it

www.sociallyuncensored.eu 2013-8-29 19 5 10.png

The idea is to have it located on the right side of "Admin". And finally, to get it to actually show up for normal members.

The coded added to the template moderator_bar that I'm using is

PHP:
<ul>
           <li><a href="{xen:link logout, '', '_xfToken={$visitor.csrf_token_page}'}"
             class="LogOut">{xen:phrase log_out}</a></li>
         </ul>
 

Adam Howard

Well-known member
#2
I'm fairly sure this should be visable to logged in members, but its not. :(

moderator_bar

PHP:
<xen:if is="{$visitor.user_id}">
           <a href="{xen:link logout, '', '_xfToken={$visitor.csrf_token_page}'}"
             class="LogOut">{xen:phrase log_out}</a>
</xen:if>
       <span class="helper"></span>
www.sociallyuncensored.eu 2013-8-29 20 55 58.png

It's on the left side.... I wanted it on the right side, but I can live with it.

I just need it so others can see that "Log Out" link & not just staff.