Using theme_username() with no link to user page?
theme_username() will only output the username as a link if the link_path variable has been set. This is done by default in template_preprocess_username(), and will happen as long as the user viewing the username has access to view the profile.

If you want to change that behaviour you just need to add your own preprocess function which removes the link_path variable:

function MYTHEME_preprocess_username(&amp;$vars) {
  if (isset($vars['link_path'])) {
    unset($vars['link_path']);
  }
}


Bear in mind that the above will remove the link system wide. If you want to remove just for this specific instance, I think the best way would be to pass a custom variable to the theme function and check for it in your preprocess function:

$vars = array('account' = user_load($record-&gt;uid), 'surpress_link' =&gt; TRUE);
$name = theme('username', $vars);

function MYTHEME_preprocess_username(&amp;$vars) {
  if (isset($vars['link_path']) &amp;&amp; isset($vars['surpress_link']) &amp;&amp; $vars['surpress_link']) {
    unset($vars['link_path']);
  }
}