Changeset 2412

Show
Ignore:
Timestamp:
06/24/05 22:50:46 (3 years ago)
Author:
MtDewVirus
Message:

Now displays comments for both posts and pages (http://dev.wp-plugins.org/ticket/75)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • recent-comments/branches/wp-1.5/recent-comments.php

    r1356 r2412  
    44Plugin URI: http://mtdewvirus.com/code/wordpress-plugins/ 
    55Description: Retrieves a list of the most recent comments. 
    6 Version: 1.16 
     6Version: 1.18 
    77Author: Nick Momrik 
    88Author URI: http://mtdewvirus.com/ 
     
    1111function mdv_recent_comments($no_comments = 5, $comment_lenth = 5, $before = '<li>', $after = '</li>', $show_pass_post = false, $comment_style = 0) { 
    1212    global $wpdb; 
    13     $request = "SELECT ID, comment_ID, comment_content, comment_author, post_title FROM $wpdb->comments LEFT JOIN $wpdb->posts ON $wpdb->posts.ID=$wpdb->comments.comment_post_ID WHERE post_status = 'publish' "; 
     13    $request = "SELECT ID, comment_ID, comment_content, comment_author, comment_author_url, post_title FROM $wpdb->comments LEFT JOIN $wpdb->posts ON $wpdb->posts.ID=$wpdb->comments.comment_post_ID WHERE post_status IN ('publish','static') "; 
    1414      if(!$show_pass_post) $request .= "AND post_password ='' "; 
    1515      $request .= "AND comment_approved = '1' ORDER BY comment_ID DESC LIMIT $no_comments"; 
     
    2626                  $comment_excerpt = join(" ",array_slice($words,0,$comment_lenth)); 
    2727                  $permalink = get_permalink($comment->ID)."#comment-".$comment->comment_ID; 
     28 
    2829                  if ($comment_style == 1) { 
    2930                        $post_title = stripslashes($comment->post_title); 
    30                         $output .= $before . comment_author_link() . ' on ' . $post_title . '.' . $after; 
     31                         
     32                        $url = $comment->comment_author_url; 
     33 
     34                        if (empty($url)) 
     35                              $output .= $before . $comment_author . ' on ' . $post_title . '.' . $after; 
     36                        else 
     37                              $output .= $before . "<a href='$url' rel='external'>$comment_author</a>" . ' on ' . $post_title . '.' . $after; 
    3138                  } 
    3239                  else { 
  • recent-comments/trunk/recent-comments.php

    r1356 r2412  
    44Plugin URI: http://mtdewvirus.com/code/wordpress-plugins/ 
    55Description: Retrieves a list of the most recent comments. 
    6 Version: 1.16 
     6Version: 1.18 
    77Author: Nick Momrik 
    88Author URI: http://mtdewvirus.com/ 
     
    1111function mdv_recent_comments($no_comments = 5, $comment_lenth = 5, $before = '<li>', $after = '</li>', $show_pass_post = false, $comment_style = 0) { 
    1212    global $wpdb; 
    13     $request = "SELECT ID, comment_ID, comment_content, comment_author, post_title FROM $wpdb->comments LEFT JOIN $wpdb->posts ON $wpdb->posts.ID=$wpdb->comments.comment_post_ID WHERE post_status = 'publish' "; 
     13    $request = "SELECT ID, comment_ID, comment_content, comment_author, comment_author_url, post_title FROM $wpdb->comments LEFT JOIN $wpdb->posts ON $wpdb->posts.ID=$wpdb->comments.comment_post_ID WHERE post_status IN ('publish','static') "; 
    1414      if(!$show_pass_post) $request .= "AND post_password ='' "; 
    1515      $request .= "AND comment_approved = '1' ORDER BY comment_ID DESC LIMIT $no_comments"; 
     
    2626                  $comment_excerpt = join(" ",array_slice($words,0,$comment_lenth)); 
    2727                  $permalink = get_permalink($comment->ID)."#comment-".$comment->comment_ID; 
     28 
    2829                  if ($comment_style == 1) { 
    2930                        $post_title = stripslashes($comment->post_title); 
    30                         $output .= $before . comment_author_link() . ' on ' . $post_title . '.' . $after; 
     31                         
     32                        $url = $comment->comment_author_url; 
     33 
     34                        if (empty($url)) 
     35                              $output .= $before . $comment_author . ' on ' . $post_title . '.' . $after; 
     36                        else 
     37                              $output .= $before . "<a href='$url' rel='external'>$comment_author</a>" . ' on ' . $post_title . '.' . $after; 
    3138                  } 
    3239                  else {