TinyPortal

Development => Support => Topic started by: Jokey on January 27, 2009, 05:50:31 AM

Title: Is it possible?
Post by: Jokey on January 27, 2009, 05:50:31 AM
Is it possible to put the logout, admin, and help links in the User box??  ???
Title: Re: Is it possible?
Post by: Crip on January 27, 2009, 10:37:16 AM
Where is Your Themes User Box Located?
Title: Re: Is it possible?
Post by: JPDeni on January 27, 2009, 03:00:41 PM
Quote from: p v c blue on January 27, 2009, 05:50:31 AM
Is it possible to put the logout, admin, and help links in the User box??  ???

Yes.
Title: Re: Is it possible?
Post by: nevoomatse on January 27, 2009, 03:20:29 PM
Quote from: JPDeni on January 27, 2009, 03:00:41 PM
Quote from: p v c blue on January 27, 2009, 05:50:31 AM
Is it possible to put the logout, admin, and help links in the User box??  ???

Yes.

Quite useful to make the "navigation bar" clean.
Can be done by editing ./Themes/default/TPBlocks.template.php under "function TPortal_userbox()".
Title: Re: Is it possible?
Post by: Jokey on January 27, 2009, 08:48:23 PM
Quote from: Crip on January 27, 2009, 10:37:16 AM
Where is Your Themes User Box Located?

Hey Crip in the usual place - ./Themes/default/TPBlocks.template.php

I just don't know what to put in it to make it happen, LOL! You know me, all graphic and no code!  :laugh:
Title: Re: Is it possible?
Post by: Jokey on January 28, 2009, 08:00:48 PM
So does anyone know what to add to make it do this?  :-\
Title: Re: Is it possible?
Post by: JPDeni on January 28, 2009, 08:11:55 PM
For logout:


if ($context['user']['is_logged'])
          echo '<a href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '">' , $txt[108] , '</a>';


For admin:


if ($context['allow_admin'])
          echo '<a href="', $scripturl, '?action=admin">' , $txt[2] , '</a>';


For help:


echo '<a href="', $scripturl, '?action=help">' , $txt[119] , '</a>';


Be sure to have $scripturl, $txt, and $context in your "global" line.

All of these are from the default index.template.php file.