WordPress.org

Ready to get started?Download WordPress

Forums

thanks commentor (4 posts)

  1. courtneyelizabeth
    Member
    Posted 8 years ago #

    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!

  2. courtneyelizabeth
    Member
    Posted 8 years ago #

    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.
    if(!$hide_pingbacks_and_trackbacks)
    $ping = "";
    else
    $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'
    $ping
    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))
    continue;
    $seen[$post->comment_post_ID] = true;
    if($num++ > $num_posts)
    break;

    $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;");

  3. Marc
    Member
    Posted 8 years ago #

    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.

    http://mtdewvirus.com/code/wordpress-plugins/

  4. courtneyelizabeth
    Member
    Posted 8 years ago #

    worked like a charm....thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.