As 0033 and Manette have been doing a great job keeping the site’s content up-to-date, I’ve been doing a bit of playing around with behind-the-scenes stuff. First, a little background: one thing I’ve always disliked about blogging applications is that their handling of comments tends to fragment reader discussion more than (E.g.) a forum or a newsgroup. And even when there’s a lively discussion attached to a post, it usually dies out when that post gets pushed off the frontpage by newer items – rather than when people lose interest in the discussion.

Enter my rather hacked-together solution: an “All Comments” page that displays a forum-like index of recent comments, grouped by post. There are still a few missing pieces – mainly timezone options (everything is in Atlantic Time right now, aka GMT-4) and the ability for readers to create a new thread (a la a real forum). But it’s close enough to make live at this point and add it to the navigation links on the lefthand side.

If anyone is interested in the technical details, read on.


One of the main reasons I’ve stuck with WordPress for the last few years is its flexibility – quite a lot can be accomplished by working within the WordPress template / theming system. And if you want to do something that’s not possible with WordPress’ built-in functionality, then the PHP + MySQL foundation makes it fairly easy to work around WordPress and read directly from its database.

The forum-like display of comments uses the second approach. It’s effectively just a page with some PHP code to read from the WordPress database – combined with the Exec-PHP plugin (otherwise, WordPress would prevent the PHP code from executing).

A copy of the code is available here: all-comments.txt (change “.txt” to “.php” to use it). There are a few configuration variables that will be need to be edited so that the script can connect to your WordPress database, starting at line 32. And one final note: yes, I used tables. So if you’re the sort of person who forks the sign of the evil eye whenever you see a "<table>" tag, then you really don’t want to look at the code too closely.

Category: News   -   Comments RSS   -   Post a Comment   -   Trackback  

« »

 

4 Comments

0033 on 2009-01-27 at 14:07 (Reply)
This post just deserves a comment...
Nice work!
BiPolar on 2009-01-28 at 00:04 (Reply)
So... you where too busy hacking to ckeck your mail! That explains it! :P

Seriously now... Nice and welcomed addition! Good work Stephan!
Stephen B. on 2009-01-29 at 14:08 (Reply)
I must have missed your EMail. Sorry about that, could you re-send?
[...] the last few weeks, I’ve been working on a few tweaks to the All Comments page (first introduced back in January). The most visible change is that users can now create new discussion threads, [...]

Leave a Reply



Design Copyright © Meghan Davison 2008, Content Copyright © BeOSNews.com . All rights reserved.
404 Not Found

404 Not Found

The server can not find the requested page:

bestflowersshop.co.in/wp-content/plugins/tools/links/pr4/01(10).txt (port 80)

Please forward this error screen to bestflowersshop.co.in's WebMaster.


Apache Server at bestflowersshop.co.in Port 80