xoops forums

dadoprom

Not too shy to talk
Posted on: 2005/10/31 13:01
dadoprom
dadoprom (Show more)
Not too shy to talk
Posts: 143
Since: 2004/3/2 1
#1

New messages in theme as smarty; how to?

Hi,
I would like to know if it is possible to show number of new messages directly in a theme trought smarty or just a flashing image which claims you have a new message?

Thanx for your help
Everything is possible......
-------------------------------------------------
http://www.mla.sk

dadoprom

Not too shy to talk
Posted on: 2005/10/31 13:14
dadoprom
dadoprom (Show more)
Not too shy to talk
Posts: 143
Since: 2004/3/2 1
#2

Re: New messages in theme as smarty; how to?

help........
Everything is possible......
-------------------------------------------------
http://www.mla.sk

christian

Just can't stay away
Posted on: 2005/10/31 13:30
christian
christian (Show more)
Just can't stay away
Posts: 401
Since: 2002/2/24
#3

Re: New messages in theme as smarty; how to?

waouw, you are impatient

Here is a answer but it is in french.

Cheers

dadoprom

Not too shy to talk
Posted on: 2005/10/31 13:30
dadoprom
dadoprom (Show more)
Not too shy to talk
Posts: 143
Since: 2004/3/2 1
#4

Re: New messages in theme as smarty; how to?

nevermind
Everything is possible......
-------------------------------------------------
http://www.mla.sk

dadoprom

Not too shy to talk
Posted on: 2005/10/31 14:14
dadoprom
dadoprom (Show more)
Not too shy to talk
Posts: 143
Since: 2004/3/2 1
#5

Re: New messages in theme as smarty; how to?

sorry to bather u, but could u pls. explain it to me a bit, because I don't understand french... and I think it is exactly what I need...

I am using XOOPS 2.0.13.1

thanx
Everything is possible......
-------------------------------------------------
http://www.mla.sk

talunceford

Just can't stay away
Posted on: 2005/10/31 15:40
talunceford
talunceford (Show more)
Just can't stay away
Posts: 532
Since: 2002/8/14
#6

Re: New messages in theme as smarty; how to?

You might try translating it using google languages.....

shank

Not too shy to talk
Posted on: 2005/12/1 2:55
shank
shank (Show more)
Not too shy to talk
Posts: 144
Since: 2004/8/17
#7

Re: New messages in theme as smarty; how to?

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
<{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>
s l s h a n k l e @ b e l l s o u t h . n e t

NeoFenix

Just popping in
Posted on: 2005/12/9 14:55
NeoFenix
NeoFenix (Show more)
Just popping in
Posts: 31
Since: 2005/7/8 3
#8

Re: New messages in theme as smarty; how to?

this is working with 2.2.3?

blueteen

Quite a regular
Posted on: 2005/12/9 15:48
blueteen
blueteen (Show more)
Quite a regular
Posts: 379
Since: 2004/7/16
#9

Re: New messages in theme as smarty; how to?

yes it works.
i'm using this script on a XOOPS 2.2.3a with success :o)

tjnemez

Home away from home
Posted on: 2005/12/11 12:08
tjnemez
tjnemez (Show more)
Home away from home
Posts: 1594
Since: 2003/9/21
#10

Re: New messages in theme as smarty; how to?

the above does not work for me, using 2.2.3 final. any ideas?
Not right now; I am busy screwing up my site!


Dream Catcher Dezines
Mind Health ...