13
I'm using this in my theme file:
<{if $xoops_isuser}>
<{php}>
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}>
<a href="<{$xoops_url}>/viewpmsg.php"><img src="<{$xoops_imageurl}>images/prvmsg_on.jpg" alt=You have <{$msgcount}> new message border="0" />a>
<{else}>
<a href="<{$xoops_url}>/viewpmsg.php"><img src="<{$xoops_imageurl}>images/prvmsg_off.jpg" alt="You have no new messages" border="0" />a>
<{/if}>
Big thanks to all, that helped me with that...
hope it helps to you too