1
coops
IPBM and new messages
  • 2005/7/20 6:22

  • coops

  • Just popping in

  • Posts: 82

  • Since: 2005/6/15


Hi i am using ipbm,

I would like to include the "Inbox (3)" in my theme.html
I found this tutorial

Unfortunately 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}>
<
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!?

Login

Who's Online

433 user(s) are online (88 user(s) are browsing Support Forums)


Members: 0


Guests: 433


more...

Donat-O-Meter

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

Latest GitHub Commits