- 6
会员总数
- 62
文章总数
- 8657
浏览总数
- 2
今日发布
- 60天
稳定运行
雪花效果控制
永久会员新春钜惠
微信QQ客服一对一
源码永久免费升级
大量专属精品源码
免费下载全站资源
立即开通
展开全屏
返回顶部
comment_author_email; ++$j; }
if ( !in_array($comment->comment_author_email, $commentusers) ) {
$commentusers[] = $comment->comment_author_email;
++$j;
}
}
$output = array($j,$i);
$which = ($which == 0) ? 0 : 1;
return $output[$which]; //返回评论人数
}
return 0; //没有评论返回0
};
// 随机文章
function random_posts($posts_num=5,$before='',$after=''){
global $wpdb;
$sql = "SELECT ID, post_title,guid
FROM $wpdb->posts
WHERE post_status = 'publish' ";
$sql .= "AND post_title != '' ";
$sql .= "AND post_password ='' ";
$sql .= "AND post_type = 'post' ";
$sql .= "ORDER BY RAND() LIMIT 0 , $posts_num ";
$randposts = $wpdb->get_results($sql);
$output = '';
foreach ($randposts as $randpost) {
$post_title = stripslashes($randpost->post_title);
$permalink = get_permalink($randpost->ID);
$output .= $before.'';
$output .= $after;
}
echo '';
}
// 点赞统计
function dz($post_id){
global $wpdb;
$sql = "SELECT SUM(`meta_value`) as num FROM `wp_postmeta` WHERE `meta_key`='like' AND `post_id`=$post_id";
$results = $wpdb->get_results($sql);
// 处理空值避免报错
return isset($results[0]->num) ? $results[0]->num : 0;
}
// 弹窗提醒
function dorzs() {
echo '';
echo '';
echo '';
}
?>