Uutiset:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu
Advertisement:

Index.template.php help

Aloittaja ViewFromTheBoundary, maaliskuu 16, 2014, 04:54:48 IP

« edellinen - seuraava »

ViewFromTheBoundary

Hi,

I am trying to code the message part of this



How can I achieve this? It also turns red when you receive a message, how can I do this as well?

Thanks in advance :)

TheKnown

would need to know what you have at the moment.

ViewFromTheBoundary

At the moment I have

// Only tell them about their messages if they can read their messages!
if ($context['allow_pm'])
echo $txt['msg_alert_you_have'], ' <a href="', $scripturl, '?action=pm">', $context['user']['messages'], ' ', $context['user']['messages'] != 1 ? $txt['msg_alert_messages'] : $txt['message_lowercase'], '</a>', $txt['newmessages4'], ' ', $context['user']['unread_messages'], ' ', $context['user']['unread_messages'] == 1 ? $txt['newmessages0'] : $txt['newmessages1'] , '.<br />';


Which looks like this


TheKnown

try changing it to:

// Only tell them about their messages if they can read their messages!
if ($context['allow_pm'])
{
echo'
', $context['user']['unread_messages'], ' <a href="', $scripturl, '?action=pm"> ', $context['user']['unread_messages'] == 1 ? $txt['newmessages0'] : $txt['newmessages1'] , '</a>.<br />';
}

ViewFromTheBoundary

Thats just changed it to "0 are new."

TheKnown

try
// Only tell them about their messages if they can read their messages!
if ($context['allow_pm'])
{
echo'
', $context['user']['unread_messages'], ' <a href="', $scripturl, '?action=pm"> ', $context['user']['unread_messages'] == 1 ? $txt['newmessages0'] : $txt['newmessages1'] , '</a> ', $txt['message_lowercase'], '.<br />';
}


you will also need to change some wording in if memory is correct index.english.php

ViewFromTheBoundary

Current I've got 0 new messages, but when i get a PM it says 1 new messages how can I get it to show 1 new message but then 2 new messages?

Advertisement: