Log in with username/password: lyceum/lyceum

Changeset 95

Show
Ignore:
Timestamp:
10/26/05 00:55:20 (3 years ago)
Author:
john
Message:

correctly counting number of posts per user

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • tags/0.6RC/src/lyceum/wp-admin/users.php

    r85 r95  
    205205      $style = ('class="alternate"' == $style) ? '' : 'class="alternate"'; 
    206206      //$numposts = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->posts WHERE blog = '$blog' AND post_author = '$user_data->ID' and post_status = 'publish'");//lyceum 
    207       $numposts = $wpdb->get_post_var("COUNT(*)", "post_author = '$user_data->ID' and post_status = 'publish'"); 
     207      $numposts = $wpdb->get_post_var("COUNT(DISTINCT *.ID)", "post_author = '$user_data->ID' and post_status = 'publish'"); 
    208208      if (0 < $numposts) $numposts = "<a href='edit.php?b=$blog&amp;author=$user_data->ID' title='" . __('View posts') . "'>$numposts</a>"; 
    209209      echo " 
Log in with username/password: lyceum/lyceum