Show unread posts since last visit


Urban Scout,

I wonder if there would be a way to add a “Show unread posts since last visit” link to the top of the main page. I find that hopeful on other forums I read.




There already is a somewhat similar feature in the forum. Any category on the main page that has a “+” in the green box on the left has new (to your user) posts in it. And once you go to the category, all the new posts or posts with new replies will have a little image next to them.

Hope this helps.


Anyone else having problems with the tag? I click on it and it always brings me to the first post under that topic.


I think the link just takes you to the top of the thread. I always have to scroll down. If it’s a multi-page thread, I click on the last page and then scroll down. But, yeah, for functionality, it seems pretty lame.


I figured out how to get the button working. It’s a bug in the Faded Green theme. In the file MessageIndex.template.php, line 154 should look like the following. I added line breaks for readability.

' . $topic['first_post']['link'] . ' ' . ($topic['new'] && $context['user']['is_logged'] ? '<a href="' . $scripturl . '?topic=' . $topic['id'] . '.from' . $topic['newtime'] . '#new"><img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/new.gif" alt="' . $txt[302] . '" border="0" /></a>' : '') . ' <span class="smalltext">' . $topic['pages'] . '</span></td>

Change the part of it that says ‘.from’ to ‘.msg’ like so:

' . $topic['first_post']['link'] . ' ' . ($topic['new'] && $context['user']['is_logged'] ? '<a href="' . $scripturl . '?topic=' . $topic['id'] . '.msg' . $topic['newtime'] . '#new"><img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/new.gif" alt="' . $txt[302] . '" border="0" /></a>' : '') . ' <span class="smalltext">' . $topic['pages'] . '</span></td>

Similar changes should be made on line 229 in Recent.template.php. Just a warning, I didn’t do any testing so if you decide to try it, backup these files, make the changes during off hours and test them out for a little while before deciding to make the changes permanent.