Posted by ashiwebi on September 10, 2008 at 6:10pm
I am using fourseason theme and add code for showing username and logout option at top of the page.
The problem is that after logout the option of logout still show on the frontpage of drupal.
The is as follows:-
<?php
global $user;
?>Logged in as:
<?php
print l(ucwords($user->name),'user/'.$user->uid);
?><?php
if ($user->uid)
{
print l("logout","logout");
}
?>The script I added is on the page.tpl.php
Comments
you can add a secondary link
you can add a secondary link for logout and it disappears when you logout. The path is just logout. I just dont know how to display the username, but that doesn't bother me too much.
allthesmalls.com
uid is always true
you should try to write this :
<?phpif ($user->uid != 0)
{
print l("logout","logout");
}
?>
David
http://www.smol.org