SmartFAQ is developed by The SmartFactory (https://www.smartfactory.ca), a division of InBox Solutions (https://www.inboxsolutions.net)

How can I make a block to show my PMs ?
make a php custom block with the following code;
global $xoopsUser;
if( 
$xoopsUser )
{
  
$pm_handler =& xoops_gethandler('privmessage');
  
$criteria = new CriteriaCompo(new Criteria('read_msg'0));
  
$criteria->add(new Criteria('to_userid'$xoopsUser->getVar('uid')));
  
$pm $pm_handler->getCount($criteria);
}

if( 
$pm )
{
  echo 
"/viewpmsg.php" title="Read your new Private Messages">Private Messages ($pm)n";
}
else
{
  echo 
"No new Private Messagesn";
}


The comments are owned by the author. We aren't responsible for their content.
Author
Thread
user

 Re: Inbox messages display in 2RC2


Upgraded to 2RC2 and lost my inbox new messages display. In system_block_user.html, I re-added this code so that "inbox" would show in the user menu:

Quote:



And the 2.0.10 system_blocks.php, used to use:

Quote:
function b_system_user_show()

{

global $xoopsUser;

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')));

$block['new_messages'] = $pm_handler->getCount($criteria);

$block['lang_inbox'] = _MB_SYSTEM_INBOX;

$block['lang_adminmenu'] = _MB_SYSTEM_ADMENU;

return $block;

}

return false;


but now this doesn't work and results in fatal call to non-object.

Has anyone modified this yet?

Thanks.

 
Top Parent


Login

Who's Online

196 user(s) are online (1 user(s) are browsing XOOPS FAQ)


Members: 0


Guests: 196


more...

Donat-O-Meter

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

Did you know ?

There are many support sites in different languages across the world?

Random question

My login block is missing on default page. How do I login?