-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathpage-articles.php
executable file
·49 lines (49 loc) · 1.92 KB
/
page-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
<?php
/**
* Articles
*
* @package custom
*/
if (!defined('__TYPECHO_ROOT_DIR__')) exit;
$this->need('header.php');
?>
<main>
<header>
<div class="container">
<h1>Articles</h1>
<p class="subtitle">All articles that I write.</p>
</div>
</header>
<section>
<div class="container">
<form id="search" method="post" action="<?php $this->options->siteUrl(); ?>" role="search">
<input id="search-query" type="text" id="s" name="s" class="text" placeholder="Search for anything...">
</form>
<section id="articles-list">
<?php
$stat = Typecho_Widget::widget('Widget_Stat');
$this->widget('Widget_Contents_Post_Recent', 'pageSize=' . $stat->publishedPostsNum)->to($archives);
$year = 0;
$mon = 0;
$i = 0;
$j = 0;
$output = '<section>';
while ($archives->next()) {
$year_tmp = date('Y', $archives->created);
if ($year != $year_tmp) {
$year = $year_tmp;
$output .= '<h2>' . date('Y', $archives->created) . '</h2>';
}
if ($this->options->PjaxOption && $archives->hidden) {
$output .= '<div class="post"><a href="' . $archives->permalink . '"><div class="post-row"><time>' . date('M j', $archives->created) . '</time><h3>'. $archives->title . '</h3></div></a></div>';
} else {
$output .= '<div class="post"><a href="' . $archives->permalink . '"><div class="post-row"><time>' . date('M j', $archives->created) . '</time><h3>'. $archives->title . '</h3></div></a></div>';
}
}
$output .= '</section>';
echo $output;
?>
</div>
</section>
</main>
<?php $this->need('footer.php'); ?>