This is just a minor addition for those who would like the username to link to the user account page. In the logintoboggan.module file around line 1150 there is a little code like this:
/**
* Theme the loggedinblock that shows for logged-in users.
*/
function theme_lt_loggedinblock(){
global $user;
return check_plain($user->name) . ' | ' . l(t('Log out'), 'logout');
}
Change this to:
/**
* Theme the loggedinblock that shows for logged-in users.
*/
function theme_lt_loggedinblock(){
global $user;
return l(t(check_plain($user->name)), 'user/' . t(check_plain($user->uid))) . ' | ' . l(t('Log out'), 'logout');
}
The account name will not link nicely.
I am going to give myself a little pat on the back, because this is the first time I have offered up any code for a Drupal module. And though this is no doubt trivial for most of the folks around here, it might help any newbies wondering by.
Erik
Comments
Comment #1
hunmonk commentedtheme('username', $user)is the proper way to output the username as a link, as it takes the current user's permissions into account, and respects theme overrideskudos for your first coding attempt. the above isn't meant to discourage your efforts, but instead to help continue your learning process.