Support » Fixing WordPress » Help with ” most popular comment ” plug in…please

  • I downloaded and installed to my folders the plugin – which is just a file basically- for “most popular comments”. yeah ,at least I did that.

    The problem is that when installed to my side bar the <b> things are still outside all the links.

    look at my sidebar –

    here is the code inserted into the sidebar as directed

    <li><h2>Most Commented Posts</h2></li>
    <?php get_mostcommented(); ?>

    I’ve tried taking out the “ul” the “li” and the “h2” tags seperately and all together but it makes no differene.

    The code for the page is as follows – after the line that is not inclusive to the code


    Plugin Name: WP-MostCommentedPosts
    Plugin URI:
    Plugin Description: WP-MostCommentedPosts plugin by Rafal "RAFi" Krawczyk based on <a href="">WP-STATS</a> Statistics Plugin for WordPress written by <a href="">Lester "GaMerZ" Chan</a>.
    Version: 0.1
    Author: Rafal "RAFi" Krawczyk
    Author URI:

    function get_mostcommented($limit = 10) {
    global $wpdb, $post;
    $mostcommenteds = $wpdb->get_results("SELECT $wpdb->posts.ID, post_title, post_name, post_date, COUNT($wpdb->comments.comment_post_ID) AS 'comment_total' FROM $wpdb->posts LEFT JOIN $wpdb->comments ON $wpdb->posts.ID = $wpdb->comments.comment_post_ID WHERE comment_approved = '1' AND post_date_gmt < '".gmdate("Y-m-d H:i:s")."' AND post_status = 'publish' AND post_password = '' GROUP BY $wpdb->comments.comment_post_ID ORDER BY comment_total DESC LIMIT $limit");
    foreach ($mostcommenteds as $post) {
    $post_title = htmlspecialchars(stripslashes($post->post_title));
    $comment_total = (int) $post->comment_total;
    echo "<li>&raquo <a href="".get_permalink()."">$post_title</a> - $comment_total </li>";

    the good thing is I actually installed something – the bad thing is that it has those “b” tags around it.

    Any help appreciated.

    Permanent link to my sidebar offered for help. I get a fair amount of traffic even though I am only a c list blogebrity.

    Are bribes illegal?

    my email is

Viewing 2 replies - 1 through 2 (of 2 total)
  • 2 approaches I can think of:

    1) Find out where the <b> is getting in there; Is it actually in the database? You using it in the titles (bad girl! go to my room!)? Search and Destroy!

    2) Give up like a feckless wimp and add .strip_tags(get_permalink()). to the plugin (line starting with echo near the bottom)?

    Problem with number 2 is <b> isn’t even valid xhtml so if it pops up elsewhere/again…..

    Well unfortunately now my site is gone.;(

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Help with ” most popular comment ” plug in…please’ is closed to new replies.