Skip to content

Commit ae8194c

Browse files
committed
upd
1 parent cf1891d commit ae8194c

3 files changed

Lines changed: 45 additions & 51 deletions

File tree

contrib/CHANGELOG.md

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,39 @@
11
### Changelog
22

3-
- 3.0.0 (31/05/2026)
4-
- Squashed all prior 3.0.x migrations into a single release migration; canonical version is now `ext::RT_VERSION` (class constant), no `rt_version` row in `phpbb_config`
5-
- Forum visibility in Recent Topics includes forums where the user holds `f_list_topics` ("Can see topics") permission without `f_read` — topic titles are shown to entice login while content remains gated by phpBB's normal read check
6-
- For the full feature history of the 3.0.x line see the git log
3+
- 3.0.0 (31/05/2026) — relaunch under avathar/recenttopics namespace, consolidating everything since the avathar fork of paybas/recenttopics
4+
5+
New features
6+
- [NEW] Display Recent Topics on viewforum (top/bottom) in addition to the index page (#178)
7+
- [NEW] Standalone pages: `/app.php/rt` (full) and `/app.php/rt/simple` (iframe-embeddable), with a dedicated ACP toggle independent of index display (#155)
8+
- [NEW] Optional advertisement / HTML block on the index page, with ACP toggle and textarea (#160)
9+
- [NEW] Postlove integration — like counts in the topic list when `avathar/postlove` is installed (#162); ACP toggle to enable/disable (#164)
10+
- [NEW] ACP toggle to show/hide date in side view (#163)
11+
- [NEW] `modify_ads_code` event so third-party extensions can inject advertisement content (#175)
12+
- [NEW] Backward-compat `paybas.recenttopics.*` event aliases — downstream extensions written against the original fork keep working (#169)
13+
- [NEW] Forum visibility widened: forums where the user has `f_list_topics` ("Can see topics") but not `f_read` now also appear — exposes titles to entice login while content stays gated (#182)
14+
- [NEW] Slovak (sk) and Swedish (sv) translations; grammar / spelling sweep across all locales
15+
- [NEW] `contrib/cleanup_recenttopics.sql` script for removing legacy installs
16+
17+
Changes
18+
- [CHG] Renamed namespace from the legacy `recenttopicsav` to `recenttopics` — the "av" suffix from the paybas-era fork is no longer needed since the vendor namespace is already `avathar`
19+
- [CHG] Migration history squashed to a single release migration; canonical version is now `ext::RT_VERSION` (class constant), no `rt_version` row in `phpbb_config`
20+
- [CHG] Donate link moved from PayPal to Patreon
21+
- [CHG] PHP 8.1 and phpBB 3.3.0 minimum enforced via `is_enableable()` with clear error messages (#171)
22+
- [CHG] Removed abandoned integrations: paybas/topicprefixes (#166), imkingdavid/prefixed (#167), nickvergessen/newspage
23+
24+
Fixes
25+
- [FIX] PHP 8.0–8.4 compatibility across the codebase (#142, #148)
26+
- [FIX] French language files no longer 500 on unescaped apostrophes
27+
- [FIX] Duplicate ad block render in pbWoW3 — use `DEFINE` for the `ADSIDE` flag so it's detectable across template scopes
28+
- [FIX] Standalone page loads `functions_display.php` and resolves the template path (#138, #150)
29+
- [FIX] User registration applies ACP default preferences (#124)
30+
- [FIX] "Posted in" star icon (S_USER_POSTED) now shows in the topic listing (#133)
31+
- [FIX] Undefined array key warning in the viewonline listener (#176)
32+
- [FIX] pbWoW3 top/bottom block: collapse support and column alignment (#139)
33+
- [FIX] Duplicate collapse buttons in pbWoW3 style
34+
- [FIX] Empty "Latest version:" line when the version check service is unreachable
35+
- [FIX] Unclosed `<span>` in UCP preferences template
36+
- [FIX] pbTech side-block heading matches the category-bar style
37+
38+
- 2.2.15 (05/04/2021) — last release under paybas/recenttopics before the avathar fork
39+
- [FIX] PHP 8.0 compatibility (#142)

contrib/Events.md

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -83,34 +83,22 @@ If you are building an extension that wants to add a column, filter out certain
8383

8484
---
8585

86-
### 1.4 `avathar.recenttopics.topictitle_remove_re`
86+
### 1.4 `avathar.recenttopics.modify_topictitle`
8787

88-
**What this event is for:** phpBB stores the *last post subject* in the topic row rather than the topic title. When someone replies, the last post subject is "Re: Original Title". This event fires once per row so that a listener can strip the "Re: " prefix and display a clean title. Recent Topics includes a built-in listener for exactly this purpose — it is the only case where the extension listens to its own event.
89-
90-
- **Placement:** `core\recenttopics::fill_template()`, once per topic row
91-
- **Since:** 3.0.0
92-
- **Arguments:**
93-
- `row` (array) — The raw topic row data. The built-in listener reads and writes `row['topic_last_post_subject']`.
94-
- **Known listeners:** internal — `event\listener::topictitle_remove_re()`
95-
96-
---
97-
98-
### 1.5 `avathar.recenttopics.modify_topictitle`
99-
100-
**What this event is for:** Just before the topic title is assembled for display, this event provides a chance to prepend a label or badge. The `prefix` argument starts as an empty string; your listener can set it to any HTML fragment and it will appear before the topic title in the output.
88+
**What this event is for:** Just before the topic title is assembled for display, this event provides a chance to prepend a label or badge AND to strip prefixes from the last-post subject. The `prefix` argument starts as an empty string; your listener can set it to any HTML fragment and it will appear before the topic title in the output. The built-in `topictitle_remove_re` listener also subscribes here to strip the "Re: " prefix from `row['topic_last_post_subject']`.
10189

10290
**Example use case:** An extension that adds a topic type label ("Announcement", "Sticky") could set `prefix` to a small badge here.
10391

10492
- **Placement:** `core\recenttopics::fill_template()`, once per topic row
10593
- **Since:** 3.0.0
10694
- **Arguments:**
107-
- `row` (array) — The raw topic row data (read only).
95+
- `row` (array) — The raw topic row data. Listeners may read and write back; the built-in listener writes `row['topic_last_post_subject']`.
10896
- `prefix` (string) — The prefix string to prepend to the title. Set this and write it back to add content.
109-
- **Known listeners:** none
97+
- **Known listeners:** internal — `event\listener::topictitle_remove_re()` (strips "Re: " from last-post subject)
11098

11199
---
112100

113-
### 1.6 `avathar.recenttopics.modify_tpl_ary`
101+
### 1.5 `avathar.recenttopics.modify_tpl_ary`
114102

115103
**What this event is for:** This is the most commonly used hook. It fires once per topic row, just before the template variable array for that row is assigned to the `recent_topics` block. By this point Recent Topics has already built a complete `tpl_ary` with all its own variables (topic URL, title, author, last post time, unread flag, etc.). Your listener can add extra keys to `tpl_ary` and they will be available in the template.
116104

@@ -125,14 +113,14 @@ If you are building an extension that wants to add a column, filter out certain
125113

126114
---
127115

128-
### 1.7 `avathar.recenttopics.modify_ads_code`
116+
### 1.6 `avathar.recenttopics.modify_ads_code`
129117

130118
**What this event is for:** Fires just before the advertisement block HTML is assigned to the `ADS_INDEX_CODE` template variable. Recent Topics pre-populates `ads_index_code` from its own ACP setting (`rt_ads_enable` / `rt_ads_code`). A listener can read and replace this value to inject ad content from another source — for example, a style extension that manages its own ad configuration.
131119

132120
**Example use case:** The `paybas/pbwowext` style extension stores its own ad HTML in its ACP. It listens here and writes its content into `ads_index_code`, becoming the ad content provider for pbWoW3 users without needing to assign `ADS_INDEX_CODE` directly from a different event.
133121

134122
- **Placement:** `core\recenttopics::display_recent_topics()`, after the RT ad config is read, before `assign_vars()`
135-
- **Since:** 3.0.6
123+
- **Since:** 3.0.0
136124
- **Arguments:**
137125
- `ads_index_code` (string|false) — The ad HTML to render, pre-set from RT's own config or `false` if RT ads are disabled. Override this to provide content from another source.
138126
- **Known listeners:** `paybas/pbwowext`
@@ -240,7 +228,7 @@ This section lists every phpBB event that Recent Topics subscribes to in order t
240228
| `core.acp_manage_forums_initialise_data` | `acp_manage_forums_initialise_data()` | Sets the default value ("included") for newly created forums |
241229
| `core.acp_manage_forums_display_form` | `acp_manage_forums_display_form()` | Passes the stored per-forum setting to the ACP template so the checkbox shows the right state |
242230
| `core.permissions` | `add_permission()` | Registers the `u_rt_view`, `u_rt_enable`, and `u_rt_location` permissions in phpBB's ACL system |
243-
| `avathar.recenttopics.topictitle_remove_re` | `topictitle_remove_re()` | A self-listener: strips the "Re: " prefix from last-post subject lines |
231+
| `avathar.recenttopics.modify_topictitle` | `topictitle_remove_re()` | A self-listener: strips the "Re: " prefix from last-post subject lines (merged here from the old `topictitle_remove_re` event for efficiency) |
244232

245233
### 3.2 PHP Events — UCP listener (`event/ucp_listener.php`)
246234

tests/core/recenttopics_events_test.php

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -516,29 +516,6 @@ public function test_legacy_modify_topics_list_fires_after_new_event()
516516
// 4. avathar.recenttopics.modify_topictitle (also handles Re: removal)
517517
// =======================================================================
518518

519-
/**
520-
* @covers \avathar\recenttopics\core\recenttopics::fill_template
521-
*/
522-
public function test_modify_topictitle_fires_with_row()
523-
{
524-
[$db] = $this->make_db_returning_one_topic();
525-
$dispatcher = new \phpbb\event\dispatcher();
526-
$fired = false;
527-
$received = null;
528-
529-
$dispatcher->addListener('avathar.recenttopics.modify_topictitle', function (\phpbb\event\data $event) use (&$fired, &$received) {
530-
$fired = true;
531-
$received = $event->get_data();
532-
});
533-
534-
$rt = $this->make_rt_for_fill_template_events($dispatcher, $db);
535-
$this->call_private($rt, 'fill_template', ['recent_topics', [], 1]);
536-
537-
$this->assertTrue($fired, 'Event avathar.recenttopics.modify_topictitle was not fired');
538-
$this->assertArrayHasKey('row', $received, 'Documented variable row missing from modify_topictitle event');
539-
$this->assertIsArray($received['row'], 'row must be an array');
540-
}
541-
542519
/**
543520
* A listener on modify_topictitle receives row data including topic_last_post_subject.
544521
*
@@ -562,10 +539,6 @@ public function test_modify_topictitle_modification_is_applied()
562539
$this->assertIsString($captured_subject);
563540
}
564541

565-
// =======================================================================
566-
// 5. avathar.recenttopics.modify_topictitle
567-
// =======================================================================
568-
569542
/**
570543
* @covers \avathar\recenttopics\core\recenttopics::fill_template
571544
*/

0 commit comments

Comments
 (0)