function widget($args, $instance) { extract($args); global $wpdb; $builddate = strip_tags($instance['builddate']); $sttitle = strip_tags($instance['sttitle']); echo '<div class="widget" id="widget_statistics">'; ?> <h3><?php echo $sttitle; ?> </h3> <ul> <li><i class="icon-doc-text"></i> 文章数量:<?php $count_posts = wp_count_posts(); echo $published_posts = $count_posts->publish; ?> 篇</li> <li><i class="icon-chat-1"></i> 评论数量:<?php echo $wpdb->get_var("SELECT COUNT(*) FROM {$wpdb->comments} where comment_author!='" . get_option('MT_user') . "'"); ?> 篇</li> <li><i class="icon-tags"></i> 标签数量:<?php echo $count_tags = wp_count_terms('post_tag'); ?> 个</li> <li><i class="icon-link-1"></i> 友链数量:<?php $link = $wpdb->get_var("SELECT COUNT(*) FROM {$wpdb->links} WHERE link_visible = 'Y'"); echo $link; ?> 个</li> <li><i class="icon-clock"></i> 建站日期:<?php echo $builddate; ?> </li> <li><i class="icon-gear"></i> 运行天数:<?php echo floor((time() - strtotime($builddate)) / 86400); ?> 天</li> <li><i class="icon-award"></i> 月度之星:<?php bymt_mostactive('1', '1 MONTH'); ?> </li> <li><i class="icon-pencil"></i> 最后更新:<?php $last = $wpdb->get_results("SELECT MAX(post_modified) AS MAX_m FROM {$wpdb->posts} WHERE (post_type = 'post' OR post_type = 'page') AND (post_status = 'publish' OR post_status = 'private')"); $last = date('Y-m-d', strtotime($last[0]->MAX_m)); echo '<time title="别催更!">' . $last . '</time>'; ?> </li> </ul> <?php echo "</div>\n"; }
?> <div class="post-single"> <div class="post-content"> <h2><?php the_title(); ?> </h2> <?php the_content('Read more...'); ?> <?php if (bymt_c('guestwall') && !wp_is_mobile()) { ?> <?php if (function_exists('bymt_mostactive')) { bymt_mostactive('36', '1 MONTH'); } ?> <?php } ?> </div> <?php comments_template(); ?> </div> <?php } } ?> </div>
<div class="yi_blog" align="center"> <hr size=1 style="color:#DDD;border-style:dashed ;width:100%"> <div style="height:10px"></div> <p style="margin-left:6px;float:left;color:#999;"> <h1 align="center"><?php the_title_attribute(); ?> </h1> </p> <div style="height:10px"></div> <hr size=1 style="color:#DDD;border-style:dashed ;width:100%"> <?php if (function_exists('bymt_mostactive')) { bymt_mostactive('40', '12 MONTH'); } ?> </div> </div> <div class="wrap s_clear sjzsy"> <div class="yi_blog" style="height:none;"> <?php comments_template(); ?>