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
| <div class="post list"> <h1 class="posttitle">📝全部文章</h1> <section id="articles-list"> <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="搜索..."> </form> <section> <?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 .= '<div class="post-row"><h2>' . date('Y', $archives->created) . '</h2></div>'; } 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>
|