Tech - September 2006 Archives

Minor Commentable Updates, Blog

I wanted to apprise you of a few updates to the Comments behaviors.

  • Revision 15:
    • Turned all create! calls into create, so posting a comment should fail more quietly.
    • Added a modifier to r:comments:count that requires comments to be published to be included in the count
  • Revision 16:
    • Removed CGI.escape_html in favor of global string substitutions that convert angle-brackets to their corresponding character entities.

Comments 0.1.3 and Updates

First of all, I want to give a BIG Thank You to the Radiant community. You guys are awesome!

And now some personal thanks go to :
  • J. Coppedge – for finding my typographical error resulting in an unclosed tag.
  • J. Van Stonecypher – for contributing Akismet code adapted from Typo that I was able to integrate easily, with only a few modifications.

Which brings me to my next item of business. I have tagged/frozen revision 6 (which includes the typographical fix) into tags/comments_behaviors-0.1.3. Upcoming HEAD revisions will technically be incompatible with those previous because I have added Van’s Akismet code. Why 0.1.3, you ask? Because I can!

Comments bugfixes, updates

Couple of notes from today about the Commentable/CommentBucket behaviors.

  • The code was moved to Subversion. You may get it in all the usual ways, including svn co and script/plugin install.
  • Make sure you have the latest from SVN. I went through a couple of iterations today that were just borked, including ones that screwed things up royally. I’m not sure what broke the r:parent tag plugin that I had installed, but it quit working. Be forewarned that it could get ugly. The bugfixes and updates include:
    • Problems with the status field in the config part—now you must specify an integer or the default is “Draft” (1). Maybe in the future I’ll allow text for this field, but it was getting messy trying to futz around with type conversion.
    • The local var comments in Commentable.process was potentially uninitialized. I fixed this although it was highly unlikely that the offending referent code would be reached in a state where comments was not initialized.
    • Because Radiant already includes title and date for tags pages, I thought I’d make use of them instead of re-implementing them. What this means is that those fields do not come auto-wrapped in a span.
  • Nolan commented that CAPTCHA is not kind to blind users and some other algorithm, i.e. spam filtering, should be used instead. PDI The interim solution, of course, is to set the default status to “Draft” or 1 in the config part. However, until spam becomes a major problem on my site, I’m leaving it wide open. I reserve the right to remove any comments that are clearly spam.

Return of the Comments

A long, long time ago in a galaxy far, far away...

COMMENTS WARS

In all seriousness, this post is to officially announce my Luke and Leia, Commentable and CommentBucket, the behaviors that drive my implementation of user-submitted comments for RadiantCMS. As a teaser, here's how I made it look on my testing platform, which is the "Styled Blog" that comes with Radiant.