dopetalk does not endorse any advertised product nor does it accept any liability for it's use or misuse


Our Discord Notification Server invitation link is https://discord.gg/jB2qmRrxyD

Author Topic: Redbox BBCode  (Read 45 times)

Online Chip (OP)

  • Server Admin
  • Hero Member
  • *****
  • Administrator
  • *****
  • Join Date: Dec 2014
  • Location: Australia
  • Posts: 7305
  • Reputation Power: 0
  • Chip has hidden their reputation power
  • Gender: Male
  • Last Login:Today at 05:09:07 PM
  • Deeply Confused Learner
  • Profession: IT Engineer now retired
Redbox BBCode
« on: Yesterday at 09:20:46 AM »

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.


⚠️

DYNAMIC HTML RED BOX IN ACTION


« Last Edit: Yesterday at 10:32:26 PM by Chip »
friendly
0
funny
0
informative
0
agree
0
disagree
0
like
0
dislike
0
No reactions
No reactions
No reactions
No reactions
No reactions
No reactions
No reactions
Our Discord Server invitation link is https://discord.gg/jB2qmRrxyD

Tags:
 


dopetalk does not endorse any advertised product nor does it accept any liability for it's use or misuse





TERMS AND CONDITIONS

In no event will d&u or any person involved in creating, producing, or distributing site information be liable for any direct, indirect, incidental, punitive, special or consequential damages arising out of the use of or inability to use d&u. You agree to indemnify and hold harmless d&u, its domain founders, sponsors, maintainers, server administrators, volunteers and contributors from and against all liability, claims, damages, costs and expenses, including legal fees, that arise directly or indirectly from the use of any part of the d&u site.


TO USE THIS WEBSITE YOU MUST AGREE TO THE TERMS AND CONDITIONS ABOVE


Founded December 2014
SimplePortal 2.3.6 © 2008-2014, SimplePortal