-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy patharchives.php
74 lines (74 loc) · 3.81 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
<?php
/**
* 归档页面
*
* @package custom
*/
if (!defined('__TYPECHO_ROOT_DIR__')) exit;
$this->need('layout/header.php');
?>
<div class="container">
<div class="row">
<div class="col col-lg-2 col-md-2 col-sm-2 col-xs-2 d-none d-lg-block left">
<?php $this->need('layout/left.php'); ?>
</div>
<div class="col-lg-10 col-md-12 col-xs-10">
<div class="container">
<div class="row">
<div class="main">
<?php $this->need('component/index.toolbar.php'); ?>
<main class="article-main" id="post-<?php $this->cid(); ?>">
<!--文章内容-->
<div class="markdown-body article-content gallery">
<?php $this->widget('Widget_Metas_Tag_Cloud', array('sort' => 'count', 'ignoreZeroCount' => true, 'desc' => true))->to($tags); ?>
<?php if ($tags->have()) : ?>
<div class="article-label">
<ul>
<?php while ($tags->next()) : ?>
<li class="tags-item">
<a href="<?php $tags->permalink(); ?>"><?php $tags->name(); ?></a>
</li>
<?php endwhile; ?>
</ul>
</div>
<?php endif; ?>
<div class="article-archives">
<?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);
if ($mon != $mon_tmp && $mon > 0) $output .= '</ul></div>';
if ($year != $year_tmp && $year > 0) $output .= '</ul></div>';
if ($mon != $mon_tmp) {
$mon = $mon_tmp;
$output .= '<div class="item"><span class="panel">' . $year_tmp . ' 年 ' . $mon . ' 月<svg class="icon" aria-hidden="true"><use xlink:href="#icon-xiala-"></use></svg></span><ul class="panel-body">';
}
$output .= '<li><a href="' . $archives->permalink . '">' . date('m/d:', $archives->created) . $archives->title . '</a>';
$output .= '</li>';
endwhile;
$output .= '</ul></div>';
echo $output;
?>
</div>
</div>
</main>
</div>
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 right d-none d-lg-block">
<?php $this->need('layout/right.php'); ?>
</div>
</div>
</div>
</div>
<div class="col-12 d-lg-none" style="text-align:center">
<?php $this->need('layout/footer.php'); ?>
</div>
</div>
</div>
<?php $this->need('component/js.php'); ?>
</body>
</html>