17
Or, if you don't want to mix php and html codes in your theme (That is bad style ya know) you could do this:
Save this code as insert.pms.php in the class/smarty/plugins/ folder
function smarty_insert_pms()
{
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);
}
?>
and in your theme place this code wherever you want thealert to show
<{if $xoops_isuser}><{insert name="pms"}>
<a href="<{$xoops_url}>/viewpmsg.php">
<{if $msgcount > 0}>
<{if $msgcount > 1}>You Have <{$msgcount}> New Messages
<{else}>You have <{$msgcount}> New Message
<{/if}>
<{else}>Private Messages
<{/if}>a><{/if}>
And if you want a pop up on new messages check
This Thread. The zip file contains the smarty file.
s l s h a n k l e @ b e l l s o u t h . n e t