extra chrachters

  • HollyHunter
  • Newbie
  • Newbie
  • User avatar
  • Posts: 13

Post 3+ Months Ago

Hi all,

I'm trying to install wordpress here: http://www.illshutupnow.com

It's all working except a few extra charchters being added to one of the mods at the bottom: most discussed (the green posit).

It seems to be adding a -1 and >> between each link, and i'm at a loss as to why.

The code for the most commented mod is as follows:

Code: [ Select ]
<?php

 
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>";
    }
}
?>
  1. <?php
  2.  
  3. function get_mostcommented($limit = 10) {
  4.     global $wpdb, $post;
  5.     $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");
  6.     foreach ($mostcommenteds as $post) {
  7.             $post_title = htmlspecialchars(stripslashes($post->post_title));
  8.             $comment_total = (int) $post->comment_total;
  9.             echo "<li>&raquo <a href=\"".get_permalink()."\">$post_title</a> - $comment_total </li>";
  10.     }
  11. }
  12. ?>



Anyone have any ideas?

Thanks


Holly x
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • HollyHunter
  • Newbie
  • Newbie
  • User avatar
  • Posts: 13

Post 3+ Months Ago

Always the way, post it, then figure it out.

Nevermind all, i got it!

:) :)

Holly xx

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 107 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.