I used comment plugger in a my-hacks document. It worked fine in Wordpress v2.1 but it doesn't show up on v2.3. If anyone can help me figure out what's wrong, that'd be great.
Here's the code:
<?php
function comment_plugger($before = '<b>Thanks for your comment:</b> ', $limit = 10, $sep = ', ') {
global $wpdb, $tablecomments, $id;
$request = "SELECT comment_author, comment_author_url, MAX(comment_ID) as comment_ID FROM $tablecomments";
$request .= " WHERE comment_post_ID='$id' AND comment_approved = '1' GROUP BY comment_author, comment_author_url ORDER BY comment_ID DESC";
$request .= ($limit > 0) ? " LIMIT $limit" : '';
$commenters = $wpdb->get_results($request);
if ($commenters) {
$output = '';
foreach ($commenters as $commenter) {
if (!empty($commenter->comment_author_url)) {
$output[] = '<a href="' . $commenter->comment_author_url . '" title="' . $commenter->comment_author . '">' . $commenter->comment_author . '</a>';
}
else {
$output[] = $commenter->comment_author;
}
}
if (is_array($output)) {
echo $before.implode($sep, $output);
}
} else {
// echo "No one...yet.";
}
}
?>
Here's my website: http://suefeng.com