Guilty by Association, Charged With an Array of Punishments

Even with my widget, I seem to miss the mark sometime in posting to gruedorf in a timely fashion. I’ll need to make a version 3 of it where it starts ringing annoyingly when alerted people get under 24 hours to go.

Even though I may be late in posting, I am not late in doing. Over the last week I’ve committed 20 new revisions to the repository. Go me.

This weeks changes bring us thread stickiness, thread deletion/undeletion, and message deletion/undeletion, all with lovely YUI dialogs for the administrator.

I also created moderson, who is like testerson but is only a moderator and not a god-like admin. peon remains sad and lonely.

I was planning on closing out the last of the forum stuff today, but I thought it’d be a good idea to move over to bbcode instead of using filtered html, for various reasons. This quickly became a thorn in my ass.

The way that the old code works on query-fetching is to have a query like:

SELECT message.*, user.username FROM ...

And then it’d unpack the results from the query like this:

list( $a, $b, $c, $d, $e, $f, $g, $h, $i, $j, $k, $l, $m, $o )
= mysql_fetch_row( $result );

$this->_id = $a;
$this->_message_board_fk = $b;
$this->_parent_fk = $c;
/// ...and so on

This served my younger, more innocent 2003-self just fine. However, my older, wiser, more curmudgeonly current iteration is bound slightly by the whippersnapper’s naive choices. For one, the moment I add a field to the `message` table (like, say, a ‘version’ field to switch upon different rendering techniques), that field’s value suddenly becomes what used to be `user.username` prior to the change. Which is… inconvenient, at the best.

Then I had the task of finding a BBCode parser. After vetting a few (one of which had bbcode smileys BASE 64 ENCODED WITHIN THE PHP FILE), I went with the PEAR one, which still needed a bit of grooming and prodding to get to work in my multi-platform, non-PATH-munging world.

After several (annoying) hours, I now have a working bbcode parser working in my CakePHP project, safe, snug, and committed as of r182. Hooray!

Also read...


Leave a Reply

Your email address will not be published. Required fields are marked *