11
brash
Re: Display number of new pm
  • 2005/2/22 5:10

  • brash

  • Friend of XOOPS

  • Posts: 2206

  • Since: 2003/4/10


Thought I was on the right track with something like;
<{php}>
echo(
$GLOBALS['xoopsUser']->b_system_user_show);
<{/
php}>


But it returns nothing, so might be barking up the wrong tree .

12
jdseymour
Re: Display number of new pm

Check your protector, I tried something similar today and it blocked it.

13
stefan88
Re: Display number of new pm
  • 2005/2/22 6:06

  • stefan88

  • Community Support Member

  • Posts: 1086

  • Since: 2004/9/20


I'm using this in my theme file:
<{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 
$msgcount 0}>
&
nbsp;<a href="<{$xoops_url}>/viewpmsg.php"><img src="<{$xoops_imageurl}>images/prvmsg_on.jpg" alt=You&nbsp;have&nbsp;<{$msgcount}>&nbsp;new&nbsp;message border="0" />a>
<{else}>
&
nbsp;<a href="<{$xoops_url}>/viewpmsg.php"><img src="<{$xoops_imageurl}>images/prvmsg_off.jpg" alt="You have no new messages" border="0" />a>
<{/if}>

Big thanks to all, that helped me with that...
hope it helps to you too

14
brash
Re: Display number of new pm
  • 2005/2/22 6:16

  • brash

  • Friend of XOOPS

  • Posts: 2206

  • Since: 2003/4/10


Yep, works a treat . I'll try and find some time tonight to tidy this up and put the PHP in an smarty insert plugin so you don't have PHP in your theme.html file. No functional difference, I just like to keep my logic seperated .

15
Watdehek
Re: Display number of new pm
  • 2005/2/23 10:34

  • Watdehek

  • Friend of XOOPS

  • Posts: 130

  • Since: 2005/2/21


When I use your code in my theme.html I get a blank page. Maybe because I'm running Protector? There is nothing in my Protector log BTW.

16
Watdehek
Re: Display number of new pm
  • 2005/4/25 21:46

  • Watdehek

  • Friend of XOOPS

  • Posts: 130

  • Since: 2005/2/21


Is there anybody that can help me with this?

Login

Who's Online

280 user(s) are online (173 user(s) are browsing Support Forums)


Members: 0


Guests: 280


more...

Donat-O-Meter

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

Latest GitHub Commits