-
Notifications
You must be signed in to change notification settings - Fork 33
/
page-archive.php
47 lines (43 loc) · 1.82 KB
/
page-archive.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
<?php
/**
* Template Page of Timeline Archives
*
* @package custom
*/
?>
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
<?php $this->need('component/header.php'); ?>
<div id="main" class="main" role="main">
<div class="main-inner">
<div class="content-wrap is-timeline">
<?php Typecho_Widget::widget('Widget_Stat')->to($stat); ?>
<h1 class="timeline-meta"> <?php _e('发表了 ' . $stat->publishedPostsNum . ' 篇文章,有 ' . $stat->publishedCommentsNum . ' 条评论') ?></h1>
<div class="timeline-wrap">
<?php
$this->widget('Widget_Contents_Post_Recent', 'pageSize=' . $stat->publishedPostsNum)->to($archives);
$year = 0;
$f = false;
$output = '';
while ($archives->next()) {
$year_tmp = date('Y', $archives->created);
if ($year != $year_tmp) {
$year = $year_tmp;
$output .= $f ? "</div>" : $output;
$output .= '<h1 class="archive-timeline-title" itemprop="name headline">'
. date('Y', $archives->created) .
'</h1><div class="archive-timeline-group">';
$f = true;
}
$output .= '
<li class="archive-post" itemtype="http://schema.org/BlogPosting">
<span class="post-meta"> ' . date('m/j', $archives->created) . '</span>
<h2 class="archive-post-title"><a href="' . $archives->permalink . '">' . $archives->title . '</a></h2>
</li>';
}
echo $output;
?>
</div>
</div>
</div>
</div>
<?php $this->need('component/footer.php'); ?>