From 2e2fab1bc524e7b7d43e19fe96025266ea703eb2 Mon Sep 17 00:00:00 2001 From: William Jacoby Date: Sun, 18 Oct 2026 19:00:18 -0500 Subject: [PATCH] Plan optional first-view-only counting in TODO Add an opt-in setting to count only the first view of a topic per session, since phpBB's own repeat-view check misses ?t=N and ?p=N links and matches the wrong topic. Also point the waiting item at the filed ticket (PHPBB-17745) and core pull request (phpbb/phpbb#7092). Co-Authored-By: Claude Opus 5.5 --- docs/TODO.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/TODO.md b/docs/TODO.md index 9cff89f..24fefbd 100644 --- a/docs/TODO.md +++ b/docs/TODO.md @@ -2,16 +2,17 @@ ## Waiting on phpBB -- File the tracker ticket for [`core.viewtopic_modify_view_counter_update`](events/viewtopic_modify_view_counter_update.txt) and open the phpBB core pull request. +- Wait for [`core.viewtopic_modify_view_counter_update`](events/viewtopic_modify_view_counter_update.txt) to be merged: tracker ticket [PHPBB-17745](https://tracker.phpbb.com/browse/PHPBB-17745), pull request [phpbb/phpbb#7092](https://github.com/phpbb/phpbb/pull/7092). - Once a phpBB release includes the event, raise the minimum phpBB version in `composer.json` and `ext.php` to that release. ## Build the extension - Listener on `core.viewtopic_modify_view_counter_update` that sets `update_view_counters` to false when any of the rules below apply. - `u_viewcountexempt` user permission ("Views do not count"), no one has it by default. -- ACP settings (both off by default, so nothing changes until an admin turns them on): +- ACP settings (all off by default, so nothing changes until an admin turns them on): - Topic authors don't add views to their own topics (`topic_data['topic_poster']`). - Administrators don't add views. + - Optional: count only the first view of a topic in a session. phpBB's own repeat-view check looks for `'&t=' . $topic_id` in `session_page`, so reloads of `viewtopic.php?t=N` and `viewtopic.php?p=N` (the links phpBB itself makes) count every time, and a view of topic 1 right after topic 12 is skipped. A maintainer said in [PHPBB-16989](https://tracker.phpbb.com/browse/PHPBB-16989) that counting every view is intended, so this would be opt-in. Matching `t=` as a whole value and mapping `p=` to its topic would fix both cases. - Decide whether exempt views should still add to inline attachment download counts (the event allows counting one but not the other). - Migration for the permission and config values, ACP module and language strings. - Unit tests for the listener and a runtime check on a seed-forum test board.