(I tried to submit this as an issue -- feature request -- but now seem not to have the ability to post new issues.)

In doing the 4.6.3 update, I lost a little hack I did on the comments.module so that the "author" information is added to the recent comments block. I always felt that the block was rather mysterious about the recent comments, what with not saying who actually made the comments. Anyway, I went ahead and re-did the little hack on the comments module from the 4.6.3 tarball. Here are the particulars:

Starting at line 170, remove:

      $items[] = l($comment->subject, 'node/'. $comment->nid, NULL, NULL, 'comment-'. $comment->cid) .'<br />'. t('%time ago', array('%time' => format_interval(time() - $comment->timestamp)));

and replace it with this:

// added hack to add commenter's name to the 'recent comments' block
      $result2 = db_query('SELECT name FROM {comments} WHERE cid='.$comment->cid);
$comment_user = db_fetch_object($result2);

$items[] = l($comment->subject . '', 'node/'. $comment->nid, NULL, NULL, 'comment-'. $comment->cid) .' by '. $comment_user->name . '<br />'. t('%time ago', array('%time' => format_interval(time() - $comment->timestamp)));

This will add the commenter's name as entered in the comment into the "recent comments" block.

I hope this can be incorporated into the core distribution. It seems rather unhelpful to leave out this information in the recent comments module. I'd submit this as a custom block, but I'm not adept enough at the Drupal code to manage that. For fellow php-challenged site admins, I've uploaded the patched comment.module for 4.6.3 here. Caveat emptor.

Laura
pingVision

Comments

PatHMV’s picture

Have you tried this in 4.7? I've just tried it, but it's not returning the name of the comment poster. I don't yet know enough about the database schema to fix it myself.

laura s’s picture

You might look at the views module. I know it has not supported views of comments info, beyond counts, but it's planned, if not implemented by now.

Laura
_____ ____ ___ __ _ _
design, snap, blog

_____ ____ ___ __ _ _
Laura Scott :: design » blog » tweet

rickvug’s picture

Has anyone done this yet? I'd love to use views for things like this.

-------------------------------------------------------------------
Rick Vugteveen | Image X Media (work) | Blog (personal)

-------------------------------------------------------------------
Rick Vugteveen |rickvug.com @rickvug on Twitter

yngens’s picture

subscribe

guusbosman’s picture

I needed this functionality for my personal website and I've created a patch for Drupal 5.1 that displays the Author name in the Recent Comments block. This is configurable by the site administrator -- you can also keep the old Recent Comments style if you like.

I'm migrating from PHP Nuke to Drupal and want to keep the look & feel of my site as similar as possible. Writing my first patch for Drupal confirmed me in my choice -- I really like the way Drupal is written.

Here is the Issue that contains my patch: http://drupal.org/node/124299. If you want to see some screenshots have a look here: http://www.guusbosman.nl/article/1729