Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted June 25, 20213 yr Hi, What could be the reason behind the non-updating comment counter in the forum statistics block at the bottom of the main page? I rewrote the short format of the post counter to a long format, then this error occured.
June 25, 20213 yr Widgets are cached and updated from time to time. There’s a setting on ACP to control the number of minutes. Or isn’t updating at all?
June 26, 20213 yr Author Thanks for the answer! It updates once a day. Edited June 26, 20213 yr by Ody Mandrell
June 27, 20213 yr Author @Adriano Faria What do you suggest? Is there a solution to the problem outlined above?
June 29, 20213 yr On 6/25/2021 at 6:30 AM, Ody Mandrell said: Hi, What could be the reason behind the non-updating comment counter in the forum statistics block at the bottom of the main page? I rewrote the short format of the post counter to a long format, then this error occured. I did the same as you and I'm also seeing the same issue. Changed the Forum Stats block from short to long format and now it doesn't refresh when the cache refreshes (ours is set to refresh every 4 minutes). I can get it to refresh if I edit and re-save the block, or if I delete and re-install the block using the Block Manager. Does anyone have any suggestions to fix this? Please don't say revert back to short format post and topic counts 😬
June 29, 20213 yr Are you guys sure that this behaviour started after your changes? And how are those changes made anyway? I wouldn’t be surprised if those values were always cached and your action didn’t change a thing regarding the updating.
June 29, 20213 yr *whistles* /** * @brief Cache Expiration - 24h */ public $cacheExpiration = 86400; *whistles* Edited June 29, 20213 yr by Nathan Explosion
June 29, 20213 yr On 6/29/2021 at 12:15 PM, opentype said: Are you guys sure that this behaviour started after your changes? And how are those changes made anyway? I wouldn’t be surprised if those values were always cached and your action didn’t change a thing regarding the updating. Here's where I changed the format from "short" to "long". I can't be 100% certain that it wasn't refreshing as expected before changing the format from short to long, given that the short format doesn't show individual post increments so naturally would take longer to show an increase in post count from X.2k to X.3k posts, for example. And the block cache settings are set to reload every 4 minutes. On 6/29/2021 at 12:20 PM, Nathan Explosion said: *whistles* /** * @brief Cache Expiration - 24h */ public $cacheExpiration = 86400; *whistles* @Nathan Explosion, that's both helpful and not, all at the same time. What I think you're saying is that with the introduction of the new "short" format post count there is a global cache expiration setting which overrides the ACP cache refresh setting (below), and it's the global cache expiration that now needs to be adjusted once the post count format has been changed to "long"? If I have this right, can you show us where you found that snippet so that we can adjust it to a duration that makes more sense for long format post counts please?
June 29, 20213 yr On 6/29/2021 at 1:09 PM, Andy135 said: What I think you're saying is that What I am saying is that the widget now has a 24 hour cache expiration - I'm not tying it to any other change (you can, if you wish, but I am not) Widget files are stored in the applications\<application>\widgets folder on your installation - up to you if you want to manually modify the file, but I personally wouldn't and instead I would have looked at modifying it using a plugin instead (probably not an option for you) Edited June 29, 20213 yr by Nathan Explosion
June 29, 20213 yr On 6/29/2021 at 1:22 PM, Nathan Explosion said: What I am saying is that the widget now has a 24 hour cache expiration - I'm not tying it to any other change (you can, if you wish, but I am not) Widget files are stored in the applications\<application>\widgets folder on your installation - up to you if you want to manually modify the file, but I personally wouldn't and instead I would have looked at modifying it using a plugin instead (probably not an option for you) Our site is on a cloud-based subscription and I don't seem to have that folder so can't find the widget file. Curious to know why you think a plugin wouldn't be an option for us?
June 29, 20213 yr On 6/29/2021 at 2:06 PM, Andy135 said: Curious to know why you think a plugin wouldn't be an option for us? The comment that you made about editing the file kind of gives the indication that you may not know how to create a plugin - if that is incorrect, and you can create a plugin, then hook into \IPS\forums\widgets\forumStatistics and modify the $cacheExpiration variable that way. However, as you've now said "Our site is on a cloud-based subscription" then I'm guessing that means IPS hosted...so editing the file and also creating the plugin are out the window unfortunately. Edited June 29, 20213 yr by Nathan Explosion
June 29, 20213 yr On 6/29/2021 at 2:11 PM, Nathan Explosion said: The comment that you made about editing the file kind of gives the indication that you may not know how to create a plugin - if that is incorrect, and you can create a plugin, then hook into \IPS\forums\widgets\forumStatistics and modify the $cacheExpiration variable that way. However, as you've now said "Our site is on a cloud-based subscription" then I'm guessing that means IPS hosted...so editing the file and also creating the plugin are out the window unfortunately. Happy to put something together for you, if you want? You have PM. 👍