Repository navigation
Add an ACP option to show announcements first - #213
Merged
Merged
Conversation
New setting "Show announcements first" (rt_announcements_first, off by default). When on, fill_template() moves the announcements and global announcements on the current page to the top of that page, keeping their time order; the rest of the page, including stickies, keeps its order. Only rows already on the page move, so old announcements never come back into the list, and paging is unchanged. - release_3_0_12 migration adds the config value - ACP checkbox next to "Minimum topic type level" - Language strings in all 14 packs Closes #201 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 #201.
What it does
rt_announcements_first), off by default, placed next to "Minimum topic type level".fill_template(): index, forum view, side column, the standalone pages, and unread-only mode.Changes
core/recenttopics.php: a newannouncements_first()helper does a stable partition of the page's rows. It runs right afterget_topics_sql()and before themodify_topics_listevent, so other extensions see the final order. There's no SQL change.migrations/v300/release_3_0_12.php: addsrt_announcements_first = 0and removes it on revert.acp/recenttopics_module.php,adm/style/acp_recenttopics.html: the checkbox is saved and displayed.RT_ANNOUNCEMENTS_FIRST/_EXPin all 14 language packs, translated using phpBB's own term for "announcement" in each language.Tests
tests/core/announcements_first_test.php: one page of normal, announcement, sticky and global topics. With the setting on they render announcement, global, normal, sticky; with it off, in the original order. The "on" case failed before the change.tests/tests.mdupdated. Unit suite: 73 tests, 0 failures locally, with the harness loadingfunctions_content.phplike CI.Checked on the local board (page 1 as admin, setting changed in memory only; G = global announcement, S = sticky, N = normal):
No changelog entry or version bump, per this repo's convention. The migration is named for 3.0.12, the release this ships in.
🤖 Generated with Claude Code