-
Notifications
You must be signed in to change notification settings - Fork 56
/
articles.php
57 lines (57 loc) · 2.38 KB
/
articles.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
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
<?php
/**
* 归档
*
* @package custom
*/
$this->need('page_header.php');
?>
<main class="layout" id="content-inner">
<div id="archive">
<section class="page-title">
<?php if($this -> authorId == $this -> user -> uid): ?>
<?php endif; ?>
</section>
<?php $this->widget('Widget_Contents_Post_Recent', 'pageSize=1000')->to($archives); Typecho_Widget::widget('Widget_Stat')->to($stat);
$year=0; $mon=0; $i=0; $j=0;
$output = '<div class="article-sort-title">文章总览 - '.$stat->publishedPostsNum.' </div><div class="article-sort"> ';
while($archives->next()):
$year_tmp = date('Y',$archives->created);
$mon_tmp = date('m',$archives->created);
$y=$year; $m=$mon;
$erro = "'https://tva1.sinaimg.cn/large/007X0Rdyly1gpaaf55n1rj30ic09u0sw.jpg'";
if ($mon != $mon_tmp && $mon > 0) $output .= '</ul></li>';
if ($year != $year_tmp && $year > 0) $output .= '</ul>';
if ($year != $year_tmp) {
$year = $year_tmp;
$output .= '<div class="article-sort-item year">'. $year .' 年</div>'; //输出年份
}
$output .= '<div class="article-sort-item">';
if(noCover($archives)){
$output .= '<a class="article-sort-item-img" href="'.$archives->permalink .'">
<img onerror="this.onerror=null;this.src='.$erro.'" src="'.get_ArticleThumbnail($archives).'" alt="'. $archives->title .'">
</a>';
}
$output .= '
<div class="article-sort-item-info">
<div class="article-sort-item-time">
<i class="far fa-calendar-alt"></i>
<time class="post-meta-date-created" datetime=" '.date('Y-m-d',$archives->created).'" title="发表于 '.date('Y-m-d',$archives->created).'">
'.date('Y-m-d',$archives->created).'
</time>
</div>
<a class="article-sort-item-title" href="'.$archives->permalink .'" title="'. $archives->title .'">
'. $archives->title .'
</a>
</div>
</div>'; //输出文章日期和标题
endwhile;
echo $output;
?>
</div>
</div>
<?php $this->need('sidebar.php'); ?>
<style>.card-recent-post{display:none}#to_comment{display: none!important;}</style>
</main>
<?php $this -> need('footer.php'); ?>