-
Notifications
You must be signed in to change notification settings - Fork 0
/
page_archives.php
87 lines (87 loc) · 2.33 KB
/
page_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
<?php
/*
Custom:page_archives
Description:归档
*/
if (!defined('EMLOG_ROOT')) {exit('error!');} ?>
<style>
.page-main{
background-color:#fff;
width:960px;
margin:0px auto 0px auto;
}
@media screen and (max-width: 960px) {
.page-main {width: 100%;}
}
</style>
<section class="page-main">
<ol class="am-breadcrumb">
<li><a href="<?php echo BLOG_URL; ?>" class="am-icon-home">首页</a></li>
<li class="am-active"><?php echo $log_title; ?></li>
</ol>
<div class="am-article-hd">
<h1 class="am-article-title"><?php echo $log_title; ?></h1>
<p class="am-article-meta">
<div>
<small>
<a href="<?php echo Url::author($author); ?>" rel="author"><?php echo $user_cache[$author]['name']; ?></a> 发布 | <?php echo gmdate('Y-n-j', $date); ?> | 评论数:<?php echo $comnum;?> | 阅读数:<?php echo $views;?> | 标签:<?php blog_tag($logid); ?>
</small>
</div>
</p>
</div>
<div class="am-panel-group" id="accordion">
<?php
global $CACHE;
$record_cache = $CACHE->readCache('record');
?>
<?php
$i=1;$year=0; $mon=0;
$output = "";
$db = Database::getInstance();
$sql = "SELECT gid, title, date,views FROM " . DB_PREFIX . "blog WHERE type='blog' and hide='n' $condition";
$result = $db->query($sql);
while ($row = $db->fetch_array($result)) {
$log_url = Url::log($row['gid']);
$year_tmp = date('Y',$row['date']);
$mon_tmp = date('m',$row['date']);
if ($mon != $mon_tmp && $mon > 0){
$output .= '
</ul>
</div>
</div>
</div>
'; //结束拼接
}
if ($year != $year_tmp && $year > 0){
}
if ($year != $year_tmp) {
$year = $year_tmp;
}
if ($mon != $mon_tmp) {
$mon = $mon_tmp;
$output .= "
<div class=\"am-panel am-panel-default\">
<div class=\"am-panel-hd\">
<h4 class=\"am-panel-title\" data-am-collapse=\"{parent: '#accordion', target: '#do-not-say-".$i."'}\">".$year."年".$mon."月
</h4>
</div>
<div id=\"do-not-say-".$i."\" class=\"am-panel-collapse am-collapse\">
<div class=\"am-panel-bd\">
<ul>
";
}
$output .= "
<li>时间:<time>".date('d日',$row['date'])."</time> 标题:<a href=\"".$log_url."\">".$row['title']."</a></li>
";
$i++;
}
echo $output.'
</ul>
</div>
</div>
</div>
';
?>
</div>
</section>
<?php include View::getView('footer');?>