1
toddarc
Can I query for notifications as well?
  • 2004/8/22 6:50

  • toddarc

  • Just popping in

  • Posts: 11

  • Since: 2004/8/8 6


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

2
Mithrandir
Re: Can I query for notifications as well?

I think you are missing the point of the notifications link in the user menu. Notifications are given as PM's or emails. The Notifications link is for configuring/removing notifications from one single place...

3
toddarc
Re: Can I query for notifications as well?
  • 2004/8/22 7:14

  • toddarc

  • Just popping in

  • Posts: 11

  • Since: 2004/8/8 6


Thanks for setting me straight on that:)

Since I'm showing my unknowledgable side anyway...

I guess I don't quite see how the average registered user uses this feature - which I guess is why I was wanting to hide it unless they actually had a new notification. Is it a critical link to keep available to them?

Thank you much for your time!

Todd

************ OOOHHHHHH... ********

Guess is in the eye of the beholder - I can see its function on this site. It would be of more use to admin users, but could reduce angry admin emails when users get carried away with notification check boxes:)

Login

Who's Online

202 user(s) are online (129 user(s) are browsing Support Forums)


Members: 0


Guests: 202


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Jun 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits