The bad part about this code is that the aleret will show everytime they refresh the page, or go to a new page, including inbox, till the check the mail.
I'll try to figure out a better way to do this.
<body>
<{if $xoops_isuser}><{insert name="pms"}>
<{if $msgcount > 0}>
<body onLoad="java script: alert('Check Your Inbox!')"><{else}><body><{/if}><{else}><body><{/if}>
supermario wrote:
Quote:blueteen wrote:
can you activate 'debug php mode'
I'm having the same problem... it won't appear. I turned on PHP Debug and there were no errors that seemed to refer to this.
tjnemez wrote:
thanks for your help. i tried this but it does not work for me.
<{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}>
<{if $xoops_isuser}>....code goes here....<{/if}>
<{if $xoops_isuser}><{insert name="pms"}>
<{if $msgcount > 0}>
<body onLoad="javascript: alert('Check Your Inbox!')"><{/if}><{else}><body><{/if}><{else}><body><{/if}>
<?
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);
}
?>