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 
"<a href="/viewpmsg.php" title="Read your new Private Messages">Private Messages ($pm)</a>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:

<table cellspacing="0">

<tr>

<td id="usermenu">

<a class="menuTop" href="<{$xoops_url}>/user.php"><{$block.lang_youraccount}></a>

<a href="<{$xoops_url}>/edituser.php"><{$block.lang_editaccount}></a>

<a href="<{$xoops_url}>/notifications.php"><{$block.lang_notifications}></a>

<a href="<{$xoops_url}>/user.php?op=logout"><{$block.lang_logout}></a>

<{if $block.new_messages > 0}>

<a class="highlight" href="<{$xoops_url}>/viewpmsg.php"><{$block.lang_inbox}> (<span style="color:#ff0000; font-weight: bold;"><{$block.new_messages}></span>)</a>

<{else}>

<a href="<{$xoops_url}>/viewpmsg.php"><{$block.lang_inbox}></a>

<{/if}>

<{if $xoops_isadmin}>

<a href="<{$xoops_url}>/admin.php"><{$block.lang_adminmenu}></a>

<{/if}>

</td>

</tr>

</table>


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

176 user(s) are online (2 user(s) are browsing XOOPS FAQ)


Members: 0


Guests: 176


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!

Did you know ?

Style sheets can be interpreted easily here ...

Random question

How do I upload, install and use a new default theme?