Trouble with Comment Plugger hack.
-
I’m trying to get the comment plugger hack working, but recieveing this errror:
Parse error: parse error, unexpected T_FUNCTION in /hsphere/local/home/artific/escapetheday.org/wp/my-hacks.php on line 2This is my ‘my-hacks.php’ file:
<? php<br />
function comment_plugger($before = ' ♥♥♥ ', $limit = 40, $sep = ' ') {<br />
global $wpdb, $tablecomments, $id;<br />
$request = "SELECT comment_author, comment_author_url, MAX(comment_ID) as comment_ID FROM $tablecomments";<br />
$request .= " WHERE comment_post_ID='$id' AND comment_approved = '1' GROUP BY comment_author, comment_author_url ORDER BY comment_ID DESC";<br />
$request .= ($limit > 0) ? " LIMIT $limit" : '';<br />
$commenters = $wpdb->get_results($request);if ($commenters) {<br />
$output = '';<br />
foreach ($commenters as $commenter) {<br />
if (!empty($commenter->comment_author_url)) {<br />
$output[] = '<a>comment_author_url . '" title="' . $commenter->comment_author . '">' . $commenter->comment_author . '</a>';<br />
}<br />
else {<br />
$output[] = $commenter->comment_author;<br />
}<br />
}if (is_array($output)) {<br />
echo $before.implode($sep, $output);<br />
}<br />
} else {<br />
// echo "No one...yet.";<br />
}<br />
}<br />
?>
- The topic ‘Trouble with Comment Plugger hack.’ is closed to new replies.