RedBox BBCode
One box. Every mod. Forever.
Right now, every mod on your forum that needs to say "something's wrong" either builds its own ad-hoc error markup, or doesn't bother and lets PHP fatal ugly. Tonight alone you watched that play out twice — a duplicated iframe block from a copy-pasted patch, and a "Class not found" that took a whole page down with zero visible explanation. Both were the same root problem: no single, dependable way to say "here's an error" that every mod could just reach for.
RedBox fixes that permanently, and cheaply:
- Zero install cost for what it protects. Six files, no dependencies, no CSS to break, no theme to patch. It either sits there quietly or it saves you from a dead page — never a liability either way.
- Two lines, anywhere.
if (!class_exists('RedBoxBBCode')) require_once($sourcedir . '/RedBoxBBC.php'); echo RedBoxBBCode::render('Something went wrong.');
Works inside a mod's PHP, a template, an install script, a future thing neither of us has thought of yet.
- Already proven, not theoretical. LMV uses it right now as its own fallback for caught exceptions. It's not a nice idea sitting on a shelf — it's load-bearing in production-bound code tonight.
- Human-facing too. The same visual identity is available to anyone typing
[redbox]...[/redbox] in a post — moderators flagging a locked thread, a warning banner, whatever — so the styling is consistent whether the box comes from your code or from a person's fingers. - It compounds. Every mod you build after this one gets to skip reinventing error display. That's not a one-time win, that's a standing discount on every future project.
Honest caveat: same as everything tonight — it hasn't run against a live PHP interpreter from my side. It's reasoned-through, brace-checked, and now matches SMF's actual documented tag conventions instead of a guess, but "install it and see" is still the real test.