Changeset 2413

Show
Ignore:
Timestamp:
06/24/05 23:02:47 (3 years ago)
Author:
MtDewVirus
Message:

http://dev.wp-plugins.org/ticket/97

Location:
comment-count
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • comment-count/branches/wp-1.5/comment-count.php

    r890 r2413  
    33Plugin Name: Comment Count 
    44Plugin URI: http://mtdewvirus.com/code/wordpress-plugins/ 
    5 Description: Counts the number of comments. Can be used to count total number of comments or comments for a specific post when used "in the loop." 
    6 Version: 1.02 
     5Description: Counts the total number of comments. 
     6Version: 1.1 
    77Author: Nick Momrik 
    88Author URI: http://mtdewvirus.com/ 
    99*/ 
    1010 
    11 function mdv_comment_count($all_posts = true) { 
    12     global $wpdb, $id; 
     11function mdv_comment_count() { 
     12    global $wpdb; 
    1313      $request = "SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = '1'"; 
    14       if (!$all_posts) $request .= " AND comment_post_ID=$id"; 
     14 
    1515    echo $wpdb->get_var($request); 
    1616} 
  • comment-count/branches/wp-1.5/read_me.txt

    r786 r2413  
    11Place the function call wherever you want the output to appear. 
    22<?php mdv_comment_count(); ?> 
    3  
    4 The function accepts one optional parameter, which allows you to find the comment count for a particular post when it is used inside the "the loop". If you do not pass a parameter to the function, it defaults to true, counting ALL comments for a WP install. If you call the function like <?php mdv_comment_count(false); ?> it will count the comments for the post that "the loop" is working on. 
  • comment-count/trunk/comment-count.php

    r890 r2413  
    33Plugin Name: Comment Count 
    44Plugin URI: http://mtdewvirus.com/code/wordpress-plugins/ 
    5 Description: Counts the number of comments. Can be used to count total number of comments or comments for a specific post when used "in the loop." 
    6 Version: 1.02 
     5Description: Counts the total number of comments. 
     6Version: 1.1 
    77Author: Nick Momrik 
    88Author URI: http://mtdewvirus.com/ 
    99*/ 
    1010 
    11 function mdv_comment_count($all_posts = true) { 
    12     global $wpdb, $id; 
     11function mdv_comment_count() { 
     12    global $wpdb; 
    1313      $request = "SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = '1'"; 
    14       if (!$all_posts) $request .= " AND comment_post_ID=$id"; 
     14 
    1515    echo $wpdb->get_var($request); 
    1616} 
  • comment-count/trunk/read_me.txt

    r786 r2413  
    11Place the function call wherever you want the output to appear. 
    22<?php mdv_comment_count(); ?> 
    3  
    4 The function accepts one optional parameter, which allows you to find the comment count for a particular post when it is used inside the "the loop". If you do not pass a parameter to the function, it defaults to true, counting ALL comments for a WP install. If you call the function like <?php mdv_comment_count(false); ?> it will count the comments for the post that "the loop" is working on.