I'm currently working on a plugin that I hinted at here and so far I have managed to code everything, only missing one piece of the puzzle.
This is how I get the total comment count for the current_user
:
global $wpdb, $current_user;
get_currentuserinfo();
$userID = $current_user->ID;
$where = 'WHERE comment_approved = 1 AND user_id = ' . $userID ;
$comment_count = $wpdb->get_var("SELECT COUNT( * ) AS total
FROM {$wpdb->comments}
{$where}");
echo 'Total Comments: ' . $comment_count;
I want to echo
the current_user
's total comment count on other users posts, so I don't want to count the comments on the author's own posts. Is such thing possible? And if so, how?