-
Notifications
You must be signed in to change notification settings - Fork 18
/
archive-time.php
41 lines (33 loc) · 1.07 KB
/
archive-time.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
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
<?php
/**
* archive-time
*
* @package custom
*/
$this->need('header.php'); ?>
<div id="pjax-container">
<div class="footer-clear archive">
<?php
$this->widget('Widget_Contents_Post_Recent', 'pageSize=10000')->to($archives);
$year=0; $i=0; $j=0;
$output = '';
while($archives->next()):
$year_tmp = date('Y',$archives->created);
$y=$year;
if ($year != $year_tmp && $year > 0) $output .= '';
if ($year != $year_tmp) {
$year = $year_tmp;
$output .= '<h2 class="archive-year">'. $year .'</h2>';
}
$output .= '<li><a class="transition archive-iterm" href="'.$archives->permalink .'"><h3 class="archive-title">'. $archives->title .'</h3><p class="archive-date">'.date('F jS ',$archives->created).'</p></a></li>';
endwhile;
$output .= '';
echo $output;
?>
<!-- footer -->
<?php $this->need('footer.php'); ?>
</div>
</div>
<!-- menu -->
<?php $this->need('menu.php'); ?>