rp-comment-hilite

1.1 (February 23, 2005)

Requirements | Changelog | Installation | Functions | Help | Copying

rp–comment–hilite is a WordPress plugin that allows you to highlight the significant and noteworthy comments posted on your WP blog.

Requirements

The plugin version has been tested on WordPress 1.2-mingus, and WordPress 1.5-strayhorn, and should work with other releases from the same codebase.

This document’s formatting and style was inspired (ripped?) from WP’s readme.html, and is provided for users of this hack.

Changelog

1.1 (February 23, 2005)
Updated for WP–1.5, added option to highlight comment from within the entry pages. (Thanks ckozus.)

Installation

  1. Unzip the package in an empty directory.
  2. Drop rp-plugin-comment-hilite.php in your wp-content/plugins/ and activate.
  3. To use, use the function rp_is_comment_hilite() in wp-comments.php to display anything you want for highlighted comments.

    Sample:
    
        <?php if (rp_is_comment_hilite()) { ?>
            class="noteworthy"
        <?php } ?>
    

    The way I use it, I just add a noteworthy class to a highlighted comment.

  4. To indicate which comments should be highlighted, just add a custom field called comment-hilite, with comma--separated--values containing the ID of the said comments.
  5. For WP 1.5+ users only, you may add the link to highlight the comment from the entry pages, provided you are logged in. This is similar to the “Edit This” link. Use the function rp_comment_hilite_link() in wp-comments.php to highlight comments. Place the link preferably right after the <?php edit_comment_link('e','',''); ?>

    Sample:
    
       <?php edit_comment_link('e','',''); ?>
       <?php rp_comment_hilite_link('h','',''); ?>
    

Functions

Listed below are the functions made available for use by this plugin.

<?php rp_is_comment_hilite(); ?>
Returns (not echo) true if the current comment in the "“loop” is highlighted; otherwise false.

<?php rp_comment_hilite_link(); ?>
Prints (echo) a link to highlight the current comment directly. Works in WP-1.5+ only.

Help

Questions, reactions and, suggestions regarding this hack may be posted on the author’s site, just as you can email him at markku at rebelpixel dot com.

Copying

Copying, modification and redistribution is allowed under the terms of the GPL, better explained by the CC–GPL (Creative Commons Deed). If you found this hack useful, don’t hesitate to link to my site and the projects’s page.