11
Jace303
Re: How can i put INBOX in other bloc that User Menu ???
  • 2003/12/9 14:08

  • Jace303

  • Just popping in

  • Posts: 38

  • Since: 2003/11/5


$block.lang_inbox & $block.new_messages are not available in themes.html.

This snippet works:

<{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}>
Inbox (<{$msgcount}>)
<{else}>
Inbox
<{/if}>


Cheers,
Jens

12
Dr3vil
Re: How can i put INBOX in other bloc that User Menu ???
  • 2003/12/9 14:16

  • Dr3vil

  • Friend of XOOPS

  • Posts: 57

  • Since: 2003/5/10


Thanks - It worked like a charm!

Here is a frosty Molson product to enjoy for everyones assistance! Cheers!

Dr3vil

13
CBlue
Re: How can i put INBOX in other bloc that User Menu ???

Good for you, Dr3vil! Jens came through for you!

14
Jace303
Re: How can i put INBOX in other bloc that User Menu ???
  • 2003/12/9 19:10

  • Jace303

  • Just popping in

  • Posts: 38

  • Since: 2003/11/5


You were lucky, I had exactly the same problem this weekend. Thanx for the beer, anyways. Hehe.

15
Buzzy
Re: How can i put INBOX in other bloc that User Menu ???
  • 2003/12/10 9:05

  • Buzzy

  • Just popping in

  • Posts: 6

  • Since: 2003/9/30


Thanks !!! All is perfect !

16
technews
Re: How can i put INBOX in other bloc that User Menu ???
  • 2006/1/31 1:43

  • technews

  • Just popping in

  • Posts: 36

  • Since: 2005/3/30


Jace303 you are a STAR!


17
shank
Re: How can i put INBOX in other bloc that User Menu ???
  • 2006/1/31 3:08

  • shank

  • Not too shy to talk

  • Posts: 144

  • Since: 2004/8/17


Or, if you don't want to mix php and html codes in your theme (That is bad style ya know) you could do this:

Save this code as insert.pms.php in the class/smarty/plugins/ folder

function smarty_insert_pms()
{
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);
}
?>


and in your theme place this code wherever you want thealert to show
<{if $xoops_isuser}><{insert name="pms"}>
<
a href="<{$xoops_url}>/viewpmsg.php">
<{if 
$msgcount 0}>
<{if 
$msgcount 1}>You Have <{$msgcount}> New Messages
<{else}>You have <{$msgcount}> New Message
<{/if}>
<{else}>Private 
Messages
<{/if}>a><{/if}>



And if you want a pop up on new messages check This Thread. The zip file contains the smarty file.
s l s h a n k l e @ b e l l s o u t h . n e t

18
technews
Re: How can i put INBOX in other bloc that User Menu ???
  • 2006/1/31 12:04

  • technews

  • Just popping in

  • Posts: 36

  • Since: 2005/3/30


well that's even better shank!

ta

19
madboynz
Re: How can i put INBOX in other bloc that User Menu ???
  • 2006/2/3 2:24

  • madboynz

  • Just popping in

  • Posts: 5

  • Since: 2006/1/19


I'm still uncertain what to do with this one? I currently have a links bar up the top and I'd really like the mail link to show something like ' Mail (2)' or something similar. If I create a new custom block (or edit the current link bar) and paste the code in, under html, it just shows code, if I make the custom block php then it displays nothing at all. Do I have to create php file? If so, how do I pull it into my custom block?

ta

Login

Who's Online

472 user(s) are online (356 user(s) are browsing Support Forums)


Members: 0


Guests: 472


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