3
<{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}>
![You have <{$msgcount}> new PMs](<{$xoops_imageurl}>/email.gif)
<{else}>
![You have no new PMs](<{$xoops_imageurl}>/noemail.gif)
<{/if}>