1
wizanda
How do you add PM notification in the theme?
  • 2006/11/18 15:09

  • wizanda

  • Home away from home

  • Posts: 1588

  • Since: 2004/3/21


How do you add Pm notification in the theme? Can we use smarty?
As in the user menu, yet with out needing a block...

Our site is using 2.2 now....?

2
Lance_
Re: How do you add PM notification in the theme?
  • 2006/11/18 15:55

  • Lance_

  • Home away from home

  • Posts: 983

  • Since: 2004/1/12


This from the Geometric Red Theme by xoopsdesign.com
<{if $msgcount 0}>
<
class="highlight" href="<{$xoops_url}>/viewpmsg.php">Inbox (<span style="color:#ff0000; font-weight: bold;">
<{
$msgcount}></span>)</a>
<{else}> 
<
a href="<{$xoops_url}>/viewpmsg.php">Inbox</a>
<{/if}>
GDL-Web.com :: Website development.
Xoopslance.com::Freelancing and Projects
thelionsden-arena.net:: Clan/League/Ladder Hosting

3
stefan88
Re: How do you add PM notification in the theme?
  • 2006/11/18 16:41

  • stefan88

  • Community Support Member

  • Posts: 1085

  • Since: 2004/9/20


..

4
wizanda
Re: How do you add PM notification in the theme?
  • 2006/11/18 16:50

  • wizanda

  • Home away from home

  • Posts: 1588

  • Since: 2004/3/21


<{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}>
<
class="highlight" href="<{$xoops_url}>/viewpmsg.php">Inbox (<span style="color:#ff0000; font-weight: bold;"><{$msgcount}></span>)</a>
<{else}>
<
a href="<{$xoops_url}>/viewpmsg.php">Inbox</a>
<{/if}>


Thanxz that works!

5
ralf57
Re: How do you add PM notification in the theme?
  • 2006/11/18 17:15

  • ralf57

  • Quite a regular

  • Posts: 231

  • Since: 2003/2/3 1


<{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}>
<
class="highlight" href="<{$xoops_url}>/viewpmsg.php">Inbox (<span style="color:#ff0000; font-weight: bold;"><{$msgcount}></span>)</a>
<{else}>
<
a href="<{$xoops_url}>/viewpmsg.php">Inbox</a>
<{/if}>


The more i use smarty, the more i get convinced that a template engine is really un-useful.
Just my opinion, of course.
Don't know what i want but i know how to get it..........

6
wizanda
Re: How do you add PM notification in the theme?
  • 2006/11/18 17:22

  • wizanda

  • Home away from home

  • Posts: 1588

  • Since: 2004/3/21


Disagree, what it is, is not smarty...
It is lack of organization amongst our self’s to take hold of the reigns and make XOOPS what it should be...reason for saying this is what smarty can do is take any php variable we set it.
To add a php code in a theme is not my cup of tea; when I have smarty doing the same Job...

There should be someway to add that directly as a new variable to smarty, through Xoops...if we got that sorted XOOPS would be invincible as a CMS, as smarty and XOOPS would be limitless in possibilities...

yet until we get organized don't see much happening...unless of course others notice the post and want to work on giving us all a smarty manager module?

7
ralf57
Re: How do you add PM notification in the theme?
  • 2006/11/18 21:50

  • ralf57

  • Quite a regular

  • Posts: 231

  • Since: 2003/2/3 1


Quote:
Disagree, what it is, is not smarty...


In fact i didn't refer to Smarty but a template engine is not really needed at all once you have your application designed to comply with the MVC pattern.
A template engine is only an additional layer wich may slow down your application.
Don't know what i want but i know how to get it..........

Login

Who's Online

61 user(s) are online (35 user(s) are browsing Support Forums)


Members: 0


Guests: 61


more...

Donat-O-Meter

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

Latest GitHub Commits