修复部分小问题
This commit is contained in:
浪子 2025-06-27 09:09:47 +08:00
parent 05a83e5879
commit 8ab8213a12
4 changed files with 45 additions and 50 deletions

View File

@ -3,6 +3,7 @@
<?php while ($this->next()): ?>
<?php
$coverImage = getPostCover($this->content, $this->cid);
$colors = ['bg-primary', 'bg-secondary', 'bg-success', 'bg-danger', 'bg-warning', 'bg-info', 'bg-transparent', 'bg-gradient'];
?>
<article class="block card-plain post-item col-md-6 col-12 post-item-card">
<div class="p-block post-item-block">
@ -19,7 +20,7 @@ $coverImage = getPostCover($this->content, $this->cid);
<div class="post-info">
<h2 class="info-title">
<?php foreach($this->categories as $category): ?>
<a class="badge d-none d-md-inline-block bg-primary ahfff"
<a class="badge d-none d-md-inline-block <?php echo $colors[array_rand($colors)]; ?> ahfff"
href="<?php echo $category['permalink']; ?>">
<i class="fa-regular fa-folder-open"></i> <?php echo $category['name']; ?>
</a>
@ -37,7 +38,7 @@ $coverImage = getPostCover($this->content, $this->cid);
<span class="mr-2">
<i class="fa-regular fa-eye mr-1"></i>
<span class="view">浏览:<?php get_post_view($this) ?></span>
<span class="t-sm d-none d-sm-inline-block">阅读</span>
<span class="t-sm d-none d-sm-inline-block"></span>
</span>
<a class="c-sub-a" href="<?php $this->permalink() ?>#comments">
<i class="fa-regular fa-comment mr-1"></i>

View File

@ -6,47 +6,43 @@
*/
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>
<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>
<?php $commenters = getAllCommenters(); ?>
<div id="page-reads">
<div id="page" class="row row-cols-1">
<div id="posts" class="col-lg-8 col-md-12 animated fadeInLeft ">
<div class="p-block puock-text">
<h2 class="t-lg"><?php $this->title() ?></h2>
<div class="mt20 row pd-links">
<?php foreach ($commenters as $commenter): ?>
<div class="col col-6 col-md-4 col-lg-3 pl-0">
<div class="p-2 text-truncate text-nowrap">
<?php if ($commenter['url']): ?>
<a href="<?php echo htmlspecialchars($commenter['url']); ?>" target="_blank" rel="nofollow">
<img data-bs-toggle="tooltip" src='<?php $this->options->themeUrl('assets/img/load.svg'); ?>' class='lazy md-avatar' data-src='<?php echo htmlspecialchars($commenter['avatar']); ?>' title="<?php echo htmlspecialchars($commenter['nickname']); ?>" alt="<?php echo htmlspecialchars($commenter['nickname']); ?>">
<span class="t-sm">
<span class="c-sub">+(<?php echo $commenter['comment_count']; ?>)&nbsp;</span>
<?php echo htmlspecialchars($commenter['nickname']); ?></span>
</a>
<?php else: ?>
<img data-bs-toggle="tooltip" src='<?php $this->options->themeUrl('assets/img/load.svg'); ?>' class='lazy md-avatar' data-src='<?php echo htmlspecialchars($commenter['avatar']); ?>' title="<?php echo htmlspecialchars($commenter['nickname']); ?>" alt="<?php echo htmlspecialchars($commenter['nickname']); ?>">
<span class="t-sm">
<span class="c-sub">+(<?php echo $commenter['comment_count']; ?>)&nbsp;</span>
<?php echo htmlspecialchars($commenter['nickname']); ?>
</span>
<?php endif; ?>
</div>
</div>
</nav>
</ol>
<?php $commenters = getAllCommenters(); ?>
<div id="page-reads">
<div id="page" class="row row-cols-1">
<div id="posts" class="col-lg-8 col-md-12 animated fadeInLeft ">
<div class="p-block puock-text">
<h2 class="t-lg"><?php $this->title() ?></h2>
<div class="mt20 row pd-links">
<?php foreach ($commenters as $commenter): ?>
<div class="col col-6 col-md-4 col-lg-3 pl-0">
<div class="p-2 text-truncate text-nowrap">
<?php if ($commenter['url']): ?>
<a href="<?php echo htmlspecialchars($commenter['url']); ?>"
target="_blank" rel="nofollow">
<img data-bs-toggle="tooltip"
src='<?php $this->options->themeUrl('assets/img/load.svg'); ?>'
class='lazy md-avatar'
data-src='<?php echo htmlspecialchars($commenter['avatar']); ?>'
title="<?php echo htmlspecialchars($commenter['nickname']); ?>" alt="<?php echo htmlspecialchars($commenter['nickname']); ?>"> <span class="t-sm"><span
class="c-sub">+(<?php echo $commenter['comment_count']; ?>)&nbsp;</span><?php echo htmlspecialchars($commenter['nickname']); ?></span> </a>
<?php else: ?>
<img data-bs-toggle="tooltip"
src='<?php $this->options->themeUrl('assets/img/load.svg'); ?>'
class='lazy md-avatar'
data-src='<?php echo htmlspecialchars($commenter['avatar']); ?>'
title="<?php echo htmlspecialchars($commenter['nickname']); ?>" alt="<?php echo htmlspecialchars($commenter['nickname']); ?>">
<span class="t-sm">
<span class="c-sub">+(<?php echo $commenter['comment_count']; ?>)&nbsp;</span><?php echo htmlspecialchars($commenter['nickname']); ?></span>
<?php endif; ?>
</div>
</div>
<?php endforeach; ?>
</div>
</div>
</div>
<?php $this->need('sidebar.php'); ?>
<?php endforeach; ?>
</div>
</div>
</div>
<?php $this->need('sidebar.php'); ?>
<?php $this->need('footer.php'); ?>

View File

@ -15,7 +15,7 @@ if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
</nav>
</div>
<div id="page-links">
<div id="page-24" class="row row-cols-1">
<div class="row row-cols-1">
<div id="posts" class="col-12 animated fadeInLeft ">
<div class="puock-text no-style">
<p><?php $this->content(); ?></p>

View File

@ -23,9 +23,9 @@
<div class="option puock-bg ta3 t-sm mr-1">
<i class="fa-regular fa-eye mr-1"></i>
<span id="post-views">
<span class="view">浏览:<?php get_post_view($this) ?></span>
<span class="view"><?php get_post_view($this) ?></span>
</span>
<span>阅读</span>
<span>浏览</span>
</div>
<a href="#comments">
<div class="option puock-bg ta3 t-sm mr-1">
@ -52,19 +52,17 @@ $wordCount = mb_strlen($content, 'UTF-8');
?>
<div class="mt20 entry-content-box">
<div class="entry-content show-link-icon content-main puock-text ">
<p class="fs12 c-sub no-indent"> <i class="fa-regular fa-clock"></i> 共计<?php echo $wordCount; ?>个字符,预计需要花费 <?php echo ceil($wordCount / 100); ?>分钟才能阅读完成。 </p>
<p class="fs12 c-sub no-indent"> <i class="fa-regular fa-clock"></i> 共计<?php echo $wordCount; ?>个字符,预计需要花费 <?php echo ceil($wordCount / 800); ?>分钟才能阅读完成。 </p>
<p class="fs12 c-sub">
<?php
$modified = $this->modified;
$now = time();
$days = ($now - $modified) / 86400;
if($days > 180){
echo '<i class="fa fa-circle-exclamation me-1"></i> 本文最后更新于 ' . date('Y-m-d H:i', $modified) . ',文中所关联的信息可能已发生改变,请知悉!';
}
?>
</p>
<p><?php $this->content(); ?></p>
</div>
<div class="t-separator c-sub t-sm mt30">正文完</div>