fix: recognise forum rows in the list view

A viewforum page is not always a list of topics — a category page lists
forums, and a forum page can carry both. Every row was treated as a topic,
so on those pages the only link the row offered was the icon in its last-post
column: the forum name was dropped, its description ended up in the muted
footer line, and nothing was left to tap. Moving between forums on a phone
was impossible.

Rows are now classified by their first usable link, which relies on document
order: a forum row names the forum before it links the last post. Detection
prefers phpBB's own classes and falls back to the shape of the row, because
the board runs a custom theme whose markup could not be verified — the page
requires a login.

That fallback needs a brake. The page scaffolding is itself a table, so a
link outside any list row resolves to a row containing the whole document,
which passed for a forum row and turned the page header, a stylesheet and
inline scripts into a forum description. Rows carrying nested tables, forms
or scripts are therefore rejected, and descriptions are read only from the
title cell's own text.
This commit is contained in:
Andre
2026-08-02 14:55:39 +02:00
parent bc9c4937ff
commit 3609d9e151
3 changed files with 268 additions and 65 deletions
+19 -2
View File
@@ -15,10 +15,18 @@ page type:
| Page | View |
|---|---|
| `viewforum.php`, `search.php`, forum root | Topic list as cards |
| `viewforum.php`, `search.php`, forum root | Topic and forum list as cards |
| `viewtopic.php` | Thread as a post stream with a fixed bottom navigation bar |
| anything else | Untouched — no styles are injected |
A `viewforum.php` page is not necessarily a list of topics: a category page
lists forums instead, and a forum page can carry both. Each table row is
therefore classified by its first usable link. Forum rows become cards with
name, description, subforum links and counts; topic rows keep their existing
card; category headers become section headings. Rows are recognised by phpBB's
own `forumlink` / `forumdesc` classes, and failing that by their shape — two
purely numeric columns are only ever a forum's topic and post count.
The thread navigation bar holds first / previous / next / last and a page
indicator. Tapping the indicator opens a sheet with a number field and a grid of
all pages. Targets are computed as `start = (page - 1) × per_page` rather than
@@ -178,10 +186,19 @@ anhand des Seitentyps:
| Seite | Ansicht |
|---|---|
| `viewforum.php`, `search.php`, Forumwurzel | Themenliste als Karten |
| `viewforum.php`, `search.php`, Forumwurzel | Themen- und Forenliste als Karten |
| `viewtopic.php` | Thread als Beitragsstrom mit fixierter Navigationsleiste |
| alles andere | Unverändert — es werden keine Stile injiziert |
Eine `viewforum.php`-Seite ist nicht zwangsläufig eine Themenliste: eine
Kategorieseite listet Foren auf, eine Forenseite kann beides enthalten. Jede
Tabellenzeile wird deshalb anhand ihres ersten verwertbaren Links eingeordnet.
Forenzeilen werden zu Karten mit Name, Beschreibung, Unterforen und Zahlen,
Themenzeilen behalten ihre bisherige Karte, Kategoriezeilen werden zu
Zwischenüberschriften. Erkannt werden die Zeilen an phpBBs eigenen Klassen
`forumlink` / `forumdesc` und ersatzweise an ihrer Form — zwei rein numerische
Spalten hat nur eine Forenzeile mit Themen- und Beitragszahl.
Die Navigationsleiste im Thread enthält erste / vorherige / nächste / letzte
Seite und eine Positionsanzeige. Ein Tipp darauf öffnet ein Sheet mit
Zahlenfeld und einem Raster aller Seiten. Die Ziele werden als