First of all, thank you to everyone for their patience. I know I promised this a while ago but I have only recently had time to finish this off. Specifically I would like to thank @Azhria Lilu, @The Sandman, @MattW and @Martok for giving this some testing.
The most important feature of this release is the new caching feature. This should drastically improve the number of hits your database gets as the Unread Post Count is now cached for 1 minute by default in the visitor's session. Should you wish to increase the cache time, you can find the setting in Admin CP > Options > Threads, Discussions and Conversations:
There is a chance that this could still perform poorly on extremely busy boards or databases that aren't optimised. Changing the cache time up will help, but ultimately each of your logged in members will still be running quite a heavy query every X minutes.
Finally, the annoying bug which counted unread posts in deleted threads has been resolved.
A number of people kindly helped by suggesting some CSS tweaks. I think this update (which I actually worked on over a month ago) contains some suggested CSS from netrix (thank you).
This version of the Unread Post Count add-on dramatically improves performance so that the query used to fetch the post count takes a fraction of the time it could do previously on boards with large numbers of posts.
Something very important happens during the install or upgrade of the add-on.
An index is added to the xf_post table. This index applies to the post_date column.
Adding an index can sometimes be a lengthy operation (directly dependent on the number of posts in the xf_post table). On my forum with 3,000,000 posts the operation took 50 seconds.
Often this amount of time is beyond the PHP max execution time.
If you receive an error during install or upgrade stating that the max execution time has been exceeded, then please run the following query directly on your XenForo MySQL database using PHP My Admin (or preferably directly on the command line):
After that query has run, the add-on will install/upgrade without issue.Code:
ALTER TABLE `xf_post` ADD INDEX `unread_post_count_post_date` (`post_date` ASC)
In the event that you're unable to perform this query and as a result performance problems persist then you should uninstall the add-on as no further support can be provided.
- Resolves a bug which was counting posts in forums where "show in What's New" was disabled.
- Resolves a bug which was counting posts that were moderated or deleted.
- Resolves a bug where the whats_new phrase wasn't escaped properly meaning adjustments to the phrase (specifically without the ?) would cause the add-on not to display the count.
- The above fix also makes the add-on more compatible with RTL languages.
- Regular expression has been slightly adjusted so as to work better with all styles and add-ons and other customisations.