26
ladon:Thank you for the information...
Quote:
ladon wrote:
...The FAQ shows you how to put it in a block. But if you don't want to use a block, look at the comments and see:
Quote:
<{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}>
I've set the above in between <{if $xoops_isuser}> <{/if}> otherwise I got a blank page when visiting my site anonymously.
I don't want to use a block because it will interfere with the center block on my home page. This is exactly what I'm looking for, but where should I put this code, and in which file? Does it go in the index.php?
Edit: Just realized that I'm not sure how to add this to my particular theme.html because my main and user menus are different (using html) than typical XOOPS sites. Below is the code from my theme.html for the Inbox:
<a href= "<{$xoops_url}>/viewpmsg.php" onMouseOver= "if (document.images) document.icon_mini_message.src=
'<{$xoops_url}>/themes/phpbbstyle/images/icon_mini_message2.gif';" onMouseOut= "if (document.images)
document.icon_mini_message.src= '<{$xoops_url}>/themes/phpbbstyle/images/icon_mini_message.gif';">
<img src= "<{$xoops_url}>/themes/phpbbstyle/images/icon_mini_message.gif" width=12 height=13
alt="Inbox" name="icon_mini_message" border=0> Inboxa>
Is this correct? <{if $msgcount > 0}>
<a class="highlight" href="<{$xoops_url}>/viewpmsg.php">Inbox
(<span style="color:#ff0000; font-weight: bold;"><{$msgcount}>span>)a><{else}>
<a href= "<{$xoops_url}>/viewpmsg.php" onMouseOver= "if (document.images) document.icon_mini_message.src=
'<{$xoops_url}>/themes/phpbbstyle/images/icon_mini_message2.gif';" onMouseOut= "if (document.images)
document.icon_mini_message.src= '<{$xoops_url}>/themes/phpbbstyle/images/icon_mini_message.gif';">
<img src= "<{$xoops_url}>/themes/phpbbstyle/images/icon_mini_message.gif" width=12 height=13
alt="Inbox" name="icon_mini_message" border=0> Inboxa> <{/if}>