Viewing 1 replies (of 1 total)
  • I found a way to exclude myself by only showing guests’ links. (This means that people who registered for your blog won’t be plugged, only guests) Open up comment-plugger.php and find this piece of code:

    $commenters = $wpdb->get_results("SELECT comment_author, comment_author_email, comment_author_url, UNIX_TIMESTAMP(comment_date) AS unixdate FROM $wpdb->comments WHERE comment_post_ID='$id' AND comment_approved = '1' AND comment_type <> 'pingback' AND comment_type <> 'trackback' GROUP BY comment_author_email, comment_author ORDER BY comment_date DESC LIMIT $limit");

    Then replace it with this:

    $commenters = $wpdb->get_results("SELECT comment_author, comment_author_email, comment_author_url, UNIX_TIMESTAMP(comment_date) AS unixdate FROM $wpdb->comments WHERE comment_post_ID='$id' AND comment_approved = '1' AND comment_type <> 'pingback' AND comment_type <> 'trackback' AND user_id = '0' GROUP BY comment_author_email, comment_author ORDER BY comment_date DESC LIMIT $limit");

    Save the file and upload it to your plugins folder where it should be. I added user_id = ‘0’ at the end of the AND variables.

    Why does this work? Becauses guests’s user IDs are by default 0. So we tell the code to only select the rows where it says user_id = 0 🙂 Hope this helps!

Viewing 1 replies (of 1 total)
  • The topic ‘Comment plugger: exclude author’ is closed to new replies.