/wp-content/themes/hicms/includes/top_comment.php
PHP | 15 lines | 15 code | 0 blank | 0 comment | 4 complexity | fc3d8f697381801970dc20cb3b4127bc MD5 | raw file
Possible License(s): GPL-2.0, GPL-3.0, AGPL-1.0, LGPL-2.1
- <?php if (get_option('swt_type') == 'Display') { ?>
- <h3>最活跃的读者</h3>
- <ul>
- <?php
- $counts = $wpdb->get_results("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 1 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 15");
- foreach ($counts as $count) {
- $a = get_bloginfo('wpurl') . '/avatar/' . md5(strtolower($count->comment_author_email)) . '.jpg';
- $c_url = $count->comment_author_url;
- $mostactive .= '<li class="mostactive">' . '<a href="'. $c_url . '" title="' . $count->comment_author . ' (留下'. $count->cnt . '个脚印)" target="_blank" rel="external nofollow"><img src="' . $a . '" alt="' . $count->comment_author . '" class="avatar" /></a></li>';
- }
- echo $mostactive;
- ?>
- </ul>
- <?php { echo ''; } ?>
- <?php } else { include(TEMPLATEPATH . '/includes/top_comment2.php'); } ?>