summaryrefslogtreecommitdiffstats
path: root/saying.php
diff options
context:
space:
mode:
authorEltrac <45323514+BigCoke233@users.noreply.github.com>2019-12-21 21:56:30 +0800
committerGitHub <noreply@github.com>2019-12-21 21:56:30 +0800
commit6c07f07ca8423a6b6cc231feedb34e7f4082a989 (patch)
tree90aeda53699cca03a395a626bffc06dea7e7d04a /saying.php
parent94b623aa0c15d3bb0fd06b458d4966cc3e8e7ee3 (diff)
📍 Add: 添加说说页面
Diffstat (limited to 'saying.php')
-rw-r--r--saying.php73
1 files changed, 73 insertions, 0 deletions
diff --git a/saying.php b/saying.php
new file mode 100644
index 0000000..f62e488
--- /dev/null
+++ b/saying.php
@@ -0,0 +1,73 @@
+<?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 $comments->content(); ?>
+ </div>
+ </div>
+</div>
+<?php } ?>
+ <main class="main-container container">
+ <div class="saying-body">
+ <?php if($this->user->hasLogin()): ?>
+ <div class="saying-item">
+ <form method="post" action="<?php $this->commentUrl() ?>" id="comment-form" role="form">
+ <div class="container-fluid"><div class="row">
+ <p class="col-md-12">
+ <textarea rows="8" cols="50" name="text" id="textarea" class="OwO-textarea comment-textarea textarea" required ><?php $this->remember('text'); ?></textarea>
+ </p>
+ </div></div>
+ <p class="comment-submit col-md-12">
+ <button type="submit" class="submit"><?php _e('发表新鲜事'); ?></button>
+ </p>
+ </form>
+ <br>
+ </div>
+ <?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