forked from siseboy/junichi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
page-archives.php
executable file
·40 lines (37 loc) · 1.3 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
<?php
/**
* archives
*
* @package custom
*/
$this->need('header.php'); ?>
<div class="mid-col">
<div class="mid-col-container">
<article class="post post-archives">
<h1 class="title"><?php $this->title() ?></h1>
<div class="entry-content">
<?php $this->widget('Widget_Contents_Post_Recent', 'pageSize=10000')->to($archives);
$year=0; $mon=0; $i=0; $j=0;
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>';
if ($year != $year_tmp && $year > 0) $output .= '</ul>';
if ($year != $year_tmp) {
$year = $year_tmp;
}
if ($mon != $mon_tmp || ($mon == $mon_tmp && $y != $year_tmp)) {
$mon = $mon_tmp;
$output .= '<h3>'. $year_tmp .' 年 '. $mon_tmp .' 月</h3>';
$output .= '<ul>';
}
$output .= '<li><a href="'.$archives->permalink .'">'. $archives->title .'</a> ('.date('M j, Y',$archives->created).')</li>';
endwhile;
$output .= '</ul>';
echo $output;
?>
</div>
</article>
</div>
<?php $this->need('footer.php'); ?>