Jump to content

Recommended Posts

Posted

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.

Posted
On 6/25/2021 at 7: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 😬

Posted

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. 

Posted
48 minutes ago, 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.

FknUzpG.jpg

 

And the block cache settings are set to reload every 4 minutes. 

SUH6Q4m.jpg

48 minutes ago, 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?

SUH6Q4m.jpg

Posted (edited)
13 minutes ago, 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 by Nathan Explosion
Posted
40 minutes ago, 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?

Posted (edited)
59 minutes ago, 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 by Nathan Explosion
Posted
12 minutes ago, 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. 👍

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...