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

hunmonk’s picture

Status: Active » Closed (works as designed)
  1. theme('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 overrides
  2. the logged in user is the only one who will ever see that block (for their own username), and they also have the 'my account' link to access their user page. i've tried the username as a link, and i personally find the display ugly compared to the current setup.
  3. hacking the module's theme function directly is the improper way to do this. instead, override the theme function in your site theme

kudos for your first coding attempt. the above isn't meant to discourage your efforts, but instead to help continue your learning process.