# iOS Safari Userscripts — cs.rin.ru [English](#english) | [Deutsch](#deutsch) --- ## English A single userscript that rebuilds the phpBB2 pages of `cs.rin.ru` into a mobile layout for Safari on iOS. It replaces the original table layout entirely: the existing page content is hidden and a freshly built DOM is appended to `
`. `rin-mobile.user.js` matches `*://cs.rin.ru/forum/*` and picks its view from the page type: | Page | View | |---|---| | `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 | | `ucp.php?mode=login` | Login form, restyled in place | | 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. Forums, global announcements, announcements, stickies and topics all end up in the same stream of cards, which loses the separation the original page draws between them. A header strip naming the section and its card count is therefore inserted wherever the kind changes, and forum cards additionally carry a coloured left edge. The label is taken from the board's own separator row (`Global Announcements`, `Stickies`, `Topics`), so sections this script does not know are named correctly too. Which kind a topic row is comes from the icon in its first column, not from its title. The strip is left out directly below a category heading, which already introduces the forums under it. Tapping a header collapses its section. Global announcements, announcements and stickies start collapsed: they precede the topics on *every* page of a forum and otherwise fill the first screen. The state is stored per kind in `localStorage`, so collapsing stickies once applies to every forum. `localStorage` is used rather than `GM_setValue` because it needs no `@grant` and behaves the same in Tampermonkey and in the iOS app; the trade-off is that Safari may clear script-writable storage after long inactivity, which resets the sections to their default. Both views share the same fixed navigation bar at the bottom: 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 taken from the rendered page links, because phpBB only ever shows a handful of them. `per_page` is read from the `jumpto()` function the forum embeds in the page; without it, only first page and the original previous/next links remain available. In the list the bar is built only where there is more than one page — forum pages run to hundreds of them, category pages to one. Both views carry a fixed breadcrumb bar at the top, taken from the forum's own `Board index » … » Main Forum` trail. Without it there is no way back out of a thread, because the original page is hidden and phpBB links the parent forum nowhere else. The bar scrolls horizontally if the trail is too long for the screen, and is left out entirely on pages that do not carry a trail. Note that `Board index` leads to `index.php`, which the script does not rebuild — that page arrives in its desktop layout. The breadcrumb bar also carries a login pill, built on every page the script touches, not only the login form itself. Session state is read from the forum's own menu bar: a `mode=login` link means logged out, a `mode=logout` link means logged in, and the pill switches between a "Login" link and the account name accordingly. The name is parsed from the link text with a `Logout [ Name ]` pattern; that pattern is unverified against a real logged-in session, since the repository's fixtures are all captured while logged out — if the pattern does not match, the pill still shows "Logout", just without a name, rather than breaking. The login form itself is not rebuilt from scratch: the original `