This repository has been archived by the owner on May 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
archives.php
59 lines (58 loc) · 1.99 KB
/
archives.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;
/**
* 「归档」页面
*
* @author Stsr_caorui
* @for Star-caorui/Better
*
* @package custom
*/
$this->need('template/header.php'); ?>
<div class="better-blank"></div>
<div class="mdui-card mdui-hoverable postCard">
<div class="mdui-card-media">
<div class="page-img">
<img src="<?php echo toolkit::randomImg(); ?>"/>
</div>
<div class="mdui-card-menu">
<button class="mdui-btn mdui-btn-icon mdui-text-color-white">
<i class="mdui-icon material-icons">share</i>
</button>
</div>
<div class="mdui-card-media-covered">
<div class="mdui-card-primary">
<div class="mdui-card-primary-title mdui-text-truncate"><?php $this->title() ?></div>
</div>
</div>
</div>
<div class="article-page mdui-typo">
<?php $this->content();
$this->widget('Widget_Contents_Post_Recent', 'pageSize=256000')->to($archives);
$year=0; $mon=0;
$output = '<div id="archives">';
while($archives->next()) {
$year_tmp = date('Y',$archives->created);
$mon_tmp = date('m',$archives->created);
if($mon != $mon_tmp && $mon > 0) {
$output .= '</ul></li>';
}
if($year != $year_tmp && $year > 0) {
$output .= '</ul>';
}
if($year != $year_tmp) {
$year = $year_tmp;
$output .= '<h3>'. $year .' 年</h3><ul>';
}
if($mon != $mon_tmp) {
$mon = $mon_tmp;
$output .= '<li><h4 class="al_mon">'. $mon .' 月</h4><ul class="al_post_list">';
}
$output .= '<li>'.date('d日:',$archives->created).'<a href="'.$archives->permalink .'">'. $archives->title .'</a> </li>';
}
$output .= '</ul></li></ul></div>';
echo $output; ?>
</div>
</div>
<div class="better-blank"></div>
<?php $this->need('template/comments.php'); ?>
<?php $this->need('template/footer.php'); ?>