Due to the fact my web host was slow adopting PHP5, and I had to use old junk, I originaly developed a simple, YAML-based comment script in Ruby for my furry stuff site and Avarthrel site. Then, I decided to reimplement part of it in PHP, to integrate better with my Smarty-based site. I don’t particularly care about PHP, but it seems to be a language that the webhost supports very best, so here it is…

And now, thanks to the fact that the webhost supports PHP5 (and Spyc, the PHP YAML library, seems to be both very buggy and stalled in its tracks), I’ve reimplemented the comment script completely in PHP, this time using SQLite as the comment storage backend. What does this mean? Well, it means… uh… well, the site is less ugly on the code side. Basically, originally, my story publication cycle was as follows:

<ol><li>Create Smarty and PDF versions of the story. (story.sdoc, story.pdf)
</li><li>Copy over a .phtml file and edit it to show the Smarty document. (story.phtml)</li><li>Copy over a comment posting script and edit it. (story-comment.cgi)</li><li>Call the script - this will create the YAML storage for the comments and static HTML comment snippet. These will be updated when comments are posted. (cottler/story.yml, cottler/story.html)
</li></ol> Then, the publication cycle was as follows, after I half-PHP’d it:

  1. Create Smarty and PDF versions of the story. (story.sdoc, story.pdf)
  2. Copy over a .phtml file and edit it to show the Smarty document. (story.phtml)
  3. Copy over a comment posting script and edit it. (story-comment.cgi)
  4. Call the script. The YAML file will be used to store the comments, and Smarty will automagically display the contents of this file in HTML form when document is read. (cottler/story.yml)

Now, it is…

  1. Create Smarty and PDF versions of the story. (story.sdoc, story.pdf)
  2. Copy over a .phtml file and edit it to show the Smarty document. (story.phtml)
  3. Add an entry for this particular in the database. One PHP script is used to post comments. Comments will be taken from the database when the page is read.

Much simpler. =)

Another addition to the site is on the front page. I have long used SimplePie for showing news at various parts of my website. Now I simply grab the latest headlines from this blog’s Atom feed and put them on the Avarthrel front page. The site just keeps getting more interesting… =)