Popular Posts Plugin for WP 2.51

Discussion in 'WordPress' started by deluxdon, Aug 23, 2008.

  1. #1
    Anyone know about Popular Posts Plugin for WP version 2.51 :confused: I have downloaded one plugin which available but after installed when i try to activate it gives me some fatal error :(

    Appreciate if anyone suggest me good plugin for that which works properly for WP v.2.51

    Thanks in advance.

    DON.
     
    deluxdon, Aug 23, 2008 IP
  2. kwebster

    kwebster Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    The following loop will get the 11 most commented on (thus popular) posts on your blog (WordPress only). Add this in your themes sidebar.php (or wherever you want the posts to appear - won't work in posts or pages without the ability to execute php in posts though). You will need to add css to make this fit your theme.

    <?php
    $now = gmdate("Y-m-d H:i:s",time());
    $lastmonth = gmdate("Y-m-d H:i:s",gmmktime(date("H"), date("i"), date("s"), date("m")-1,date("d"),date("Y")));
    $popularposts = "SELECT ID, post_title, post_date, comment_count, COUNT($wpdb->comments.comment_post_ID) AS 'popular' FROM $wpdb->posts, $wpdb->comments WHERE comment_approved = '1' AND $wpdb->posts.ID=$wpdb->comments.comment_post_ID AND post_status = 'publish' AND comment_status = 'open' GROUP BY $wpdb->comments.comment_post_ID ORDER BY popular DESC LIMIT 11";
    $posts = $wpdb->get_results($popularposts);
    $popular = '';
    if($posts){
    foreach($posts as $post){
    $post_title = stripslashes($post->post_title);
    $post_date = stripslashes($post->post_date);
    $comments = stripslashes($post->comment_count);
    $guid = get_permalink($post->ID);
    $popular .= '<li><span class="title"><a href="'.$guid.'" title="'.$post_title.'">'.$post_title.'</a></span><br/><span class="meta">With <a href="'.$guid.'#commenting" title="Read the comments on '.$post_title.'">'.$comments.' comments</a> since '.$post_date.'</span></li>
    ';
    }
    }echo $popular;
    ?>
     
    kwebster, Aug 23, 2008 IP
  3. deluxdon

    deluxdon Catch Me If You Can...!!!™ Staff

    Messages:
    25,481
    Likes Received:
    1,943
    Best Answers:
    32
    Trophy Points:
    480
    #3
    @kwebster - Tried your given code but its not working :( Blank space appear where i am trying to add your given code.

    Anyone else help me out of this problem :confused:

    DON.
     
    deluxdon, Aug 23, 2008 IP
  4. godsofchaos

    godsofchaos Peon

    Messages:
    2,595
    Likes Received:
    124
    Best Answers:
    0
    Trophy Points:
    0
    #4
    If you are on wordpress then search for these terms in google " popularity contest plugin download" and you'll get what you are looking for. I would have posted the link to download myself but am replying from the phone.

    If you need professional services then I can help ya with it. Just pm me and I'll set it up asap after a minimal payment.
     
    godsofchaos, Aug 24, 2008 IP
  5. deluxdon

    deluxdon Catch Me If You Can...!!!™ Staff

    Messages:
    25,481
    Likes Received:
    1,943
    Best Answers:
    32
    Trophy Points:
    480
    #5
    As i told earlier in my first post that i have downloaded that plugin but seems like its not working with latest wp version. Thats why looking for another plugin or code.

    DON.
     
    deluxdon, Aug 24, 2008 IP
  6. godsofchaos

    godsofchaos Peon

    Messages:
    2,595
    Likes Received:
    124
    Best Answers:
    0
    Trophy Points:
    0
    #6
    It works fine if you tweak it a little bit, just search for the fix in google. :) I'm using it in my blog with 2.6.1 with no problems.
     
    godsofchaos, Aug 24, 2008 IP
    deluxdon likes this.
  7. Nigel Lew

    Nigel Lew Notable Member

    Messages:
    4,642
    Likes Received:
    406
    Best Answers:
    21
    Trophy Points:
    295
    #7
    Nigel Lew, Aug 24, 2008 IP
    deluxdon likes this.
  8. deluxdon

    deluxdon Catch Me If You Can...!!!™ Staff

    Messages:
    25,481
    Likes Received:
    1,943
    Best Answers:
    32
    Trophy Points:
    480
    #8
    Big thanks to both of you :)

    Now its working like a charm at my blog.

    DON.
     
    deluxdon, Aug 24, 2008 IP
  9. godsofchaos

    godsofchaos Peon

    Messages:
    2,595
    Likes Received:
    124
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Awesome! I am glad that you fixed it. Its quite weird that Alex didnt fix it even though everyone else could and did, I mean after all... its his plugin! And you are most welcome!
     
    godsofchaos, Aug 25, 2008 IP
  10. deluxdon

    deluxdon Catch Me If You Can...!!!™ Staff

    Messages:
    25,481
    Likes Received:
    1,943
    Best Answers:
    32
    Trophy Points:
    480
    #10
    Yeap i am also surprised that why alex didn't fix it yet in that budle.

    BTW after fixed that fatal error issue i have fixed another issue (it display popular pages as well alongwith popular posts and i don't want to display pages there) with help of Nigel. Thanks Nigel for that :)

    DON.
     
    deluxdon, Aug 25, 2008 IP