Changeset 493

Show
Ignore:
Timestamp:
01/21/05 22:31:44 (3 years ago)
Author:
MtDewVirus
Message:

Query should use WHERE instead of AND for post_status

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • recent-comments/trunk/recent-comments.php

    r404 r493  
    44Plugin URI: http://dev.wp-plugins.org/browser/recent-comments/ 
    55Description: Retrieves a list of the most recent comments. 
    6 Version: 1.13 
     6Version: 1.14 
    77Author: Nick Momrik 
    88Author URI: http://mtdewvirus.com/ 
     
    1111function get_recent_comments($no_comments = 5, $comment_lenth = 5, $before = '<li>', $after = '</li>', $show_pass_post = false, $comment_style = 0) { 
    1212    global $wpdb, $tablecomments, $tableposts; 
    13     $request = "SELECT ID, comment_ID, comment_content, comment_author, post_title FROM $tablecomments LEFT JOIN $tableposts ON $tableposts.ID=$tablecomments.comment_post_ID AND post_status = 'publish' "; 
     13    $request = "SELECT ID, comment_ID, comment_content, comment_author, post_title FROM $tablecomments LEFT JOIN $tableposts ON $tableposts.ID=$tablecomments.comment_post_ID WHERE post_status = 'publish' "; 
    1414      if(!$show_pass_post) $request .= "AND post_password ='' "; 
    1515      $request .= "AND comment_approved = '1' ORDER BY comment_ID DESC LIMIT $no_comments";