| Re: Need Some Help |
| by mboyden on 2008/1/7 21:27:16 The second set of code posted by snow77 should work. The new xoInboxCount is a new Smarty subroutine that will get the count of PMs for you. If you use that code in anything after 2.0.15 then it should work just fine for you. Earlier versions will require PHP code. |
| Re: Need Some Help |
| by stefan88 on 2008/1/7 17:43:44 Quote: Goes into my sites them file, or does it go into the theme of the gadget im making for the toolbar The code I posted (and the code from snow77) should go in theme.html file in theme/YOUR_SITE_THEME folder. I do not understand what you mean by "theme of the gadget im making" ... Is it "template for the module I'm making" (there is diference between theme and template)? |
| Re: Need Some Help |
| by Ft24v2 on 2008/1/7 7:33:47 Okay so this code: le="color: #000000"><?php <{if $xoops_isuser}> <{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}> <a href="<{$xoops_url}>/viewpmsg.php"><img src="<{$xoops_imageurl}>images/prvmsg_on.jpg" alt=You have <{$msgcount}> new message border="0" /></a> <{else}> <a href="<{$xoops_url}>/viewpmsg.php"><img src="<{$xoops_imageurl}>images/prvmsg_off.jpg" alt="You have no new messages" border="0" /></a> <{/if}> <{/if}> or this code: le="color: #000000"><?php <{xoInboxCount assign=pmcount}> <a href="<{xoAppUrl /viewpmsg.php}>"> <{if $pmcount}> <img src="<{xoImgUrl images/inbox-full.png}>" alt="Inbox (<{$pmcount}>)" title="You have <{$pmcount}> unread messages" /> Inbox (<{$pmcount}>) <{else}> <img src="<{xoImgUrl images/inbox.png}>" alt="Inbox" title="Show your inbox content" /> Inbox <{/if}> </a> Goes into my sites them file, or does it go into the theme of the gadget im making for the toolbar ? |
| Re: Need Some Help |
| by snow77 on 2008/1/7 7:11:13 or it can be this instead le="color: #000000"><?php <{xoInboxCount assign=pmcount}> <a href="<{xoAppUrl /viewpmsg.php}>"> <{if $pmcount}> <img src="<{xoImgUrl images/inbox-full.png}>" alt="Inbox (<{$pmcount}>)" title="You have <{$pmcount}> unread messages" /> Inbox (<{$pmcount}>) <{else}> <img src="<{xoImgUrl images/inbox.png}>" alt="Inbox" title="Show your inbox content" /> Inbox <{/if}> </a>
|
| Re: Need Some Help |
| by stefan88 on 2008/1/7 6:31:19 Hi, you will have to put something like this in your theme file: Quote: <{if $xoops_isuser}> this uses diferent image to display if there are new messages or not with alt text "You have X new messages" or "You have no new messages" You may put php part in a smarty plugin and keep logik and presentation separated. |