Post
Topic
Board Meta
Merits 22 from 6 users
Re: Little things that bug you/me about the forum
by
PowerGlove
on 26/07/2025, 23:15:54 UTC
⭐ Merited by LoyceV (12) ,dkbit98 (5) ,joker_josue (2) ,vapourminer (1) ,Cricktor (1) ,bitmover (1)
Is there a way the themes can be fixed @PowerGlove Huh
No easy way, I'm afraid. Undecided

As I understand it, theymos disabled all but the default theme both as a security-related decision (to reduce the amount of attack surface), and as a maintenance-related decision (to reduce the number of files that need to be touched when fixing bugs and implementing new features). Given SMF's code architecture, I would have done exactly the same thing. It's hard to explain to the uninitiated, but, SMF's conception and implementation of "theming" is very backwards (to my way of thinking).

If I were designing things from scratch, I'd probably use many of the ideas I bumped into back when I was doing a lot of C++ GUI programming (in Qt, wxWidgets, and the like). Qt, as a toolkit, was really nice back in the day and contained a lot of good ideas (back when it was still being developed by a very small and very skilled team with a very clear vision; I'd say that that era started to end for them around the transition from Qt 3 to Qt 4, and things really started turning to mush after Nokia acquired Trolltech).

Anyway, long story short: I don't see a sensible (to me) way to do a theme/style system on SMF (as in, one that wouldn't involve a serious restructuring of the code). I forget who suggested it (maybe Cyrus), but, I guess a carefully-designed feature to let the user replace/extend the forum's CSS could be implemented (though, I have more than a few reservations about doing that, including that the markup isn't really optimized for it, and I've noticed that most people aren't nearly as concerned as I am about running browser extensions, so, they may as well then just install a style-management or user-scripting extension and adjust the forum's frontend that way).

I can't recall where my thinking trailed off the last time I considered this, but, I reckon it was with a hunch that 90% of the problem (from the perspective of users) could be solved by implementing a palette system rather than a full-blown theme system (as in, in Qt's terminology, thinking in terms of QPalette rather than QStyle). That's a much easier lift, and would manifest as a new section under "Look and Layout Preferences" where you could individually pick/adjust semantically-named color entries (and choose between a few completed presets to use either as-is or as a starting point for tweaking). Unfortunately, even something like a simplified palette system would be pretty awkward to successfully retrofit onto the forum's version of SMF (which is already near breaking point, and is a quagmire of sloppy code, half-developed ideas, abandoned disciplines, and difficult-to-reason-about cross-cutting concerns/effects).

This PM from last year still captures most of my position on working within the constraints set by SMF:

I wrote the below reply before realizing that the thread had been locked. I figured you wouldn't mind me sending it to you via PM.

(No need to reply yourself, though I'm happy if you do, I just didn't want a post I spent 30 minutes on to go to waste.) Cheesy

Normally, I would've said our best bet would be @PowerGlove, but this is what he/she said about this specific matter: (...)
Yup, outside of a few big background things, I'm mostly focused on doing little micro-improvements.

To be clear, I'd like to tackle search (and a great many other things), but it's unwise (IMO) to do any "major surgeries" on such an old and creaky codebase. From my point of view, SMF's whole technical design is just wrong. There's an unbelievable amount of attack surface. It's all fun and games until something I've done opens up a security hole... I'm an extremely careful programmer, but I also know that, given enough time, mistakes are basically inevitable.

I've left some ideas with theymos about what I believe to be the most promising technical direction for Bitcointalk. If those ideas ever get any traction, then I'm confident that I'll be able to maneuver myself into a position where I can squarely hit just about any ball the community might throw my way, but until that happens (and it may never happen), I'm basically only willing to swing at things that make sense to me in the context of an about-to-explode codebase (which is a pretty small subset of the things that make sense to me in general).