Cannabis Ape
Active member
This sounds useful and going to try it out
Thank you for your time making this.

No, the add-on is for unread posts only. Our add-on https://xenforo.com/community/resources/addonslab-navigation-badge.5839/ allows adding a badge on any navigation item, you just need a callback class/method that returns the number of items.
What would the callback/class be for new items in XFMG? Thanks!
We did not develop such class, feel free to post a request, there may be some developers who would like to implement it.
Thank you!
Can it say New when there is new media added instead of a count? How could I do that? I tried it in Static Value but it's always there.
Got it working
Is there an option for users to turn this off? Not complete sure about the cache. If I set it to 60min, it means it will show current new items for 60 min before it refreshes?
Sorry, I missed your reply again. This is not a template edit, but added to the navigation using our Navigation Badge add-on. The method\AL\UnreadPostCount\Callback::getUnreadPostCount('')
returns the number of unread posts as a phrase (the serivce\AL\UnreadPostCount\Service\CounterService
can be used to get the raw number). You need a minor modification to pass this counter as a parameter to any template where you want to show the counter.
Will this add-on be updated for the latest version of XF?
Now at least two people have asked for itYes, the add-on counts the unread posts in all forums. We will try to add an option for it soon, but no ETA for now.
Thank you!
@AddonsLab the latest update on this fixes these errors, yes?I've been receiving these errors...are they from your two add-ons?
Code:An exception occurred: [XF\Db\Exception] MySQL fetch error [2014]: Commands out of sync; you can't run this command now in src/XF/Db/AbstractStatement.php on line 228 XF\Db\AbstractStatement->getException() in src/XF/Db/Mysqli/Statement.php at line 196 XF\Db\Mysqli\Statement->getException() in src/XF/Db/Mysqli/Statement.php at line 134 XF\Db\Mysqli\Statement->fetchRowValues() in src/XF/Db/AbstractStatement.php at line 63 XF\Db\AbstractStatement->fetch() in src/XF/Db/AbstractStatement.php at line 113 XF\Db\AbstractStatement->fetchAll() in src/XF/Db/AbstractAdapter.php at line 155 XF\Db\AbstractAdapter->fetchAll() in src/addons/AL/UnreadPostCount/Service/CounterService.php at line 99 AL\UnreadPostCount\Service\CounterService->fetchUnreadPostCountForUserInForums() in src/addons/AL/UnreadPostCount/Service/CounterService.php at line 57 AL\UnreadPostCount\Service\CounterService->fetchUnreadPostCountForUser() in src/addons/AL/UnreadPostCount/Service/CounterService.php at line 35 AL\UnreadPostCount\Service\CounterService->rebuildFromDatabase() in src/addons/AL/UnreadPostCount/Service/CounterService.php at line 27 AL\UnreadPostCount\Service\CounterService->getCachedCount() in src/addons/AL/UnreadPostCount/Callback.php at line 20 AL\UnreadPostCount\Callback::getUnreadPostCount() call_user_func() in src/addons/AL/NavigationBadge/Listener/NavigationSetup.php at line 49 AL\NavigationBadge\Listener\NavigationSetup::listen() call_user_func_array() in src/XF/Extension.php at line 67 XF\Extension->fire() in src/XF/App.php at line 2654 XF\App->fire() in src/XF/Pub/App.php at line 572 XF\Pub\App->getNavigation() in src/XF/Pub/App.php at line 513 XF\Pub\App->renderPageHtml() in src/XF/App.php at line 1995 XF\App->renderPage() in src/XF/Mvc/Dispatcher.php at line 402 XF\Mvc\Dispatcher->render() in src/XF/Mvc/Dispatcher.php at line 58 XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2184 XF\App->run() in src/XF.php at line 391 XF::runApp() in index.php at line 20
The release changes the way unread post count is loaded from the database, delaying the query till the page is fully generated and sent to users. Because of it users will see the out-of-date count for one more page load, but on the next load, they will see the updated data, without any effect on the speed of generation of the data. Just as before, the query does not happen on every page, but only when the cache is out of date.
This will also resolve the cases when MySQL error might be...
The fix in the latest update is does not specifically fix the error you are getting.@AddonsLab the latest update on this fixes these errors, yes?
Interesting. Thank you for the update and the fix. Much appreciated.The fix in the latest update is does not specifically fix the error you are getting.
The error in question seems to be somehow caused because of a conflict with another add-on. Technically, the error would happen only if the navigation is built running an SQL query, and our callback would be called before all rows for that query are loaded from the DB. This is not the case with default XF (at least, we were unable to reproduce it), but we have updated the product to delay/postpone the SQL query to avoid such conflict. The fix is released now.
Thank you!
Does not seem to be related to the add-on, but to the process of upgrade/rebuilding of templates. Most likely there was a background process of rebuilding templates during your first try and it completed before the second try. Just try the add-on in a new browser/incognito mode, if it works, then there is no further troubleshooting needed.After the last upgrade of this add-on, the unread post count stopped working. Not until I went down to the theme-chooser in the footer and selected "Show default theme" it started showing up again. The funny thing is, the default theme is the same theme as I used before choosing "Show default theme".
That didn't help, but uninstalling the add-on and reinstalling it did.Does not seem to be related to the add-on, but to the process of upgrade/rebuilding of templates. Most likely there was a background process of rebuilding templates during your first try and it completed before the second try. Just try the add-on in a new browser/incognito mode, if it works, then there is no further troubleshooting needed.
We use essential cookies to make this site work, and optional cookies to enhance your experience.