My favorites | Sign in
Project Logo
Project hosting will be READ-ONLY Wednesday at 8am PST due to brief network maintenance.
                
Search
for
Updated Feb 04 (5 days ago) by janpolsen
Labels: Featured, Phase-Deploy
Installation  
Installation and upgrading guide

There isn't any difference between installing this plugin for the first time and upgrading the plugin.

  • Download the latest release here
  • Save that file as comment_highlighter.php in your plugin-directory
  • Activate the plugin called Comment Highlighter in your admin section under Plugins
  • Start adding some "rules"
  • Add the following line to wherever you define the class of your comment:
  • <?php if(function_exists('CommentHighlight')) CommentHighlight(); ?>
If you use the "Connection" theme, then this line is located in the comments.php file and can look something like this:
<li class="<?php if(function_exists('CommentHighlight')) CommentHighlight(); ?>" id="comment-<?php comment_ID() ?>">
  • You might also want to add the following line to your comment header:
  • <?php if(function_exists('CommentHighlight')) CommentHighlight('link'); ?>
This will make a link in you comment header which links directly to the admin interface of the plugin. The email, name, URL, comment and post ID will be pre-filled this way and you can just tag which options you want to use.
The link will of course only be visible for the admins of the blog and not to normal readers.
  • From v0.10 it is possible to add a prefix and/or postfix which will be added to the class(es) for matching rules. You can assign that prefix/postfix like:
  • <?php if(function_exists('CommentHighlight')) CommentHighlight('class', array('prefix' => 'pre_', 'postfix' => '_post')); ?>

Comment by ivane1984, Sep 11, 2007

Hi~ I used the Comment Highlighter plugin, but I found it doesn't work in my wordpress, I could not find the reason why Comment Highlighter plugin can't work,so I leave the message ,I hope you can help me for solve the problem.

<?php if(function_exists('CommentHighlight?')) CommentHighlight?('link'); ?>

Is the 'link' the same like class style? For example:

<li class="<?php if(function_exists('CommentHighlight')) CommentHighlight('link'); ?>">Comment</li>

=

<li class="link">Comment</li>

Is it like this??

I'm so sorry because my English so poor, I am waitting for your reply, and thank you so much for you and your great wordpress plugin-Comment Highlighter.

My E-mail and gtalk: ivane1984@gmail.com

Comment by janpolsen, Sep 11, 2007

It is not the same. The example above with the 'link' in it, is just to place a link to the CommentHighlighter? admin options on each comment.

That link is only visible to admin and can't be seen by guest reading your blog.

Comment by hismuse, Oct 05, 2007

I've installed mine but I'm not entirely sure how to use it and how to specifically make my comments (the admin) with a different color background, there needs to be more examples in the tutorial.

Comment by janpolsen, Oct 05, 2007

Have you checked the examples?

If you have, can you then elaborate on what you want to know more about?

Comment by zmanalpha, Nov 08, 2007

Hi - nice looking plug. I have added lines for admincomment to CSS and the two php lines to comment.php. Running "Navigation" theme and not able to get it to highlight my comments. Any advice? Thanks.

Comment by janpolsen, Nov 09, 2007

It shouldn't matter what theme you use, as long as the PHP-code is added the right place and the class defined in the config is added to the style sheet (usually), then everything should work.

Comment by dorotheerey, Nov 23, 2007

Hi. Could you please explain exactly where the php line should be added ? I have a file comment.php but do not know where exactly the line should be added in this file. When you say "where you define the class of your comment" it does not alway mean something for amateurs like me. Especially not native english speakers ;) Thanks ! The plugin is great.

Comment by janpolsen, Nov 24, 2007

I just wrapped up a thorough explanation I hope will help you. You can see it in the FAQ section. Feel free to get back to me if there are something you don't understand :)

Comment by dorotheerey, Nov 24, 2007

Thanks a lot, it did help especially since I have the default theme. I did as you explained and followed the example to highlight my own comments but it does not work. See what could be the problem ? My blog is http://www.lautreatelier.fr/blog/ Or will it work only with future comments ?

Comment by janpolsen, Nov 24, 2007

It should work with both old and new comments, so that is not the problem. I can't see any class names being added to the code, so my guess is, that it doesn't "catch" any of the rules you have set up.

I am looking at http://www.lautreatelier.fr/blog/2007/11/chocolat-plein-les-doigts-1/#comment-918, which I assume is one of the comments that should be highlighted, right?

How have you made the rule in the Comment Highlighter option page? If you have used an email address are you then sure, that it is the same email address you have used on the comment?

Comment by dorotheerey, Nov 24, 2007

The class I have created is admincomment and I inserted in the css the following: .commentlist .admincomment {

background-color: #fae7f8; }
For the criteria I chose the email and name and it is the same than the comment you indicated.

Comment by janpolsen, Nov 24, 2007

... have you also checked the "Global" box?

Comment by dorotheerey, Nov 25, 2007

yes the global box was checked.

Comment by janpolsen, Nov 26, 2007

I can't point out what the problem is then :(.

I will implement a debugging feature in the next version. Then I should be able to what the problem is.

You can however try to create another rule, where you use your name instead of the email and see if that works.

Comment by SquirrelSlax, Jul 13, 2008

Hey, I would love to use this plug-in, but for the life of me can not figure out where to input the <?php if(function_exists('CommentHighlight')) CommentHighlight(); ?>

I'm using the Fauna Theme http://www.noscope.com/fauna/ It has a different php file for the comment handling

Any help please?

Comment by janpolsen, Jul 14, 2008

Without having tested it, then it looks like you have to add the line <?php if(function_exists('CommentHighlight')) CommentHighlight('link'); ?> to the file fauna/templates/template-comments.php instead of the "normal" comments.php.

Comment by TheGeek.101, Jul 15, 2008
I've tried adding the line to multiple spots in the template-comments.php file... not seems to get it to work.

Guess I'll just have to not use the plugin unfortunately

Comment by janpolsen, Jul 15, 2008

There will be a matter of design, because of the way "Fauna" uses small icons at the right of the comment field, but adding the following line: <?php if(function_exists('CommentHighlight')) CommentHighlight('link'); ?> to line 62 WILL give you that extra link.

Right before the line containing: <?php if ($comment->comment_approved == '0') : ?>

Well, just about anywhere inside the <div class="comment-header">...</div> should do it.

Comment by janpolsen, Jul 15, 2008

We are by the way still talking about the file fauna/templates/template-comments.php, so if you don't see any changes after having added that line, then it might be something about you caching the pages?

Comment by TheGeek.101, Jul 16, 2008

Still didn't work, Cleared Cash. Its outputting the "Class" field as text. I just wanted it to highlight comments by set author names... Not add a link to highlight.

Comment by janpolsen, Jul 16, 2008

I totally misunderstood you then :(.

In order to get the right class added the right place, then add the following line

<?php if(function_exists('CommentHighlight')) CommentHighlight(); ?>

to the file template-comments.php at line 34 which looks like:

<li id="comment-<?php comment_ID() ?>" class="<?php if ($is_author == true) { echo $author; } else { echo $bgcolor; }?>">

The resulting line should look like:

<li id="comment-<?php comment_ID() ?>" class="<?php if(function_exists('CommentHighlight')) CommentHighlight(); ?>">

There are quite some lines in the file, which can be deleted (those dealing with the $even, $odd, $author and $bgcolor variables), but for simplicity I wont write furhter about that here :).

Comment by elgekonegro, Aug 02, 2008

Hi. I've using the plugin for months but I tried to upgrade it and it's impossible to me making it works. I've this problem trying to activate it: Fatal error: Call to undefined function: file_put_contents() in /home/username/public_html/web/wp-content/plugins/comment_highlighter.php on line 33 I'm using the V_10 plugin version, the newest I've seen, with WordPrees?? 2.6.

Comment by janpolsen, Aug 03, 2008

That's because you run PHP4 and I am using a PHP5-function in v0.10+. I have however fixed that now in v0.11, so it should work with PHP4 again.

Sorry for the inconvenience and thanks for pointing it out.

Comment by elgekonegro, Aug 03, 2008

Thank you very much for fixing it. It works perfect :)

Comment by janpolsen, Aug 04, 2008

You are very welcome :)

Comment by hismuse, Aug 07, 2008

For my current theme I can't seem to figure out where to put the (<?php if(function_exists('CommentHighlight?')) CommentHighlight?(); ?>) part, can you help? I was using it for my old theme but it won't work the same.

Comment by janpolsen, Aug 07, 2008

I can't help you as long as I don't know what theme you use - an URL might also help me on the way.

Comment by rubjohn, Sep 26, 2008

I receive this after activation

Warning: file_put_contents(/home/user/moow.net/blog/wp-content/plugins/ch/comment_highlighter_v0_13.log) function.file-put-contents?: failed to open stream: Permission denied in /home/user/moow.net/blog/wp-content/plugins/ch/comment_highlighter_v0_13.php on line 59

Warning: file_put_contents(/home/user/moow.net/blog/wp-content/plugins/ch/comment_highlighter_v0_13.log) function.file-put-contents?: failed to open stream: Permission denied in /home/user/moow.net/blog/wp-content/plugins/ch/comment_highlighter_v0_13.php on line 54

Warning: file_put_contents(/home/user/moow.net/blog/wp-content/plugins/ch/comment_highlighter_v0_13.log) function.file-put-contents?: failed to open stream: Permission denied in /home/user/moow.net/blog/wp-content/plugins/ch/comment_highlighter_v0_13.php on line 54

Warning: file_put_contents(/home/user/moow.net/blog/wp-content/plugins/ch/comment_highlighter_v0_13.log) function.file-put-contents?: failed to open stream: Permission denied in /home/user/moow.net/blog/wp-content/plugins/ch/comment_highlighter_v0_13.php on line 5

Comment by rubjohn, Sep 26, 2008

please help

Comment by janpolsen, Sep 27, 2008

You just need to make sure, that the script can write to the file /home/user/moow.net/blog/wp-content/plugins/ch/comment_highlighter_v0_13.log... that's all...

Comment by j...@skippinghearts.com, Dec 21, 2009

I realize this plugin is pretty old, but kudos to you for making to single plugin that I needed to highlight the comments of multiple authors commenting on a single post.

I ran into a snag and figured out a workaround, but wondering if you could offer some insight.

The blog is running 2.8.5, and when I define specific email user email addresses, the plugin works great and I'm able to display a different layout for that comment. But I also want to display a generic background for all other comments and just selecting "global" won't work. I select "even" and "odd" and it works, but I'm guessing you know of a better solution than that.

Any ideas?

Thanks in advance. If you have a spot where I can make a donation, please let me know.

Comment by janpolsen, Dec 22, 2009

Hi Jeff

It sounds to me that you want to make a generic background on all comments except your own? If that is the case then why not make that generic background as a regular style for all your comments and then use comment highlighter to just highlight your own comments?

There is no reason (and as you write then it might not even be possible) for creating a comment highlight which styles all comments. On the other hand then you can do it with making the same style for "even" and "odd" comments, just as you have found out.

Best regards, Jan


Sign in to add a comment
Hosted by Google Code