[AddonsLab] Unread Post Count

[AddonsLab] Unread Post Count 1.6.0

No permission to download
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?
 
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.

It will show anything a callback returns, it can return "New" work instead of count. Anyway, you need a callback that correctly counts/checks the unread media items, and this product is just not related to media add-on.

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?

No, there is no option for users to decide if they want to see the badge or no. Of course, a developer should be able to assist you with that, it will just require another callback that takes into account user preferences (and of course implementing the new preference option to enable/disable the counter). The cache works exactly as you described, it will re-count new items. It also updates the count when a forum is marked as read or a thread is marked as read.

Thank you!
 
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.

does anyone know what code i would use to implement this in the 'what's new' tab on the mobile view of @ThemeHouse's UI.X 2 Dark theme?

InkedScreenshot_2020-01-27 Squat the Planet_LI.webp
 
I'm curious, can I use this to display the number of unread posts in a specific node? and if so, what would the terms for it be in the callback field?
 
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
@AddonsLab the latest update on this fixes these errors, yes?
 
AddonsLab updated [AddonsLab] Unread Post Count with a new update entry:

Performance optimization

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...

Read the rest of this update entry...
 
@AddonsLab the latest update on this fixes these errors, yes?
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!
 
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!
Interesting. Thank you for the update and the fix. Much appreciated.
 
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".
 
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".
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.
 
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.
That didn't help, but uninstalling the add-on and reinstalling it did.
 
Why did the loading behavior change in 1.4.2? I get a lot of compliance from my community members. Is there a safe way to downgrade? (Where can I download 1.4.1)?
 
Top Bottom