• I’m trying to understand Raoul’s simple recent comment plugin.

    In the sql query it has WHERE comment_approved = '1' AND comment_type='' AND post_password = ''. I was thinking that the database has stored type of comments in comment_type since I could use it in the loop such as this http://codex.wordpress.org/Template_Tags/comment_type

    However if I use comment_type=’trackback’ it doesn’t work?

    Currently this plugin returns only comments but not trackback or incoming links, wonder if that can be done or some other plugins should be used.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Have a look at this article.

    yes, for each comment, a “comment type” is stored, however trackbacks and pingbacks are both stored as “trackbacks” (as far as I know). I wouldn’t know how to go about seperating the pingbacks from trackbacks.

    Sorry 🙁

    If you don’t mind trackbacks and pingbacks being together, you can follow the instuctions on this page (http://jackosh.com/wpplugins/trackbacklist/) to seperate them from regular comments..

    Thread Starter sfong15

    (@sfong15)

    Firstly thanks HandySole for the hint. That article at Bram.us uses the same filter as in Jackosh’s plugin, i.e. if(get_comment_type() != "comment") that returns anything else other than normal comment.

    I just wonder why using comment_type from WP’s database doesn’t work.

    E.g. in Anders Holte Nielsen‘s plugin to count number of comments, I have added additional query comment_type at the end and it works! I tested it OK, see this post

    global $wpdb;
    $s = "SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = '1' AND comment_type='pingback'";
    if ($a)
    { $s .= " AND comment_post_ID=$a"; }
    return $wpdb->get_var($s); //return number of pingbacks

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘simple recent comment plugin’ is closed to new replies.