From 7cf84be1960342d14f4986badfddf834617c40d2 Mon Sep 17 00:00:00 2001 From: InsertSweat Date: Wed, 14 Jun 2017 15:38:05 +0800 Subject: [PATCH] =?UTF-8?q?=E7=95=85=E8=A8=80=E6=9B=BF=E6=8D=A2=E5=8E=9F?= =?UTF-8?q?=E6=9C=89=E7=9A=84=E5=A4=9A=E8=AF=B4=E8=AF=84=E8=AE=BA=20?= =?UTF-8?q?=E5=8F=AF=E9=80=89=E5=88=99=E9=BB=98=E8=AE=A4=E6=88=96=E7=95=85?= =?UTF-8?q?=E8=A8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- comments.php | 42 +++++++ functions.php | 19 +++ index.php | 18 ++- option.php | 23 +++- single.php | 156 ++++++++++++++++++------ static/js/main.js | 10 ++ style.css | 303 ++++++++++++++++++---------------------------- 7 files changed, 334 insertions(+), 237 deletions(-) create mode 100644 comments.php diff --git a/comments.php b/comments.php new file mode 100644 index 0000000..9922d09 --- /dev/null +++ b/comments.php @@ -0,0 +1,42 @@ + + +
  • +
    +
    + +
    +
    + %s'), get_comment_author_link()); ?> + comment_approved == '0') : ?> + 你的评论正在审核,稍后会显示出来!
    + +
    + + '回复','depth' => $depth, 'max_depth' => $args['max_depth']))) ?> + +
  • + + + + diff --git a/functions.php b/functions.php index 179e20c..deb0f3e 100755 --- a/functions.php +++ b/functions.php @@ -128,6 +128,25 @@ function wpdx_paging_nav(){ } } +/* 获取文章的评论人数 */ +function zfunc_comments_users($postid=0,$which=0) { + $comments = get_comments('status=approve&type=comment&post_id='.$postid); //获取文章的所有评论 + if ($comments) { + $i=0; $j=0; $commentusers=array(); + foreach ($comments as $comment) { + ++$i; + if ($i==1) { $commentusers[] = $comment->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 +} class FontAwesomeFour { diff --git a/index.php b/index.php index 0670450..697c0d1 100755 --- a/index.php +++ b/index.php @@ -11,8 +11,12 @@
    发表于 - - 阅读次数 ID); ?> + + 条评论 + + ID)->comment_count; ?>条评论 + + 阅读次数 ID); ?>
    @@ -41,14 +45,6 @@
    - diff --git a/option.php b/option.php index ba62fa9..cc2aa84 100755 --- a/option.php +++ b/option.php @@ -1,7 +1,7 @@ 0 && isset($_POST['next_settings']) ){ - $options = array ('author','avator','site_time','duoshuo_shortname','scheme'); + $options = array ('author','avator','site_time','comment_type','scheme', 'sohucs_appid', 'sohucs_conf'); foreach ( $options as $opt ){ delete_option ( 'next_'.$opt, $_POST[$opt] ); add_option ( 'next_'.$opt, $_POST[$opt] ); @@ -48,14 +48,27 @@ function next_settings(){?>
    -
    - - -
    +
    + + +
    + +
    + + + + +
    +