Recent Comments in Drupal
I've started testing a new version of this website. One of the testers commented on the Recent Comments block.
Unlike the current site's Recent Comments block (for PHP Nuke), the new site didn't display the author of each comment in the list with recent comments. I didn't like that either so I fixed it.
Tonight I've also made this change available to other users of Drupal with a patch. The source code of Drupal is much, much nicer than the PHP Nuke's code and I'm glad I'm finally making the move to a modern system.
Download the patch for Drupal 5.1 to add comment author names to the recent comments block.
Examples:
Option 1: no comment authors (default).
Option 2: with comment authors.
Installation
To install this patch download the text file and save it as 51comments.patch on your server. This patch has been tested with Drupal 5.1.
cd /var/www/htdocs/(yoursite)
cd drupal
patch modules/comment/comment.module 51comments.patch
Result will look like:
Hmm... Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|--- /home/guus/drupal-5.1/modules/comment/comment.module Mon Jan 29 22:51:53 2007
|+++ /var/www/htdocs/testguusbosmannl/modules/comment/comment.module Fri Mar 2 20:59:19 2007
--------------------------
Patching file modules/comment/comment.module using Plan A...
Hunk #1 succeeded at 51.
Hunk #2 succeeded at 252.
Hunk #3 succeeded at 270.
Hunk #4 succeeded at 292.
Hunk #5 succeeded at 520.
Hunk #6 succeeded at 1908.
done
- Log in to post comments
Comments
Anonymous instead of name
Thanks for this code. One problem however with mine is that if the author of the comment isn't a member of the site, but has entered their name on their own, then the block displays "Anonymous."