diff options
| author | Eltrac Koalar <hi@guhub.cn> | 2022-08-13 14:52:57 +0800 |
|---|---|---|
| committer | Eltrac Koalar <hi@guhub.cn> | 2022-08-13 14:52:57 +0800 |
| commit | 7a6cdc367539b74ca79ca38c2514f9f1f62b3d78 (patch) | |
| tree | 63c0c6bd3c3b9075e7d10d5d2c871fd690ad2556 /includes/comments.php | |
| parent | 5d9a2fe94b8d34dd16485c6d6be92046e9ade4f3 (diff) | |
:open_file_folder: Perf: 优化文件结构
Diffstat (limited to 'includes/comments.php')
| -rw-r--r-- | includes/comments.php | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/includes/comments.php b/includes/comments.php new file mode 100644 index 0000000..92ab005 --- /dev/null +++ b/includes/comments.php @@ -0,0 +1,47 @@ +<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?> +<div id="comments"> + <?php $this->comments()->to($comments); ?> + <?php if ($comments->have()): ?> + <h3><?php $this->commentsNum(_t('暂无评论'), _t('仅有一条评论'), _t('已有 %d 条评论')); ?></h3> + + <?php $comments->listComments(); ?> + + <?php $comments->pageNav('«', '»'); ?> + + <?php endif; ?> + + <?php if($this->allow('comment')): ?> + <div id="<?php $this->respondId(); ?>" class="respond"> + <div class="cancel-comment-reply"> + <?php $comments->cancelReply(); ?> + </div> + + <form method="post" action="<?php $this->commentUrl() ?>" id="comment-form" role="form"> + <?php if($this->user->hasLogin()): ?> + <p> + <?php _e('登录身份: '); ?> + <a href="<?php $this->options->profileUrl(); ?>"> + <?php $this->user->screenName(); ?> + </a> + . + <a href="<?php $this->options->logoutUrl(); ?>" title="Logout"> + <?php _e('退出'); ?> + » + </a> + </p> + <div class="submit-area"> + <?php else: ?> + <div class="submit-area"> + <input type="text" name="author" id="author" class="text" placeholder="用户名" value="<?php $this->remember('author'); ?>" required /> + <input type="email" name="mail" id="mail" class="text" placeholder="邮箱" value="<?php $this->remember('mail'); ?>"<?php if ($this->options->commentsRequireMail): ?> required<?php endif; ?> /> + <input type="url" name="url" id="url" class="text" placeholder="网址 (选填) " value="<?php $this->remember('url'); ?>"<?php if ($this->options->commentsRequireURL): ?> required<?php endif; ?> /> + <?php endif; ?> + <textarea rows="8" cols="50" name="text" id="textarea" class="textarea" placeholder="可以在这里写评论哦 ~" required ><?php $this->remember('text'); ?></textarea> + <button type="submit" class="ripple submit"><?php _e('提交评论'); ?></button> + </div> + </form> + </div> + <?php else: ?> + <h3><?php _e('评论已关闭'); ?></h3> + <?php endif; ?> +</div> |
