Uutiset:

Wondering if this will always be free?  See why free is better.

Main Menu
Advertisement:

Unread indicators for recent posts on board index

Aloittaja Antechinus, kesäkuu 18, 2014, 06:20:41 IP

« edellinen - seuraava »

Antechinus

So Colby67 and I have been kicking theme ideas around, and he came up with the idea of putting the recent posts list on the board index up top, before the categories. This kinda makes sense, especially for guests who can't use the unread/replies links. It looks rather good up there too, IMO (I tried it on local).

So, then I had another idea: what if the recent posts listing on the board index could be given new/old indicator icons for logged-in members?

The idea is to call existing logic, without hacking Sources, since this is nominally a theme rather than a mod. BoardIndex.template has code for indicating unread boards, but after trying a few things I haven't been able to get it working for recent posts.

Anyone got any ideas here? :)

Arantor

Well, that data is retrieved in 2.0 from getLastPosts in Subs-Recent.php which has the following annotation:

// !!!SLOW This query is now slow, NEEDS to be fixed.  Maybe break into two?

And it doesn't even perform the joins to the last read table logs, so there's no chance it obtains the last read status - so no way to expose that into a theme. And calling it from a theme is of course bad form.

So, no go for themes if you're being all good and proper. If not, you want to rewrite getLastPosts to include the joins and retrieve the data which is even more a performance hurt than it already is.
Holder of controversial views, all of which my own.


Antechinus


Advertisement: