Will this php script work for Wordpress 2.5?

Discussion in 'Programming' started by aim_high, Apr 1, 2008.

  1. #1
    one of the php scripts shows the most commented posts. It does not work though. Here is the script

    <?php $result = $wpdb->get_results("SELECT comment_count,ID,post_title FROM $wpdb->posts ORDER BY comment_count DESC LIMIT 0 , 6");
    foreach ($result as $topten) {
    $postid = $topten->ID;
    $title = $topten->post_title;
    $commentcount = $topten->comment_count;
    if ($commentcount != 0) { ?>
    <li><a href="<?php echo get_permalink($postid); ?>" title="<?php echo $title ?>"><?php echo $title ?></a></li>
    <?php } } ?>

    Anything wrong with it? (I dont know any php)

    Thank You
     
    aim_high, Apr 1, 2008 IP
  2. aim_high

    aim_high Peon

    Messages:
    167
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    anyone? please
     
    aim_high, Apr 2, 2008 IP