get_results(' SELECT COUNT(comment_author_email) AS comments_count, comment_author_email, comment_author, comment_author_url FROM '.$wpdb->comments.' WHERE user_id != 1 AND comment_approved = 1 AND comment_type = "" AND comment_author_email != "" GROUP BY comment_author_email ORDER BY comments_count DESC, comment_author ASC LIMIT '.$show ); //Store cache in Database with 24 hours expiration time set_transient('comments', $comments, 60*60*24); } //Prepare HTML Output Structure $output = '
'; //Loop through found records foreach($comments as $comment){ //Check if Commenter has provided a Website URL //if TRUE, show URL and the rest of the information if($comment->comment_author_url){ $output .= '

'.get_avatar($comment->comment_author_email, $size='24', $default='', $comment->comment_author).' '.$comment->comment_author.' ('.$comment->comments_count.')

'.PHP_EOL; } else { //If Commenter hasn't provided an URL to his site then display the rest of the information $output .= '

'.get_avatar($comment->comment_author_email, $size='24', $default='', $comment->comment_author).' '.$comment->comment_author.' ('.$comment->comments_count.')

'.PHP_EOL; } } //End HTML Output $output .= '
'; //Print results in the browser echo $output; } //End Function ?>