Shop Archives Downloads Contact Videos Subscribe Music

Author comment styling for Brian’s threaded comments

If you like what you find here, you may like to subscribe to my RSS feed. Rock on!

The Brian’s threaded comments plugin for Wordpress rocks because it makes it easier to keep track who’s saying what to whom in the comments section. This is useful if your blog has a very active comment section. The only bummer is that it provides no option to highlight the blog author’s own comments. With some help I’ve found a workaround so you can easily add author highlighting to Brian’s threaded comments.

pimp your commentsInstructions

You need to edit two files:

  1. the comments.php that comes with the Brian’s threaded comments plugin (it’s the one you use instead of your theme’s comments.php), and
  2. briansthreadedcomments.php

First decide what to call your author highlighting class. I’ll use authorcomment in the example.

Open briansthreadedcomments.php in a text editor and add your special class definition after the last .comment definition (around line 338). For example;

.authorcomment {border:1px solid #FFCCFF; background: #fff url('/author_comment_styling_for_brians_threaded_comments/path_to/pimp_my_comments.jpg') top right no-repeat;}

Then in comments.php, you need to add a snippet of code:

Scroll down to about line 53, find this part:
<div id="div-comment-<?php echo $c->comment_ID ?>" class='comment<?php echo $odd?>'>

Add the new part in red:
<div id="div-comment-<?php echo $c->comment_ID ?>" class='comment<?php echo $odd?><?php if($c->user_id == 'your user id') echo ' authorcomment';?>">

Replace ‘your user id’ with your actual Wordpress user id number.

Also note that there must be a space between the single quote
and the class name: ‘ authorcomment’ .

Then upload the two files and you should be done. You can see this hack in action in the comments below.

If you’re using Brian’s threaded comments, I hope you’ll find this useful :)

Thanks to my brother and my boyfriend (two different people, duh!) who helped me with this.

Popularity: 6% [?]

RSS feed

8 Comments

+ Comment by Kristof
2007-07-17 10:01:00

Hmmm, interesting. I might actually do this. I was already baffled by your PLAG comments with the PLAG icon on it but this is sweet!

And it’s a good thing you pointed out that your brother and your b/f are different people. We might have people from Texas checking this blog!

I think I’ll have to run now …

+ Comment by Lorinator
2007-07-17 12:33:43

Kristof: I only had to point it out because it was too late for me to craft an unambiguous sentence!

BTW, if you’re curious, the comments plugins I use here are Brian’s Threaded Comments and WP-grins.

 
 
+ Comment by Robert Irizarry
2007-07-18 04:37:13

Very cool, hack for Brian’s Threaded Comments! I’ll have to try it out over at my own guitar blog!

 
+ Comment by Kristof
2007-07-18 08:18:23

I miss the “recent comments” widget :(

+ Comment by Robert Irizarry
2007-07-18 11:44:05

I’m a big fan of the Recent Comments plugin and run this as well. I think its a great feature for readers and I find it a useful quick reference to activity as well.

Lori – I’m curious to hear why it didn’t make the cut – all the while understanding that you can’t have everything. :wink:

BTW – Another cool comments related plugin I’m looking at is Edit Comments XT which let’s a reader edit his or her own comments. Although there isn’t a tremendous amount of this, I enjoy the opportunity to enhance the reader’s experience and provide them with a degree of autonomy over their own statements. However, unlike a forum where you can go back and re-invent history by changing your statements at any time, the plugin has a default timer of 30 minutes within which you can make a change.

+ Comment by Lorinator
2007-07-18 12:00:52

One step at a time, my little chickadees…one step at a time! :wink: I should have the recent comments up later today. And an edit comments function is on my list as well.

[Edit: OK, recent comments are back on the main page]

[Edit 2: Looking into Edit comments XT. Looks good, but

"I don’t have the time to support you on the implementation and usage of this plugin. Also the comments at this page have been turned off for this reason. However a donation may help to change my mind and support you anyway :) "

Meh x 10^100 (that's a googol of mehs, haha)

Users can help each other in one's comments section without taking up one's own precious time.]

 
 
 
+ Comment by Nspeaks
2007-08-06 17:31:01

Can somebody tell how to show the text that your comment is in moderation with brian’s threaded comments? Seems developer missed this thing too in 1.5.12 version.

+ Comment by Lorinator
2007-08-06 17:34:21

Ooh, good question. I don’t have the answer (yet), but will look into it. If it’s not too difficult, I’ll fix it myself.

 
 

Sorry, the comment form is closed at this time.