Please login or register.

Login with username, password and session length
Advanced search  

News:

You need/want an older version of sNews ? Download an older/unsupported version here.

Author Topic: [MINI MOD] Logout Link In Footer  (Read 1788 times)

OKParrothead

  • Newbie
  • *
  • Karma: 0
  • Posts: 6
[MINI MOD] Logout Link In Footer
« on: July 16, 2008, 09:08:02 pm »

Hello sNews Forum,

Just started using sNews. I think its great! I always take a look at my content in the site itself as I finish, and forget to logout on the admin page. I added a logout link in the footer so I can logout from any page.

Here's how to do it:

Where you see this code: (line 360 in V1.6)

Code: [Select]
// LOGIN LOGOUT LINK
# same as 1.5.31
function login_link() {
$login = '<a href="'.db('website');
$login .= $_SESSION[db('website').'Logged_In'] == token() ? 'administration/" title="'.l('administration').'">'.l('administration') : 'login/" title="'.l('login').'">'.l('login').'';
$login .= '</a>';
echo $login;
}

Add a single line:

Code: [Select]
// LOGIN LOGOUT LINK
# same as 1.5.31
function login_link() {
$login = '<a href="'.db('website');
$login .= $_SESSION[db('website').'Logged_In'] == token() ? 'administration/" title="'.l('administration').'">'.l('administration') : 'login/" title="'.l('login').'">'.l('login').'';
$login .= '</a>';
//add the line below
$login .= $_SESSION[db('website').'Logged_In'] == token() ? '&nbsp;&middot;&nbsp;<a href="'.db('website').'logout/" title="'.l('logout').'">'.l('logout').'</a>' : '';
echo $login;
}

Enjoy!
Logged