• "Crown Me" Installation instructions.

last modified July 7, 2009 by anilm

To install the "Crown Me" plugin on your wordpress blog:

  1.  Download the attached file crown_me_v0.1.zip
  2. Unzip this downloaded attachment into /wp-content/plugins
  3. Activate the plugin.
  4. Add the following two lines to the comments.php file in your theme directory:
  • <?php do_action("crown_link", $comment->comment_ID); ?>  //This line creates a link allowing blog administrators to "crown" a comment.
  • <?php do_action("display_crown", $comment->comment_ID); ?> //This lines adds a "star" icon to comments that have been featured.

    After adding these two lines, the comments.php file in my "default" theme look like this:

        <ol class="commentlist">

        <?php foreach ($comments as $comment) : ?>

                <li <?php echo $oddcomment; ?>id="comment-<?php comment_ID() ?>">
                        <?php echo get_avatar( $comment, 32 ); ?>
                        <cite><?php comment_author_link() ?></cite> Says:
                        <?php if ($comment->comment_approved == '0') : ?>
                        <em>Your comment is awaiting moderation.</em>
                        <?php endif; ?>
                        <br />

                        <small class="commentmetadata"><a href="#comment-<?php comment_ID() ?>" title=""><?php comment_date('F jS, Y') ?> at <?php comment_time() ?></a> <?php edit_comment_link('edit','&nbsp;&nbsp;',''); ?><?php do_action("crown_link", $comment->comment_ID); ?></small>
                        <?php do_action('display_crown', $comment->comment_ID); ?>
                        <?php comment_text() ?>

                </li>

        <?php
                /* Changes every other comment to a different class */
                $oddcomment = ( empty( $oddcomment ) ) ? 'class="alt" ' : '';
        ?>

        <?php endforeach; /* end for each comment */ ?>

        </ol>