1
Hi i am using ipbm,
I would like to include the "Inbox (3)" in my theme.html
I found this
tutorialUnfortunately I think the core files are modified by ipbm, so I need to know how to edit this for the new core files:
Top of theme.html:
<{if $xoops_isuser}>
<{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}>
In theme.html:
<{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">Inboxa>
<{/if}>
How do I change the above code to fit the core files that ipbm includes?
heres what ipbm user menu looks like: (to get an idea of the new messages)
function b_system_user_show()
{
global $xoopsUser;
global $isbb, $xoopsDB;
if (is_object($xoopsUser)) {
$pm_handler =& xoops_gethandler('privmessage');
$block = array();
$block['lang_youraccount'] = _MB_SYSTEM_VACNT;
$block['lang_editaccount'] = _MB_SYSTEM_EACNT;
$block['lang_notifications'] = _MB_SYSTEM_NOTIF;
$block['uid'] = $xoopsUser->getVar('uid');
$block['lang_logout'] = _MB_SYSTEM_LOUT;
$criteria = new CriteriaCompo(new Criteria('read_msg', 0));
$criteria->add(new Criteria('to_userid', $xoopsUser->getVar('uid')));
//<<<--------------------------------------------
//-+- IPB messages new -- Koudadnshi
//<<<--------------------------------------------
if ($isbb)
{
list($new_messages) = $xoopsDB->fetchRow($xoopsDB->query("SELECT COUNT(*) FROM ".$xoopsDB->prefix("ipb_messages")." WHERE recipient_id = '".$xoopsUser->getVar("uid")."' AND vid='in' AND read_state='0' "));
$block['new_messages'] = $new_messages;
}
else
$block['new_messages'] = $pm_handler->getCount($criteria);
//>>>--------------------------------------------
$block['lang_inbox'] = _MB_SYSTEM_INBOX;
$block['lang_adminmenu'] = _MB_SYSTEM_ADMENU;
return $block;
}
return false;
}
I tried on their site, but nobody helps there. Im still learning php... im sure this will take one of you 5 or 10 mins, please some support!?