Repository navigation
Honour the ACP "Show like counts" setting - #208
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 newshow_likes()helper returns true when the Post Love service is present andrt_show_likesis on. It's used for:S_POSTLOVEtemplate flag, which every Recent Topics template checks before showing a like count;Tests
tests/core/topic_likes_test.php, documented intests/tests.md, runsfill_template()with a stand-in Post Love service.Checked on the local board (Post Love active, admin user, setting changed in memory only):
develop33S_POSTLOVE = trueS_POSTLOVE = true(setting ignored)S_POSTLOVE = trueS_POSTLOVE = falseNone 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