The issue
So it appears the 404 Pages on Flarum don't have access to any information from Flarum?
My issue is that when users are not logged in they receive the standard 404 page saying the thread wasn't found, so they're bouncing rather than realizing they need to log in.
So I downloaded FoF Html Errors to make my own error messages, but that leads to a different problem. Flarum uses the 404 Error page for any page it doesn't want to show a user, whether they are logged out and trying to view a members-only thread, or logged in and trying to access a thread they don't have permissions for, or clicking a link to a deleted conversation.
So I wanted to use div classes to program in two separate messages:
- I want guests to see a page telling them to log in, with the login link from FoF Direct Links, and
- I want logged in users to see a page telling them they don't have access to that thread, and redirecting them to all discussions
But the 404 page doesn't have anything about a user's logged in state, so it doesn't use the .guest-user or .logged-in tags, nor does it have the script check for login state that would allow me to manually add them.
Is there a way I can have the 404 page check if a user is logged in or not and apply the classes so I can split the error messages?
Or is there another Extension that'll give users a different error page than 404 when they're trying to view a hidden thread when logged out?
Flarum information
Not sure this applies in this case, aside from the fact I'm on Flarum 2.0.2, but in case this helps:
Flarum core: 2.0.2
PHP version: CLI: 8.5.12, Web: unable to detect
PHP memory limit: CLI: 512M, Web: unable to detect
MySQL version: 8.4.11
Loaded extensions: Core, date, lexbor, openssl, pcre, sqlite3, zlib, bcmath, bz2, calendar, ctype, curl, dba, uri, json, FFI, fileinfo, filter, ftp, gd, gettext, gmp, hash, iconv, SPL, session, intl, standard, mbstring, exif, memcached, mongodb, mysqlnd, Zend OPcache, PDO, pdo_mysql, pdo_pgsql, pdo_sqlite, pgsql, Phar, posix, pspell, random, redis, Reflection, imagick, libxml, soap, sockets, sodium, imap, ssh2, dom, sysvmsg, sysvsem, sysvshm, tokenizer, SimpleXML, xml, xmlreader, xmlwriter, xsl, zip, mysqli, cgi-fcgi
+-------------------------------+---------------+--------+-------+
| Flarum Extensions | | | |
+-------------------------------+---------------+--------+-------+
| ID | Version | Commit | Notes |
+-------------------------------+---------------+--------+-------+
| flarum-realtime | v2.0.2 | | |
| flarum-deck | v2.0.2 | | |
| flarum-audit | v2.0.2 | | |
| flarum-flags | v2.0.1 | | |
| flarum-tags | v2.0.2 | | |
| flarum-approval | v2.0.1 | | |
| flarum-suspend | v2.0.2 | | |
| flarum-gdpr | v2.0.1 | | |
| flarum-mentions | v2.0.2 | | |
| flarum-subscriptions | v2.0.1 | | |
| fof-user-directory | 2.0.2 | | |
| fof-pages | 2.0.1 | | |
| flarum-statistics | v2.0.1 | | |
| fof-follow-tags | 2.0.1 | | |
| fof-forum-widgets-core | 2.0.2 | | |
| fof-merge-discussions | 2.0.0-beta.4 | | |
| fof-discussion-views | 2.0.0 | | |
| fof-best-answer | 2.0.0 | | |
| fof-upload | 2.0.3 | | |
| fof-sitemap | 3.0.0 | | |
| flarum-markdown | v2.0.1 | | |
| flarum-lock | v2.0.1 | | |
| fof-byobu | 2.0.1 | | |
| flarum-messages | v2.0.2 | | |
| fof-default-user-preferences | 2.0.0 | | |
| pianotell-flamoji | v2.6.1 | | |
| peopleinside-antiflood | 2.0.4 | | |
| linkrobins-warble | v1.3.1 | | |
| linkrobins-support | v1.13.2 | | |
| linkrobins-font-sizer | v1.7.0 | | |
| linkrobins-discussion-banners | v2.1.0 | | |
| linkrobins-birdseye | v2.7.0 | | |
| ianm-log-viewer | 2.0.0-beta.2 | | |
| ianm-follow-users | 2.0.0 | | |
| glowingblue-date-filters | 2.0.2 | | |
| fof-webhooks | 2.0.0 | | |
| fof-usercard-stats | 2.0.0 | | |
| fof-user-bio | 2.0.1 | | |
| fof-top-posters-widget | 2.0.1 | | |
| fof-terms | 2.0.1 | | |
| fof-synopsis | 2.0.1 | | |
| fof-subscribed | 2.0.0-beta.1 | | |
| fof-split | 2.0.1 | | |
| fof-socialprofile | 2.0.0 | | |
| fof-signature | 2.0.0-beta.1 | | |
| fof-share-social | 2.0.1 | | |
| fof-seo | 4.0.0-beta.16 | | |
| fof-rich-text | 2.1.0 | | |
| fof-reactions | 2.0.1 | | |
| fof-pwned-passwords | 2.0.0 | | |
| fof-pwa | 2.0.0 | | |
| fof-polls | 3.0.1 | | |
| fof-online-users-widget | 2.0.0 | | |
| fof-oauth | 2.0.1 | | |
| fof-news-widget | 2.0.0 | | |
| fof-move-posts | v2.0.1 | | |
| fof-moderator-warnings | 2.0.0 | | |
| fof-moderator-notes | 2.0.0 | | |
| fof-mark-unread | 2.0.0 | | |
| fof-links | 2.0.0 | | |
| fof-ignore-users | 2.0.0 | | |
| fof-html-errors | 2.0.0-beta.1 | | |
| fof-geoip | 2.0.2 | | |
| fof-frontpage | 2.0.0-beta.1 | | |
| fof-forum-statistics-widget | 2.0.0 | | |
| fof-formatting | 2.0.0 | | |
| fof-first-post-approval | 2.0.0 | | |
| fof-filter | 2.0.0-beta.1 | | |
| fof-drafts | 2.0.2 | | |
| fof-doorman | 3.0.1 | | |
| fof-disposable-emails | 2.0.0-beta.1 | | |
| fof-discussion-templates | 2.0.0 | | |
| fof-direct-links | 2.0.0 | | |
| fof-clockwork | 2.0.0 | | |
| fof-bbcode-tabs | 2.0.0 | | |
| fof-bbcode-details | 2.0.0-beta.1 | | |
| fof-badges | 2.0.0 | | |
| fof-anti-spam | 2.0.1 | | |
| fof-analytics | 2.0.1 | | |
| flarum-sticky | v2.0.2 | | |
| flarum-nicknames | v2.0.1 | | |
| flarum-likes | v2.0.2 | | |
| flarum-lang-spanish | 2.0.2 | | |
| flarum-lang-english | v2.0.0 | | |
| flarum-extension-manager | v2.0.1 | | |
| flarum-emoji | v2.0.1 | | |
| flarum-bbcode | v2.0.1 | | |
| ekumanov-markdown-tables | v1.0.4 | | |
| datlechin-link-preview | v2.2.0 | | |
| acpl-mobile-tab | 2.0.2 | | |
+-------------------------------+---------------+--------+-------+
Base URL: https://www.queerbooks.space
Installation path: /home/xzgtpvu/forum
Queue driver: sync
Session driver: file
Scheduler status: Active
Mail driver: mailgun
Debug mode: off