1
thygar
Issue with php code and x-phpbb
  • 2005/3/30 22:40

  • thygar

  • Just popping in

  • Posts: 9

  • Since: 2005/3/8 1


Somehow this code is breaking X-PHPBB and I am not sure how to fix it. I took this code from some other posts in order to have an Inbox alerter in a different menu block. I personally chose the Main menu block as simply I didnt want to have multiple blocks showing when I could just have one and have the many sections available, this is a personal choice.

In any case, the code works great and shows when there are new messages or not just like the Usermenu Inbox does. The problem lies in when I have X-PHPBB installed (1.23b) and go to either Post a new message, Mark Forums Read, Post a poll, etc etc, basically anything that causes it to reload the website when it completes something.

I have nailed it down to the line in bold as causing a problem, as when I take that line out everything on the forums side works properly. The problem in removing that line is that the Inbox link no longer shows if there are new messages or not it just shows Inbox.

Any help on the resolution would be greatly appreciated !!!

<{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">Inbox(<span style="color:#ff0000; font-weight: bold;"><{$msgcount}></span>)</a>
<{else}>
<a href="<{$xoops_url}>/viewpmsg.php">Inbox</a>
<{/if}>

Login

Who's Online

112 user(s) are online (74 user(s) are browsing Support Forums)


Members: 0


Guests: 112


more...

Donat-O-Meter

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

Latest GitHub Commits