summaryrefslogtreecommitdiffstats
path: root/pagefile.php
diff options
context:
space:
mode:
authorEltrac <45323514+BigCoke233@users.noreply.github.com>2019-07-11 18:55:48 +0800
committerGitHub <noreply@github.com>2019-07-11 18:55:48 +0800
commit27efb0e429817141e6009f0aefc79bdea17890fa (patch)
tree219d496cd79eebc34e2926672c139d19fb761563 /pagefile.php
parent79f92a1658063b9edbe2a1a9bd7a3dc57e1ce420 (diff)
🙉 The first release of Miracles 🙉
Diffstat (limited to 'pagefile.php')
-rw-r--r--pagefile.php53
1 files changed, 53 insertions, 0 deletions
diff --git a/pagefile.php b/pagefile.php
new file mode 100644
index 0000000..32e0b70
--- /dev/null
+++ b/pagefile.php
@@ -0,0 +1,53 @@
+<?php
+/**
+ * 归档页面
+ *
+ * @package custom
+ */
+if (!defined('__TYPECHO_ROOT_DIR__')) exit;
+$this->need('includes/head.php');
+$this->need('includes/header.php');
+?>
+
+ <main class="main-container container">
+ <div class="post-body">
+ <div class="post-content">
+ <h2>标签云</h2>
+ <?php $this->widget('Widget_Metas_Tag_Cloud', 'sort=mid&ignoreZeroCount=1&desc=0&limit=30')->to($tags); ?>
+ <?php if($tags->have()): ?>
+ <ul class="tags-list">
+ <?php while ($tags->next()): ?>
+ <li class="tags-item"><a href="<?php $tags->permalink(); ?>" rel="tag" class="no-line" title="有 <?php $tags->count(); ?> 篇文章在这个标签下"><?php $tags->name(); ?></a></li>
+ <?php endwhile; ?>
+ </ul>
+ <?php else: ?>
+ <p><?php _e('没有发现任何标签哦~'); ?></p>
+ <?php endif; ?>
+ <br />
+ <h2>文章归档</h2>
+ <ul class="archives-list">
+ <?php
+ $this->widget('Widget_Contents_Post_Recent', 'pageSize=10000')->to($archives);
+ $year=0; $mon=0; $i=0; $j=0;
+ $output = '<div id="archives">';
+ while($archives->next()):
+ $year_tmp = date('Y',$archives->created);
+ $mon_tmp = date('m',$archives->created);
+ $y=$year; $m=$mon;
+ if ($year != $year_tmp) {
+ $year = $year_tmp;
+ $output .= '<h3 class="archives-year">'. $year .' 年</h3>'; //输出年份
+ }
+ $mon = $mon_tmp;
+ $output .= '<li><a href="'.$archives->permalink .'" class="no-line"><span class="archives-date">'. $mon .'-'.date('d ',$archives->created).'</span>&nbsp;&nbsp;'. $archives->title .'</a></li>'; //输出文章日期和标题
+ endwhile;
+ $output .= '</li></div>';
+ echo $output;
+ ?>
+ </ul>
+ </div>
+ </div>
+ </main>
+
+
+<?php $this->need('includes/footer.php'); ?> \ No newline at end of file