Support » Fixing WordPress » thanks commentor

  • hi,

    just wondering if there was a way to have under each post next to the comment number – thank you: -commentor’s name- and then a link to their comment

    any ideas? thanks guys!

Viewing 3 replies - 1 through 3 (of 3 total)
  • i’ve tried using brian’s latest activity commentors plugin, but it just prints the latest commentors TOTAL, andnot for eachspecific post….any ideas how to tweak it?

    function blc_latest_comments($num_posts = 5, $num_comments = 6, $hide_pingbacks_and_trackbacks = true, $prefix = "<li class='alternate'>", $postfix = "")
    global $wpdb, $tablecomments, $tableposts;

    $usetimesince = function_exists('time_since'); // Work nicely with Dunstan's Time Since plugin (adapted by Michael Heilemann)

    // This is compensating for the lack of subqueries in mysql 3.x
    // The approach used in previous versions needed the user to
    // have database lock and create tmp table priviledges.
    // This uses more queries and manual DISTINCT code, but it works with just select privs.
    $ping = "";
    $ping = "AND comment_type NOT LIKE '%pingback%' AND comment_type NOT LIKE '%trackback%'";
    $posts = $wpdb->get_results("SELECT
    comment_post_ID, post_title
    FROM ($tablecomments LEFT JOIN $tableposts ON (comment_post_ID = ID))
    WHERE comment_approved = '1'
    ORDER BY comment_date DESC;");

    $seen = array();
    $num = 0;
    foreach($posts as $post)
    // The following 5 lines is a manual DISTINCT and LIMIT,
    // since mysql 3.x doesn't allow you to control which way a DISTINCT
    // select merges multiple entries.
    if(array_key_exists($post->comment_post_ID, $seen))
    $seen[$post->comment_post_ID] = true;
    if($num++ > $num_posts)

    $commenters = $wpdb->get_results("SELECT * FROM $tablecomments
    WHERE comment_approved = '1'
    AND comment_post_ID = '".$post->comment_post_ID."'
    ORDER BY comment_date DESC
    LIMIT $num_comments;");

    Try this plugin, you may be able to rework to display what you want.

    It’s configured to give a list of the last people to comment on a post, with a link to their site if they provided one.

    worked like a charm….thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘thanks commentor’ is closed to new replies.