3
Here is another one. I scooped most of the code from a similar thread yesterday. I turned on the smarty debug to catch variable names I needed. It will print a Logout link if logged in otherwise place a Register link.
It checks their Inbox and will show a new message count in red if any otherwise just a link to the Inbox.
I put this in my theme.html file, actually it is a text file and I do an <{include ... }> so I can use it in other themes.
<{if $xoops_isuser}>
Bye · User:
<{$xoops_uname}> ·
<{php}>
/* ******* User Details if Logged In ******* */
GLOBAL $xoopsUser;
$pm_handler =& xoops_gethandler('privmessage');
$uid = $xoopsUser->getVar('uid');
$criteria = new CriteriaCompo(new Criteria('read_msg', 0));
$criteria->add(new Criteria('to_userid', $uid));
$msgcount = $pm_handler->getCount($criteria);
$GLOBALS['xoopsTpl']->assign('msgcount', $msgcount);
<{/php}>
<{if $msgcount > 0}>
Inbox (<{$msgcount}>)<{else}>
Inbox<{/if}>
<{else}>
Register<{/if}>