• 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.

Viewing 3 replies - 1 through 3 (of 3 total)
  • If you are using 1.5, have you enabled the use of my-hacks ? (It’s at the bottom of options > Misc)

    There is also a plugin …

    Thread Starter darkmis29

    (@darkmis29)

    Yes. I enabled that.

    I was thinking, is it possible that the error is caused because I have my wordpress files in a folder called wordpress in my root directory?

    Is this is the problem, what do I change for that hack, so it’s pointing the comment thing to that folder instead of the root.

    Thread Starter darkmis29

    (@darkmis29)

    Fixed the problem. 🙂

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Last commenters hack help’ is closed to new replies.