'd_reader', 'description' => '显示近期评论频繁的网友头像等' ); $this->WP_Widget( 'd_reader', 'Yusi-活跃读者', $widget_ops, $control_ops ); } function widget( $args, $instance ) { extract( $args ); $title = apply_filters('widget_name', $instance['title']); $limit = $instance['limit']; $outer = $instance['outer']; $timer = $instance['timer']; $addlink = $instance['addlink']; $more = $instance['more']; $link = $instance['link']; $mo=''; if( $more!='' && $link!='' ) $mo=''.$more.''; echo $before_widget; echo $before_title.$mo.$title.$after_title; echo ''; echo $after_widget; } function form($instance) { ?>

get_results("select count(comment_author) 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 $tim day ) and user_id='0' and comment_author != '".$out."' and post_password='' and comment_approved='1' and comment_type='') as tempcmt group by comment_author order by cnt desc limit $lim"); foreach ($counts as $count) { $c_url = $count->comment_author_url; if ($c_url == '') $c_url = 'javascript:;'; if($addlink == 'on'){ $c_urllink = ' href="'. $c_url . '"'; }else{ $c_urllink = ''; } $type .= '
  • '.get_avatar( $count->comment_author_email, $size = '48' , deel_avatar_default() ) .'
  • '; } echo $type; } ?>