--- /wordpress/wp-includes/user_old.php	Tue Aug 18 11:39:58 2009
+++ /wordpress/wp-includes/user.php	Tue Aug 18 11:45:12 2009
@@ -174,6 +174,22 @@
 }
 
 /**
+ * Number of approved comments the user has written.
+ *
+ * @since 2.84
+ * @uses $wpdb WordPress database object for queries.
+ *
+ * @param int $userid User ID.
+ * @return int Amount of approved comments user has written.
+ */
+function get_usernumcomments($userid) {
+	global $wpdb;
+	$userid = (int) $userid;
+	$count = $wpdb->get_var( $wpdb->prepare("SELECT COUNT(*) FROM $wpdb->comments WHERE user_id = %d AND comment_approved = '1'", $userid));
+	return apply_filters('get_usernumcomments', $count, $userid);
+}
+
+/**
  * Check that the user login name and password is correct.
  *
  * @since 0.71
