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

 making a new block


would this also work for anything? i have a couple sections that won't work well in news or sections and would like to have a couple more blocks/modules(?) to set up ... i'm a noob when it comes to this ... just do html *sighs* .. thanks!

 
Replies
Author
Published
Author
Thread
user

 using inbox waring global


In addition to this nice feature, the following is something I came across on the forum:

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}>


This will allow you to use the following anywhere in your theme:

Quote:

<{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">Inbox</a>
<{/if}>


This way you’ll see just ‘Inbox’ when there are no messages and ‘Inbox (3)’ when you have, for example, 3 messages.

 
Replies
Author
Published
07/15/2005 13:39
11/21/2005 15:33
Author
Thread
user

 need help with private messages core...!!!


hi...the code shown here results very interesting for me...

i'm trying to send private messages from a XML workflow specification for the XOOPS workflow module (xflow), but i don't know how to write the code to do this....i'm a quite new with the XOOPS core...is there some guidelines you can provide me?

this messages represent the notifications in a request tracking system i want to implement using the workflow module

Thanks ...Mario Castro

 


Login

Who's Online

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


Members: 0


Guests: 160


more...

Donat-O-Meter

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

Did you know ?

some modules are constantly being developed and updated while others need a new manager.

Random question

Can I see a demo first?