MyBB Community Forums

Full Version: Use 'go to unread' on index page?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi all,

Currently using a plugin to display the most popular threads from my forum on the index page and I'd like to be able to highlight when there are new posts in those threads from the index page, but it appears that the {$gotounread} tag/query doesn't work from there and only works under forum display > thread.

So my question is, is there any way at all to get it to work from the index page and on my popular threads area? Either by altering the template or via another plugin.

Any help appreciated, and thanks!
What you could do is having a link look like this:
<a href="{$mybb->settings['bburl']}/showthread.php?tid={$lastpost_data['lastposttid']}&action=newpost">{$lastpost_data['lastpostsubject']}</a>

That will make the thread links go to the newest post. It will not check if there actually is a new post in that thread though.
That will need a plugin modification but to give you an idea on how to do it just open: forumdisplay.php and find: // Read threads the code below is what you need.
Thanks, but they already go to the first new post when clicked. It's the notification of new posts that I'm looking for. The little green arrow produced by {$gotounread}.

(2014-06-06, 07:50 PM)marcus123 Wrote: [ -> ]That will need a plugin modification but to give you an idea on how to do it just open: forumdisplay.php and find: $gotounread = ''; the code below is what you need.

Thanks. I found it, but I've no idea what part I need and where I'd put it.
You can do it with a template conditional D666 should be able to help you.

Maybe add t.lastpost to query and then use conditional like.

$checkdate = TIME_NOW - 60;
if ($thread['lastpost'] > $checkdate)

This is just an idea

Please post here your code or tell us what plugin you are using.
Yeah, I'm incredibly confused now. Haha!
hi - is that thredder? If so, this is a gallery plugin that I made for him to go on his index page. It queries the posts table and forums and another table from another plugin.

The plugin was built to spec (and a bit more).

In order to get a real unread value then a fair bit more code would need to be added. Given that there are 5 of these plugins running on the index then adding the gotounread on all five of them seems a tad unwise.
Hi Lee, yes it is. That name was taken. Haha!

I don't want to run it on all 5, just on the main one.
I wouldn't run it on any of them. Not even MyBB core runs that on the index.
I am seconding Leefish's suggestion of not using it on the index. It becomes very server intensive with multiple extra queries being needed.