0
votes

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?

1
What is the $name variable? Is it the full name that you are trying to output?Kevin Reilly

1 Answers

0
votes

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']);