Files
Typecho-Theme-Puock/page-archives.php
T
浪子 c7efd5abd6 1.1.3
- 兼容typecho 1.3.0版本
    - 修复pjax黑暗模式下闪烁问题
    - 修复说说页面的pjax加载问题
    - 修复上一篇与下一篇文章的链接
    - 增加归属地显示设置
    - 增加系统显示设置
    - 增加浏览器信息显示设置
    - 修复pjax模式下的404跳转
2025-07-05 12:09:23 +08:00

58 lines
2.1 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
/**
* 文章归档
*
* @package custom
*/
if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
<?php $this->need('header.php'); ?>
<div id="breadcrumb" class="animated fadeInUp">
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a class="a-link" href="<?php $this->options->siteUrl(); ?>">首页</a></li>
<li class="breadcrumb-item active " aria-current="page"><?php $this->title() ?></li>
</ol>
</nav>
</div>
<div id="page-archives">
<div id="page" class="w-100">
<div id="posts" class="animated fadeInLeft ">
<div class="p-block puock-text">
<div class="timeline no-style">
<?php
$stat = Typecho_Widget::widget('Widget_Stat');
Typecho_Widget::widget('Widget_Contents_Post_Recent', 'pageSize=' . $stat->publishedPostsNum)->to($archives);
$year = 0;
$mon = 0;
$output = '';
while ($archives->next()) {
$year_tmp = date('Y', $archives->created);
$mon_tmp = date('m', $archives->created);
$day_tmp = date('d', $archives->created);
// 检查是否需要新的时间线项目
if ($year != $year_tmp || $mon != $mon_tmp) {
// 如果不是第一个项目,先关闭之前的ul
if ($year > 0 && $mon > 0) {
$output .= '</ul></div></div>';
}
$year = $year_tmp;
$mon = $mon_tmp;
// 开始新的时间线项目
$output .= '<div class="timeline-item">';
$output .= '<div class="timeline-location"></div>';
$output .= '<div class="timeline-content">';
$output .= '<h4>' . $year . '-' . $mon . '</h4>';
$output .= '<ul class="pd-links pl-0">';
}
// 输出文章项
$output .= '<li><a title="' . $archives->title . '" href="' . $archives->permalink . '">';
$output .= $archives->title . '&nbsp;&nbsp;' . $day_tmp . '日&nbsp;</a></li>';
}
// 循环结束后关闭最后的标签
if ($year > 0 && $mon > 0) {
$output .= '</ul></div></div>';
}
echo $output;
?>
</div></div></div></div></div>
<?php $this->need('footer.php'); ?>