7
Quote:
LazyBadger wrote:
Quote:
rider wrote:
Can someone tell me the code for displaying the Real Name of a user in a template?
Well, not pure code, but nice trick - another gift from Japan
If you'll add SIUN's (author of Simplified URL hack) Smarty-plugin, you will be able, using this plugin-modifier, get any user's profile info directly in template without additional PHP-code - you had to have only userid. Grab it here and use in form {$xoops_userid|suin_user:"name"} (for name, there are parameters for all other profile data)
Since I don't speak Japanese, I cannot give feedback directly, but will write it here.
Nice little modifier. I will suggest one small change, though, to keep the database queries to a minimum:
global $xoopsUser;
if (!$xoopsUser) {
$member_handler =& xoops_gethandler('member');
$user =& $member_handler->getUser($userid);
}
else {
$user =& $xoopsUser;
}
if (is_object($user)) {
return $user->getVar($output);
}
instead of lines 110-117
That way there will not be a new lookup for each user variable if it is the currently logged in user - and the textsanitizer usage is not necessary here, as it is done in the call to getVar().
Thanks for pointing us to this nifty thing, Badger.