吐槽!来访的朋友们!

《吐槽!来访的朋友们!》有15个想法

    1. @Sven, 这个读者墙其实是被很多大神嫌弃的1.0版本,没有任何的动态效果……核心代码给你,剩下的估计Sven自己也会吧? :twisted:

          $query="SELECT COUNT(comment_ID) AS cnt, comment_author, comment_author_url, comment_author_email FROM (SELECT * FROM $wpdb->comments LEFT OUTER JOIN $wpdb->posts ON ($wpdb->posts.ID=$wpdb->comments.comment_post_ID) WHERE comment_date > date_sub( NOW(), INTERVAL 24 MONTH ) AND user_id='0' AND comment_author_email != '不想显示的邮箱在这里' AND post_password='' AND comment_approved='1' AND comment_type='') AS tempcmt GROUP BY comment_author_email ORDER BY cnt DESC LIMIT 44" ;   //44就是显示个数
      
          $wall = $wpdb->get_results($query);    
          $maxNum = $wall[0]->cnt;   
          foreach ($wall as $comment)   
          {   
              $width = round(40 / ($maxNum / $comment->cnt),2);   
              //此处是对应的血条的宽度   
              if( $comment->comment_author_url )    
              $url = $comment->comment_author_url;    
              else $url="#";   
        $avatar = get_avatar( $comment->comment_author_email, $size = '50' );    
             $tmp = "comment_author."小盆友一共吐槽了".$comment->cnt."次哦~"."\" "."target=\"_blank\" rel=\"external nofollow\" href=\"".$comment->comment_author_url."\">".$avatar."";    
              $output .= $tmp;   
           }    
          $output = "
      ".$output."
      "; echo $output ;
      Firefox Windows

发表评论

电子邮件地址不会被公开。 必填项已用*标注