[AP] Daily Goals

[AP] Daily Goals 2.5.0

No permission to download
1.3.2:
  • Remove "!empty($forum_id)" check in Cron jobs, now that we've reversed the node selections
1.3.1:
  • Add branding free option
  • Reverse node selection so you're selecting nodes to exclude instead
  • Stop hardcoding bar color, use @xf-paletteAccent2 instead
  • Update various "Daily Goal" -> "Daily Goals" in phrases
Thanks to @Andro for helping test.
  • Rename addon "[AP] Daily Goal" -> "[AP] Daily Goals"
  • Fix missing widget definition description phrase
  • Change widget title "Daily Goal" -> "Daily goals"
  • Add branding
  • Add Progress Bar BG style property
  • Replace Progress Bar color option with style property for theme-specific colors
  • Optimize Thread counting query
  • Fix Red/green counter color comparing against Post goals for Threads & Member Registrations
  • Fix Thread cron script reads from Post node IDs instead of Thread node IDs
  • Style progress bar like Russ's bars
  • Check if $forum_id contains a value or not. This fixes an SQL error if $forum_id was null (eg the cron scripts run before the admin specifies nodes for the addon).
  • Fix missing widget definition phrase
  • Allow admins to choose which nodes will count towards the post & thread goals (suggested by @Ozzy47)
  • Allow admins to choose the color of the progress bars
  • Allow admins to disable post, thread, or member registration goals
  • Add widget and progress bars for the goals (suggested by @Andro)
  • Add daily thread & member registration goals (suggested by @Andro)
This update no longer hooks into the posting process to add +1 to the goal counter, and instead adds a cron job that runs every 10 minutes to count how many posts have been made today based on their timestamps. Therefore, it should fix all known issues, and even include posts made before the addon was installed.

It also adds a permission for viewing the counter.
This is a hotfix to quickly address some issues that were discovered yesterday. The only known funkiness now is that the counter could decrease by -1 any time a post is deleted, including a post from say 10 years ago.

With this in mind, I feel the best approach for the future will actually be to run a cron entry every 30 minutes or so that queries what posts have dates for that day, and to readjust the counter accordingly. But, I still wanted to get this addon at least decently usable, thus this hotfix. Note that until the addon is revamped to query those post dates, posts made before this version of the addon was installed will not be counted.

  • Stop increasing the counter when a post is edited
  • Fix broken phrase in admin panel (option.ap_goal)
  • Remove useless title attribute from Cron entry
  • No longer increases goal count when a post is made in a node with message counts disabled
  • Like
Reactions: Faust
Top Bottom