Get XOOPS XOOPSXOOPS FAQFAQ ForumsForums NewsNews ThemesThemes ModulesModules
New Posts New Topics All Posts All Forums Index General Modules Themes Development International XOOPS.org

Search

Donat-O-Meter

Make donations with PayPal!
Stats
Goal: $100.00
Due Date: Jun 30
Gross Amount: $25.00
Net Balance: $23.57
Left to go: $76.43

Donations
Anonymous ($15)Jun-14
Anonymous ($10)Jun-10

Learn XOOPS Core

Local Support

Advertisement

XOOPS Code hosted on SourceForge

Cumulus Tag Cloud

2 2.5 2.6 3.0 87 2013 Abuse admin Amazon AntiHarvesting AntiMalUser AntiSpam API bags Beats billige black Blocks blue Bootstrap Captcha cell Christmas chronolabs content Conversion demo docek download Dresses editor evden eve facebook floor free herre Honeypot Human IP IPInfoDB jQuery kantor lamps Language log logger Lucire mobile module modules Monster mulberry MyAlbum-p newbb news online PageRank pandora Password Permissions pink Plugin portal preloader Prevention profile project propose Protector publisher Rights rmcommon Room sale security Server site Smarty SOAP Songlist Spam stem Studio tag tags tdmcreate template Theme themes TinyMCE User userlog website Whitepaper Wishcraft XIPS xoops Xortify ZendFramework

New Users

Registering user

# 136106

g_capobianco

Welcome to XOOPS!




Bottom   Previous Topic   Next Topic  Register To Post

« 1 (2) 3 »


#11 Posted on: 2005/12/12 8:47 Re: New messages in theme as smarty; how to?
The code in the theme should be wrapped with
<{if $xoops_isuser}>....code goes here....<{/if}>


edited to fix space in code.

Top


s l s h a n k l e @ b e l l s o u t h . n e t
shank
Not too shy to talk
Not too shy to talk
Joined:
2004/8/17 12:27
Group:
Registered Users
Posts: 144
(Show More) (Show Less)


#12 Posted on: 2005/12/12 11:16 Re: New messages in theme as smarty; how to?
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}>

Top


Not right now; I am busy screwing up my site!


Dream Catcher Dezines
Mind Health ...
tjnemez
Home away from home
Home away from home
Joined:
2003/9/21 12:05
From Manitoba
Group:
Registered Users
Posts: 1539
(Show More) (Show Less)


#13 Posted on: 2005/12/12 12:17 Re: New messages in theme as smarty; how to?
can you activate 'debug php mode'

Top

blueteen
Quite a regular
Quite a regular
Joined:
2004/7/16 3:36
From France
Group:
Registered Users
Posts: 378
(Show More) (Show Less)


#14 Posted on: 2005/12/12 17:13 Re: New messages in theme as smarty; how to?
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.

Top

supermario
Just popping in
Just popping in
Joined:
2005/10/15 17:47
Group:
Registered Users
Posts: 6
(Show More) (Show Less)


#15 Posted on: 2005/12/12 20:12 Re: New messages in theme as smarty; how to?
Perhaps this is an other solution for you?:

PMBLOCK by tuff (brandycoke)



Top


in valid code we trust
menochi
Friend of XOOPS
Friend of XOOPS
Joined:
2003/12/27 19:53
From Colina - Chile
Group:
Registered Users
Posts: 234
(Show More) (Show Less)


#16 Posted on: 2005/12/12 20:43 Re: New messages in theme as smarty; how to?
Quote:

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}>


only thing I see wrong with this is there should be a space between <{if and $xoops_isuser}>

<{if $xoops_isuser}> is how it should look.

Did you create the insert.php file?

Top


s l s h a n k l e @ b e l l s o u t h . n e t
shank
Not too shy to talk
Not too shy to talk
Joined:
2004/8/17 12:27
Group:
Registered Users
Posts: 144
(Show More) (Show Less)


#17 Posted on: 2005/12/12 20:48 Re: New messages in theme as smarty; how to?
Quote:

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.


Try smarty debug.

Also you may have to set in preferances to update template from theme folder.

Top


s l s h a n k l e @ b e l l s o u t h . n e t
shank
Not too shy to talk
Not too shy to talk
Joined:
2004/8/17 12:27
Group:
Registered Users
Posts: 144
(Show More) (Show Less)


#18 Posted on: 2005/12/12 21:58 Re: New messages in theme as smarty; how to?
This still works.


Create a php file and name it ex_assign.php

ex_assign.php
<?php
// $Id$
// FILE        ::    ex_assign.php
// AUTHOR    ::    Ryuji AMANO <info@joetsu.info>
// WEB        ::    Ryu's Planning <http://ryus.joetsu.info/>
//

global $xoopsUser$xoopsModule;
if (
is_object($xoopsUser)) {
    
$pm_handler =& xoops_gethandler('privmessage');

    
$criteria = new CriteriaCompo(new Criteria('read_msg'0));
    
$criteria->add(new Criteria('to_userid'$xoopsUser->getVar('uid')));
    
$this->assign("ex_new_messages"$pm_handler->getCount($criteria));
}

if ( 
is_object($xoopsModule) ) {
    
$this->assign('ex_moduledir'$xoopsModule->getVar('dirname'));
}

?>


Put ex-assign.php inside the THEME folder.

Now call ex_assign.php into theme by placing the below code right after the body statement in the theme.html.
<{include_php file="$xoops_rootpath/themes/YOUR_THEME_NAME_HERE/ex_assign.php"}>


Now place the below code where you want the message alert to go inside the theme.html
<{if $ex_new_messages 1}>
<
a href="<{$xoops_url}>/viewpmsg.php">Private Messages</a>
<{/if}>
<{if 
$ex_new_messages 0}>
<{if 
$smarty.server.SCRIPT_NAME == "/index.php"}>
<
script language="javascript" type="text/javascript">
<!--
msg="<b>Hello! <{$xoops_uname}></b><br />You have <span style='color:#ff0000; font-weight: bold;'><{$ex_new_messages}></span> new Message(s)";
openwin (msg)
function 
openwin(message) {
open("""message""width=250,height=150,toolbar=no,scrollbars=yes,resizable=yes");
w.focus();
w.document.open();
w.document.write("<html><head></head><meta http-equiv='content-type' content='text/html; charset=<{$xoops_charset}>' /><title>You've Got Messages</title><body><br><br><center>");
w.document.write(message);
w.document.write("<br /><br /><a href="javascript:window.opener.location='<{$xoops_url}>/viewpmsg.php';window.close();">");
w.document.write("View</a>");
w.document.write("</center></body></html>");
w.document.close();
}
// -->
</script>
<{/if}>
<a  href="<{$xoops_url}>/viewpmsg.php">
<span style="color:#ff6600;"><{$ex_new_messages}>-Message(s)
</span></a>
<{/if}>


With this you not only have a Red link saying how many new messages you have, when you return to front page a popup tells you also. If no new messages it just says "Private Message, linking to the inbox.

I am sure someone could clean up and update, but this works in XOOPS 2 XOOPS 2.2 and XOOPS 2.2.3a.

Top

AAINC
Not too shy to talk
Not too shy to talk
Joined:
2003/10/18 2:15
From Florida-Space Coast
Group:
Registered Users
Posts: 101
(Show More) (Show Less)


#19 Posted on: 2005/12/12 22:06 Re: New messages in theme as smarty; how to?
shank,

it was the space, thanks alot for your help.

Top


Not right now; I am busy screwing up my site!


Dream Catcher Dezines
Mind Health ...
tjnemez
Home away from home
Home away from home
Joined:
2003/9/21 12:05
From Manitoba
Group:
Registered Users
Posts: 1539
(Show More) (Show Less)


#20 Posted on: 2005/12/20 10:29 Re: New messages in theme as smarty; how to?
Wonderful hack! ..... but I'm using x-ipb for forum control .... so isn't working for me .... please, help!

Top

NeoFenix
Just popping in
Just popping in
Joined:
2005/7/7 22:32
From Punta Arenas, Patagonia, Chile
Group:
Registered Users
Posts: 31
(Show More) (Show Less)




« 1 (2) 3 »



You can view topic.
You cannot start a new topic.
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You can vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.

[Advanced Search]