0

I'm trying to print the full name of user instead of the username using theme('username',$name); The full name is displayed but with as a hyperlink (in between <a>..</a>) which links to the user's profile page. I just want theme() to output the full name as plain text. Can anyone help?

AKS
  • 4,618
  • 2
  • 29
  • 48
Rajesh
  • 3,743
  • 1
  • 24
  • 31

1 Answers1

0

Please could you say from where you are trying to print the username.

If you are doing this in the template.php, you can get it say from node_preprocess or page_preprocess using:

print $vars['user']->name;

Or if you are in a .tpl file you can use

<?php print $user->name; ?>

User is a global variable so you can grab all kinds of information from it. If you want to see the available information try putting this in the template.php, say in page_preprocess function / (hook)

print_r ($vars['user']);
Ben
  • 1,565
  • 1
  • 10
  • 11