1
Hi Folks,
I'm replacing my usermenu with one of my tinycontent menus. I'm using this code for inboxes, and am wondering if I can display the notification link only if there are new notifications as well.
<{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}>
**** Code from menu block ***
<{if $msgcount > 0}>
<a class="menuSub" href="<{$xoops_url}>/viewpmsg.php">Inbox (<span style="color:#ff0000; font-weight: bold;"><{$msgcount}></span>)</a>
<{/if}>
**** End ****
What I would like is a conditional link like this for notifications. Anybody have a snippet laying around for this?
Thanks for your time!
Todd