Skip to content

Honour the ACP "Show like counts" setting - #208

Merged
avandenberghe merged 1 commit into
develop33from
issue-197-show-likes-setting
Oct 4, 2026
Merged

avandenberghe merged 1 commit into
develop33from
issue-197-show-likes-setting

Conversation

@avandenberghe

Copy link
Copy Markdown
Collaborator

Closes #197.

Problem
The ACP saved "Show like counts" (rt_show_likes), but nothing read it. Like counts showed whenever Post Love was installed, whatever the setting.

Fix
core/recenttopics.php: a new show_likes() helper returns true when the Post Love service is present and rt_show_likes is on. It's used for:

  • the S_POSTLOVE template flag, which every Recent Topics template checks before showing a like count;
  • fetching the like counts, so switching the setting off also skips the Post Love query.

Tests

  • New tests/core/topic_likes_test.php, documented in tests/tests.md, runs fill_template() with a stand-in Post Love service.
    • Setting off: no like count, no Post Love query. This failed before the fix (the count of 7 was still shown).
    • Setting on: the count of 7 is shown.
  • Unit suite: 48 tests, 0 failures, run locally. The functional tests run in CI.

Checked on the local board (Post Love active, admin user, setting changed in memory only):

Code setting on setting off
current develop33 S_POSTLOVE = true S_POSTLOVE = true (setting ignored)
this PR S_POSTLOVE = true S_POSTLOVE = false

None of the local board's recent topics have likes, so the like totals were 0 in every case. The unit test covers the counts themselves.

No changelog entry or version bump, per this repo's convention.

🤖 Generated with Claude Code

The ACP saved rt_show_likes, but nothing read it: like counts showed
whenever Post Love was installed, whatever the setting.

Add show_likes() (Post Love present and rt_show_likes on) and use it
for the S_POSTLOVE template flag and for fetching the like counts, so
switching the setting off also skips the Post Love query.

Closes #197

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@avandenberghe
avandenberghe merged commit ec1f1e5 into develop33 Oct 4, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ACP "Show like counts" checkbox (rt_show_likes) is saved but never read

1 participant