Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: Si6776 on March 20, 2008, 07:21:34 PM

Title: You have [xx] messages, [x] are new
Post by: Si6776 on March 20, 2008, 07:21:34 PM
Hi Folks,

I have the above PM info enabled on my 1.4 board (Core theme), tried the same code for 2.0, but it won't work.  Can anyone help, please?

Simon.

http://pc-pals.com 
Title: Re: You have [xx] messages, [x] are new
Post by: shadow82x on March 20, 2008, 10:32:22 PM
Can you show us  your index.template.php PM code or the entire file? (be sure to wrap it in code tags)
I custom coded mine and its working fine.

From index.template.php
Code: [Select]
// Go to PM center... [pm]
if ($context['user']['is_logged'] && $context['allow_pm'])
{
echo ((isset($current_action) && $curent_action == 'pm') || $context['browser']['is_ie4']) ? '' : '' , '
<a href="', $scripturl, '?action=pm">Private Messages</a>: ', $context['user']['unread_messages'], ' Unread, ', $context['user']['messages'], ' Total.<br />';
}
Title: Re: You have [xx] messages, [x] are new
Post by: Si6776 on March 21, 2008, 05:46:31 AM
This is how it is on the 1.4 board.  The 2.0 board currently remains unchanged - do you want to see that too?

Code: [Select]
// If the user is logged in, display stuff like their name, new messages, etc.
if ($context['user']['is_logged'])
{
// Only tell them about their messages if they can read their messages!
                if ($context['allow_pm'])
                        echo ' ', $txt[152], ' <a href="', $scripturl, '?action=pm">', $context['user']['messages'], ' ', $context['user']['messages'] != 1 ? $txt[153] : $txt[471], '</a>', $txt['newmessages4'], ' ', $context['user']['unread_messages'], ' ', $context['user']['unread_messages'] == 1 ? $txt['newmessages0'] : $txt['newmessages1'];
                echo '';
echo ' <br /> ';

echo '
<a href="', $scripturl, '?action=unread">', $txt['unread_since_visit'], '</a> <br />
<a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a><br />';

}
// Otherwise they're a guest - send them a lovely greeting...
else
echo $txt['welcome_guest'];
Title: Re: You have [xx] messages, [x] are new
Post by: Si6776 on March 21, 2008, 05:57:02 AM
Actually, yours worked wonderfully, so I'll use that, if that's OK.

Many thanks!  (http://Si6776.www.idnet.com/smileys/thumb.gif)