3
SorenBeck - if you want this in a XOOPS block you can create a new custom block like this:
Content Type: PHP
Cache lifetime: No Cache
Content:
global $xoopsUser;
if ($xoopsUser) {
//User is logged in, display welcome message
$uname = $xoopsUser->getVar('uname');
echo("Welcome, $uname");
} else {
return false;
}
If you want to display this information within your theme, XOOPS prefills a couple of handy smarty variables for you:
Quote:
{$xoops_isuser} - Page requested by a XOOPS user?
{$xoops_uname} - User name of current XOOPS user (empty if not XOOPS user)
So to add a section to your theme welcoming the current user:
<{if $xoops_isuser}>Welcome, <{$xoops_uname}><{/if}>
should do the trick.
There are more helpful smarty variables available to you. To see a full list, turn on smarty debugging in System -> Preferences -> General Settings and then view your XOOPS home page in a browser. A pop-up window will be displayed that displays all current smarty variables and their values.