This repository has been archived by the owner on Dec 10, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
activity_archives.php
62 lines (55 loc) · 3.09 KB
/
activity_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
<?php
/**
* 归档
*
* @package custom
*/
if (!defined('__TYPECHO_ROOT_DIR__')) exit;
$krait = declareInterfaces();
include 'activity/activity_main_header.php';
include 'activity/adapter/adapter_author.php';
?>
<div class="archives content-wrap">
<article class="major-article content-wrap" itemscope itemtype="http://schema.org/BlogPosting">
<div class="post-archive">
<?php $this->widget('Widget_Contents_Post_Recent', 'pageSize=10000')->to($archives);
$year=0; $mon=0; $i=0; $j=0;
$ml = $archives->options->rootUrl;
$output = '';
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 .= '</div>';
if ($year != $year_tmp) {
$year = $year_tmp;
$output .= ' <div class="major-mdui-list" data-date="'. $year .'"><h3>'. $year .'</h3>'; //输出年份
if ($mon == $mon_tmp){
$year = $year_tmp;
$mon = $mon_tmp;
if ($this->options->rewrite==0){
$output .= '<ul class="mdui-list" data-date="'. $year .''. $mon .'"><li class="mdui-subheader"><a class="guidang" href="' . $ml . '/index.php/'. $year .'/'. $mon .'">'. $mon .'月</a></li>'; //输出月份
}else{
$output .= '<ul class="mdui-list" data-date="'. $year .''. $mon .'"><li class="mdui-subheader"><a class="guidang" href="' . $ml . '/index.php/'. $year .'/'. $mon .'">'. $mon .'月</a></li>'; //输出月份
}
}
}
if ($mon != $mon_tmp){
$year = $year_tmp;
$mon = $mon_tmp;
if ($this->options->rewrite==0){
$output .= '<ul class="mdui-list" data-date="'. $year .''. $mon .'"><li class="mdui-subheader"><a class="guidang" href="' . $ml . '/index.php/'. $year .'/'. $mon .'">'. $mon .'月</a></li>'; //输出月份
}else{
$output .= '<ul class="mdui-list" data-date="'. $year .''. $mon .'"><li class="mdui-subheader"><a class="guidang" href="' . $ml . '/index.php/'. $year .'/'. $mon .'">'. $mon .'月</a></li>'; //输出月份
}
}
$output .= '<li class="mdui-list-item" data-date="'. $year .''. $mon .''.date('d',$archives->created).'"><a class="guidang" href="'.$archives->permalink .'">'. $archives->title .'</a></li>';
endwhile;
$output .= '</div>';
echo $output;
?>
</div>
<?php include 'activity/activity_main_footer.php'; ?>
</article>
</div>