2004.01.28

Adding Dates to Comments

Fletcher, as I read on Jason’s site, has done some minor hacking to the original writeback plugin so we can add a date field in the comments and so email addresses are encoded to be human readable but almost impossible for spam email harvesters. Here’s how I added it to sp.ookee.com.
First of all, download Fletcher’s version of the writeback plugin. Put it in your plugin directory, renaming it if your previous version was renamed (mine is 9999writeback).

Determine the format you want the date to be portrayed. I wanted mine to imitate the date format I already use (year.month.day). Goto this portion of the code within the writeback plugin.

$p = "$mon/$mday/$year $hour:$min:$sec";

This will render something like “01/21/2004 19:25:32″. I changed this to:

$p = "$year.$mon.$mday @ $hour:$min:$sec (PST)";

Next you need to add a variable to your flavour templates, specifically to where your writeback comments are brought in. This variable is $writeback::date.

That should be it! If you have any questions, leave a comment below; I’ll even know when you left it!

4 Comments Categorized: geek

You can follow responses with a RSS 2.0 feed or via email using the checkbox below. Both comments and pings are currently closed.

 

4 Responses to “Adding Dates to Comments”

  1. dugh says  (January 1st, 1970 at 08:00:00 )

    warning…
    it appears that this version of the plugin (as of 2004.01.21) kills any embedded html in comments. hmmm. will have to see about that… when that changes i’ll add a comment here.

  2. dugh says  (January 1st, 1970 at 08:00:00 )

    test… please ignore
    OOKEE.com

  3. dugh says  (January 1st, 1970 at 08:00:00 )

    LINKS FIXED
    as per the “test… please ignore” posted comment just before this one, the links are fixed. here is what to do.

    there is a line in fletcher’s version of the writeback plugin that has this: “$p =~ s/$lt;(?!(\/?(p|br)\/?))/cheers!

  4. dugh says  (January 1st, 1970 at 08:00:00 )

    fletcher has added even more functionality to the writeback plugin, incorporating a few of his other plugins. i will have to install it and see how it goes. my understanding, however, is that the HTML “issue” is still present, and so commenting out the line specified in the previous comment is still valid. alternatively in that same line you can add tags. currently the tags are

    and
    , denoted in the (p|br) bit. you can add tags like by changing this bit to (p|br|i).