Simple Machines Community Forum

General Community => Scripting Help => Aiheen aloitti: Craw - huhtikuu 07, 2008, 05:31:46 IP

Otsikko: Relocating the NEW marker
Kirjoitti: Craw - huhtikuu 07, 2008, 05:31:46 IP
Hi all,

I want to relocate the NEW image marker when there are new unread posts since your last visit:

I want to put it BEFORE the topic title and NOT AFTER.

Please help. How do I do this? Thanks :)
Otsikko: Re: Relocating the NEW marker
Kirjoitti: Eliana Tamerin - huhtikuu 13, 2008, 03:37:11 IP
Open your default MessageIndex.template.php (you'll have to edit this on any theme that has it's own MessageIndex.template.php as well).

Find:
echo '
', $topic['is_sticky'] ? '<b>' : '' , '<span id="msg_' . $topic['first_post']['id'] . '">', $topic['first_post']['link'], '</span>', $topic['is_sticky'] ? '</b>' : '';

// Is this topic new? (assuming they are logged in!)
if ($topic['new'] && $context['user']['is_logged'])
echo '
<a href="', $topic['new_href'], '" id="newicon' . $topic['first_post']['id'] . '"><img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="', $txt[302], '" /></a>';


Replace with:
// Is this topic new? (assuming they are logged in!)
if ($topic['new'] && $context['user']['is_logged'])
echo '
<a href="', $topic['new_href'], '" id="newicon' . $topic['first_post']['id'] . '"><img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="', $txt[302], '" /></a>';

echo '
', $topic['is_sticky'] ? '<b>' : '' , '<span id="msg_' . $topic['first_post']['id'] . '">', $topic['first_post']['link'], '</span>', $topic['is_sticky'] ? '</b>' : '';


Tested and working.
Otsikko: Re: Relocating the NEW marker
Kirjoitti: Craw - huhtikuu 13, 2008, 04:10:12 IP
Thanks Eliana. I'll try it tomorrow. I gotta go sleep now and just checked :D
Otsikko: Re: Relocating the NEW marker
Kirjoitti: Craw - huhtikuu 14, 2008, 11:51:21 AP
OK, I was able to test it. And it works like how I wanted it to.

Thanks a bunch, Eliana! :)
Otsikko: Re: Relocating the NEW marker
Kirjoitti: Eliana Tamerin - huhtikuu 14, 2008, 11:59:38 AP
Not a problem.
Otsikko: Re: Relocating the NEW marker
Kirjoitti: rumfa - huhtikuu 15, 2008, 03:03:45 AP
I was just seraching for it. Thanks. It looks much orderly now.