-
Notifications
You must be signed in to change notification settings - Fork 33
/
page_articles.php
155 lines (145 loc) · 4.21 KB
/
page_articles.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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit;
/**
* 归档页面(按月分类)
*
* @package custom
*/
?>
<?php $this->need('header.php'); ?>
<style>
.archive-list {
padding: 0px 10px;
position: relative;
}
.archive-year {
border-bottom: 1px solid #ebebeb;
}
.archive-year:before {
display: none;
}
.archive-item {
position: relative;
border-radius: 5px;
}
.archive-item:before,
.archive-item:after {
content: '';
z-index: 1;
position: absolute;
background: #F4645F;
width: 2px;
left: 7px;
margin-left: 12px;
height: 6px;
}
.archive-item:before{
top: 0px;
height: 6px;
}
.archive-item:after {
top: 26px;
height: calc(100% - 26px);
}
.archive-item:hover {
color: #ff5722;
background: #F4F4F4;
}
.archive-item:hover .meta::after {
background: #ff5722;
transform: scale(1);
}
.archive-item a:link,
.archive-item a:active,
.archive-item a:visited,
.archive-item a:hover {
text-decoration:none;
}
.meta {
padding: 6px 0;
line-height: 1.5;
height: auto;
max-width: 100%;
display: flex;
font-size: 16px;
font-weight: 500;
border-radius: 2px;
color: #888;
}
.meta:after {
content: '';
position: absolute;
top: 8px;
z-index: 2;
background: #F4645F;
margin-left: 14px;
margin-top: 2px;
width: 12px;
height: 12px;
border-radius: 6px;
transform: scale(0.5);
transition: all 0.28s ease;
-moz-transition: all 0.28s ease;
-webkit-transition: all 0.28s ease;
-o-transition: all 0.28s ease;
}
.meta time {
color: #888;
margin-left: 34px;
margin-right: 16px;
flex-shrink: 0;
}
</style>
<section class="content-wrap">
<div class="container">
<div class="row">
<main class="col-md-8 main-content">
<article id="arc" class="post">
<header class="post-head">
<div style="float: left;color: #BDBDBD;">很好! 目前共计<span style="font-weight:600;margin:0 3px;"><?php Typecho_Widget::widget('Widget_Stat')->to($stat)->publishedPostsNum(); ?></span>篇文章,继续加油呀~</div>
</header>
<section class="post-content">
<div id="archives" class="archive-list">
<?php $this->widget('Widget_Contents_Post_Recent', 'pageSize=10000')->to($archives);
$year=0; $mon=0; $i=0; $j=0;$output="";
// 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 .= '<h1 class="al_year">'. $year .' 年</h1>'; //输出年份
// }
// if ($mon != $mon_tmp) {
// $mon = $mon_tmp;
// $output .= '<h2 ><a style="color:#505050;" href="/'. $year .'/'. $mon .'/">'. $year .' 年 '. $mon .' 月</a></h2><ul class="al_post_list">'; //输出月份
// }
// //$output .= '<li>'.date('d日: ',$archives->created).'<a href="'.$archives->permalink .'">'. $archives->title .'</a>';
// $output .= '<li><a href="'.$archives->permalink .'">'. $archives->title .'</a>';
// $output .= ' <span style="color: #959595;">('.date('Y/m/d',$archives->created).')</span>';
// //$output .= '<em>('. $archives->commentsNum.'条评论)</em>';
// $output .= '</li>'; //输出文章日期和标题
// endwhile;
// $output .= '</ul>';
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 .= '<h2 class="archive-year">'. $year .'</h2>'; //输出年份
}
$output .= '<div class="archive-item"><a class="meta" href="'.$archives->permalink .'"><time>'.date('m/d',$archives->created).'</time>'. $archives->title .'</a></div>';
endwhile;
echo $output;
?>
</div>
</section>
</article>
</main>
<?php $this->need('sidebar.php'); ?>
</div>
</div>
</section>
<?php $this->need('footer.php'); ?>