1
shank
coding question
  • 2004/9/1 23:06

  • shank

  • Not too shy to talk

  • Posts: 144

  • Since: 2004/8/17


First let me say that I thought I read something of this sort some where, but searched and couldn't find it again.

Secondly, My website is www.le-mank.com

Where the login is, is conditional between the login, and "Hello (username)!" That part is fine.
Where it say join is conditional between join, and blank.

What I was wanting to do is after you login have private message notifacation here.

The original code in theme.html is:

<td align="left" class="headercenter"> <?php if ($this->_tpl_vars['xoops_isuser']): ?> <?php else: ?>
<form style="margin-top: 2px; margin-bottom: 0px" action="<?php echo $this->_tpl_vars['xoops_url']; ?>
/register.php" method="post">
<input name="submit" type="submit" value=" Join " />
</form>
<?php endif; ?> </td>

The code from the userblock templete file is:

<{if $block.new_messages > 0}>
<a class="highlight" href="<{$xoops_url}>/viewpmsg.php"><{$block.lang_inbox}> (<span style="color:#ff0000; font-weight: bold;"><{$block.new_messages}></span>)</a>
<{else}>
<a href="<{$xoops_url}>/viewpmsg.php"><{$block.lang_inbox}></a>
<{/if}>


Could I just insert this code into the theme.html code between the if and the else for the join.

Help me please.
Thanks,
Steve

2
technews
Re: coding question
  • 2006/1/31 1:24

  • technews

  • Just popping in

  • Posts: 36

  • Since: 2005/3/30


I am looking for that solution as well...

anyone?
Technews - www.technews.gr

Xoopsgreece.gr - www.xoopsgreece.gr

3
shank
Re: coding question
  • 2006/1/31 2:57

  • shank

  • Not too shy to talk

  • Posts: 144

  • Since: 2004/8/17


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

Login

Who's Online

165 user(s) are online (114 user(s) are browsing Support Forums)


Members: 0


Guests: 165


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!

Latest GitHub Commits