Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By ashiwebi on
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:-
global $user;
Logged in as:
print l(ucwords($user->name),'user/'.$user->uid);
|
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.
uid is always true
you should try to write this :
David THOMAS
http://www.smol.org