Last commenters hack help
-
Okay, I’ve used this hack previously without any problems, but since I have moved to a new host, I’m running into problems. The hack is from http://wiki.wordpress.org/Comment%20Plugger
So this is the coding in my-hacks file:
<?php
function comment_plugger($before = ”, $limit = 30, $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[] = ‘comment_author_url . ‘” title=”‘ . $commenter->comment_author . ‘”>’ . $commenter->comment_author . ‘‘;
}
else {
$output[] = $commenter->comment_author;
}
}if (is_array($output)) {
echo $before.implode($sep, $output);
}
} else {
// echo “No one…yet.”
}
}?>
And this is what I’m using to show the last commenters:
<?php comment_plugger(); ?>
I keep getting this error:
Fatal error: Call to undefined function: comment_plugger() in /home/darkcom/public_html/tinger/index.php on line 51
This is that line 51 section:
<div class=”feedback”>
<h3><?php the_author() ?> @ <?php the_time() ?> <?php edit_post_link(__(‘Edit This’)); ?>
—<?php wp_link_pages(); ?><?php comments_popup_link(__(‘Comments (0)’), __(‘Comments (1)’), __
(‘Comments (%)’)); ?></h3>
</div><BR>
<img src=”star.gif”> <b><u>PLUGS:</u></b> <?php comment_plugger(); ?> <img src=”star.gif”>
I don’t understand what is wrong. Can someone help? Please. Thanks.
The topic ‘Last commenters hack help’ is closed to new replies.