diff options
| author | Eltrac Koalar <hi@guhub.cn> | 2020-10-07 20:40:09 +0800 |
|---|---|---|
| committer | Eltrac Koalar <hi@guhub.cn> | 2020-10-07 20:40:09 +0800 |
| commit | e6f3df7eaf6881a303358289dadb904824872d45 (patch) | |
| tree | 57a98fea6448ee3b306af9f0127cd764697100a3 /saying.php | |
| parent | 49506af621b073a3acd1cd53d54771d0695108ee (diff) | |
bring back the 1.x files to master
Diffstat (limited to 'saying.php')
| -rw-r--r-- | saying.php | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/saying.php b/saying.php new file mode 100644 index 0000000..3fcf651 --- /dev/null +++ b/saying.php @@ -0,0 +1,69 @@ +<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; +/** + * 说说页面 + * + * @package custom + */ +$this->need('includes/head.php'); +$this->need('includes/header.php'); +function threadedComments($comments, $options) { + $commentClass = ''; + if ($comments->authorId) { + if ($comments->authorId == $comments->ownerId) { + $commentClass .= ' comment-by-author'; //如果是文章作者的评论添加 .comment-by-author 样式 + } else { + $commentClass .= ' comment-by-user'; //如果是评论作者的添加 .comment-by-user 样式 + } + } + $commentLevelClass = $comments->_levels > 0 ? ' comment-child' : ' comment-parent'; //评论层数大于0为子级,否则是父级 +?> +<div id="li-<?php $comments->theId(); ?>" class="comment-body<?php +if ($comments->_levels > 0) { + echo ' comment-child'; + $comments->levelsAlt(' comment-level-odd', ' comment-level-even'); +} else { + echo ' comment-parent'; +} +$comments->alt(' comment-odd', ' comment-even'); +echo $commentClass; +?>"> + <div class="saying-item"> + <div class="saying-inner saying-header"> + <p class="saying-meta"> + <?php $comments->gravatar('100', ''); ?><span class="saying-author"><?php $comments->author(); ?></span><br> + <?php $comments->date('Y-m-d H:i'); ?> + </p> + </div> + <div class="saying-hr"></div> + <div class="saying-inner saying-middle"> + <?php echo Contents::parseEmo($comments->content); ?> + </div> + </div> +</div> +<?php } ?> + <main class="main-container container"> + <div class="saying-body"> + <?php if($this->user->hasLogin()): ?> + <form method="post" action="<?php $this->commentUrl() ?>" id="comment-form" class="saying-form" role="form"> + <p> + <textarea rows="8" cols="50" name="text" id="textarea" placeholder="<?php gtecho('sayingPageTexts','sayingPlaceholder'); ?>" class="OwO-textarea comment-textarea textarea" required ><?php $this->remember('text'); ?></textarea> + </p> + <p> + <button type="submit" class="comment-submit submit"><?php gtecho('sayingPageTexts','sayingSubmit'); ?></button> + </p> + </form> + <br> + <?php endif; ?> + <?php $this->comments()->to($comments); ?> + <?php $comments->listComments(array( + 'before' => '<div class="comment-list">', + 'after' => '</div>', + 'avatarSize' => 200, + 'dateFormat' => 'Y-m-d H:i' + )); ?> + <div class="comment-pagenav"> + <?php $comments->pageNav('<i class="iconfont icon-chevron-left comment-pagenav-icon"></i>', '<i class="iconfont icon-chevron-right comment-pagenav-icon"></i>'); ?> + </div> + </div> + </main> +<?php $this->need('includes/footer.php'); ?>
\ No newline at end of file |
