forked from newraina/typecho-theme-NexTPisces
-
Notifications
You must be signed in to change notification settings - Fork 0
/
search.php
66 lines (63 loc) · 2.56 KB
/
search.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
63
64
65
66
<?php if (!defined('__TYPECHO_ROOT_DIR__')) {
exit;
}
?>
<?php $this->need('header.php'); ?>
<main id="main" class="main">
<div class="main-inner">
<div class="content-wrap">
<div id="content" class="content">
<section id="posts" class="posts-collapse">
<span class="archive-move-on"></span>
<span class="archive-page-counter">
<?php $this->archiveTitle(array(
'category' => _t('分类 %s 下的文章'),
'search' => _t('包含关键字 %s 的文章'),
'tag' => _t('标签 %s 下的文章'),
'author' => _t('%s 发布的文章'),
), '', ''); ?> </span>
<?php
$year = 0;
$mon = 0;
$i = 0;
$j = 0;
$output = '';
while ($this->next()):
$year_tmp = date('Y', $this->created);
$mon_tmp = date('m', $this->created);
//var_dump($year_tmp);
$y = $year;
$m = $mon;
//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="al_year">'. $year .' 年</div><ul class="al_mon_list">'; //输出年份
$output .= '<div class="collection-title">
<h2 class="archive-year motion-element" id="archive-year-' . $year . '">' . $year . '</h2>
</div>
'; //输出年份
}
$output .= '<article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
<header class="post-header">
<h1 class="post-title">
<a class="post-title-link" href="' . $this->permalink . '" itemprop="url">
<span itemprop="name">' . $this->title . '</span>
</a>
</h1>
<div class="post-meta">
<time class="post-time" itemprop="dateCreated" datetime="' . date('c', $this->created) . '" content="' . date('yy-m-d', $this->created) . '">' . date('m-d', $this->created) . '</time>
</div>
</header>
</article>
';
endwhile;
echo $output;
?>
</section>
</div>
</div>
<?php $this->need('sidebar.php'); ?>
</div>
</main>
<?php $this->need('footer.php'); ?>