-
Notifications
You must be signed in to change notification settings - Fork 60
/
archives.php
93 lines (86 loc) · 2.68 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<?php
/**
* 归档页面
*
* @package custom
*/
if (!defined('__TYPECHO_ROOT_DIR__')) exit;
$this->need('layout/_partial/head.php');
?>
<style>
.nexmoe-archives li {
position: relative;
padding: 10px 0;
}
.nexmoe-archives li::before {
content: "";
width: 14px;
height: 14px;
background: #ff4e6a;
display: inline-block;
vertical-align: middle;
margin-top: -2px;
margin-right: 11px;
border-radius: 100%;
border: 3px solid #fff;
z-index: 100;
position: relative;
}
.nexmoe-archives ul {
list-style: none;
padding-left: 0 !important;
}
.nexmoe-archives li::after {
content: "";
height: 100%;
width: 2px;
background: rgba(255, 78, 106, .2);
position: absolute;
left: 6px;
top: 20px;
}
.nexmoe-archives span {
margin-right: 15px;
}
</style>
<body class="mdui-drawer-body-left">
<?php $this->need('layout/_partial/background.php'); ?>
<div id="nexmoe-header">
<?php $this->need('layout/_partial/header.php'); ?>
</div>
<div id="nexmoe-content">
<div class="nexmoe-primary">
<div class="nexmoe-archives">
<div class="nexmoe-post">
<article>
<?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 ($mon != $mon_tmp && $mon > 0) $output .= '</ul></li>';
if ($year != $year_tmp && $year > 0) $output .= '</ul>';
if ($year != $year_tmp) {
$year = $year_tmp;
$output .= '<h2 >' . $year . ' 年</h2><ul class="article1">';
}
$output .= '<li><span>' . date('n月d日 ', $archives->created) . '</span><a href="' . $archives->permalink . '">' . $archives->title . '</a></li>'; //输出文章日期和标题
endwhile;
$output .= '</ul></li></ul></div>';
echo $output;
?>
</article>
</div>
</div>
</div>
</div>
<?php $this->need('layout/_partial/after-footer.php'); ?>
</body>
</html>