PHP 7 by hcs at 11:25 PM EDT on August 18, 2020
I've switched the server over to PHP 7.4 (from 5.6), made what changes seemed to be necessary to silence deprecation warnings, seems to have been pretty painless, but let me know if there are any issues.

Testing edit.

edited 11:48 PM EDT August 18, 2020
by Lunar at 3:41 AM EDT on August 23, 2020
The only issue I'd like to mention is that I use the Dark Background and Light Text Firefox extension, and I think due to the recent PHP upgrade it no longer works on hcs64. Any idea why this might be? Or, would it be easy enough to add a dark theme option to the forum?
by hcs at 11:15 PM EDT on August 23, 2020
Yeah that's really weird, I didn't make any change to the stylesheets, and I tried running the old code and it still doesn't work with that extension, though it's still running on PHP 7.

Are you sure it had worked recently before this change, which I made just before I posted that message? All I can think of is the headers might have changed somehow, but given that the effect works on the old guestbook it doesn't seem like that could be it.

Hmm, if I remove the content security policy it seems to work. But that was added last year, so if you had seen this working recently that wouldn't have been the reason for a change. It's very restrictive, but I don't know how to loosen it up for a web extension like that.

[edit]

It's not great, but I've added a dark mode that activates with prefers-color-scheme: dark, hopefully that will be useful as most browsers support that now.

edited 12:14 AM EDT August 24, 2020
by Lunar at 4:08 AM EDT on August 24, 2020
I'm not sure how recently the extension stopped working, but I visit this forum semi-regularly and I only noticed it a few days ago. It seemed most likely to be associated with the PHP upgrade, but I also wouldn't have any real clue as to why.

Anyway, it's water under a bridge, this solution works great for me, thank you hcs!
by ohdeer at 8:29 PM EDT on September 26, 2020
I noticed the exact same thing with Dark Background and Light Text and was wondering why until I randomly stumbled upon this thread.

According to the browser console, it's due to the CSP of the server:

Content Security Policy: The page’s settings blocked the loading of a resource (“style-src”).

Update: looks like hcs already mentioned the CSP. If your system uses light mode, but you want dark mode, Firefox can force the site's dark mode with this extension.

edited 8:38 PM EDT September 26, 2020
by hcs at 9:34 PM EDT on September 26, 2020
Also on Firefox, no need for an add-on if you're comfortable changing prefs in about:config, set ui.systemUsesDarkTheme to 1, that will force prefers-color-scheme to dark.

edited 9:34 PM EDT September 26, 2020
by maxton at 4:18 PM EST on November 16, 2020
I'm a big fan of the dark-mode-aware CSS! I never noticed that sample Mega Man screenshot had a gray background until now 😆


Go to Page 0

Search this thread

Show all threads

Reply to this thread:

User Name Tags:

bold: [b]bold[/b]
italics: [i]italics[/i]
emphasis: [em]emphasis[/em]
underline: [u]underline[/u]
small: [small]small[/small]
Link: [url=http://www.google.com]Link[/url]

[img=https://www.hcs64.com/images/mm1.png]
Password
Subject
Message

HCS Forum Index
Halley's Comet Software
forum source