This repository has been archived by the owner on May 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy patharchive.php
59 lines (59 loc) · 2.94 KB
/
archive.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
<?php $this->need('header.php'); ?>
<div class="mdui-chip mdui-typo mdui-m-t-3">
<span class="mdui-chip-icon"><i class="mdui-icon materiality-icons"></i></span>
<span class="mdui-chip-title">您正在查看:<?php $this->archiveTitle([
'category' => _t(' %s 分类下的文章'),
'search' => _t('包含关键字 %s 的文章'),
'tag' => _t('标签 %s 下的文章'),
'author' => _t('%s 发布的文章')
], '', ''); ?></span>
</div>
<?php if ($this->have()): ?>
<?php while ($this->next()): ?>
<div class="mdui-card mdui-hoverable mdui-m-y-3">
<div class="mdui-card-primary">
<div class="mdui-card-primary-title"><a class="mdui-text-color-theme-accent" href="<?php $this->permalink(); ?>"><?php $this->title(); ?></a></div>
<div class="mdui-card-primary-subtitle mdui-text-color-theme-text">
<?php $this->date(); ?>
<?php if (!empty($this->options->article) && in_array('author', $this->options->article)): ?>
<span> |</span><i class="mdui-icon materiality-icons"></i><a href="<?php $this->author->permalink(); ?>"><?php $this->author(); ?></a>
<?php endif; ?>
<?php if ($this->category && !empty($this->options->article) && in_array('categories', $this->options->article)): ?>
<span> | </span><i class="mdui-icon materiality-icons"></i><?php $this->category(', '); ?>
<?php endif; ?>
</div>
</div>
<div class="mdui-card-content mdui-typo"><?php if (!empty($this->options->feature) && in_array('pangu', $this->options->feature)) echo "<pangu>"; ?><?php $this->content(); ?><?php if (!empty($this->options->feature) && in_array('pangu', $this->options->feature)) echo "</pangu>"; ?></div>
<div class="mdui-card-actions">
<a class="mdui-btn mdui-ripple mdui-text-color-theme-accent" href="<?php $this->permalink(); ?>">继续阅读</a>
</div>
</div>
<?php endwhile; ?>
<?php else: ?>
<div class="mdui-card mdui-m-y-3">
<div class="mdui-card-primary">
<div class="mdui-card-primary-title"><a class="mdui-text-color-theme-accent">没有找到内容</a></div>
</div>
<div class="mdui-card-content mdui-typo">
<div class="mdui-typo-title mdui-m-y-2">这些文章可能也很有趣?</div>
<?php getRandomPosts(5);?>
</div>
</div>
<?php endif; ?>
<?php ob_start(); ?>
<div class="mdui-m-y-3 page-nav">
<?php $this->pageNav('', '', 2, '...', [
'itemTag' => '',
'textTag' => 'span',
'currentClass' => 'mdui-btn-active',
'prevClass' => 'mdui-icon materiality-icons',
'nextClass' => 'mdui-icon materiality-icons',
'wrapTag' => 'div',
'wrapClass' => 'mdui-btn-group'
]); ?>
</div>
<?php $pageNavHTML = ob_get_contents(); ?>
<?php ob_end_clean(); ?>
<?php getPageNav($pageNavHTML, ceil($this->getTotal())); ?>
<?php $this->need('footer.php'); ?>