update to 2.2

This commit is contained in:
2025-08-27 18:44:12 +08:00
parent 7806149558
commit e0c71e325c
30 changed files with 26905 additions and 492 deletions

View File

@@ -10,7 +10,7 @@
* Post
* 文章内容输出
* @author 明石
* @version 2.1
* @version 2.2
* @link https://imakashi.eu.org/
*/
@@ -24,7 +24,7 @@
<h2>
<?php if ($this->fields->AKAROMarticleSMS == 'sms'): //短讯SMS样式 ?>
<?php if(empty($this->title)): ?>
短讯一则
<br>
<?php else: ?>
<?php $this->title() ?>
<?php endif; ?>
@@ -33,7 +33,7 @@
<?php endif; ?>
</h2>
</div>
<div class="mdui-card-primary-subtitle"><h4><?php $this->author(); ?> · <?php $this->date('Y-m-d H:i'); ?> · <?php get_post_view($this) ?>浏览 · <?php $this->category(',', false, '无分类'); ?></h4></div>
<div class="mdui-card-primary-subtitle"><h4><?php $this->author(); ?> · <?php $this->date(); ?> · <?php get_post_view($this) ?>浏览 · <?php $this->category(',', false, '无分类'); ?></h4></div>
</div>
</div>
<div class="articlecardshadow"></div>
@@ -45,11 +45,7 @@
<?php elseif ($this->fields->AKAROMarticleimg != null): ?>
background-image: url('<?php $this->fields->AKAROMarticleimg(); ?>');
<?php else: ?>
<?php
// 固定文章ID生成固定的随机图片而不是每次刷新都随机
$randomNum = 1 + ($this->cid % 12);
?>
background-image: url('<?php $this->options->themeUrl("config/style/img/default/cover/{$randomNum}.webp"); ?>');
background-image: url('<?php $randomNum = mt_rand(1, 12);$this->options->themeUrl("config/style/img/default/cover/{$randomNum}.webp"); ?>');
<?php endif; ?>
">
</div>
@@ -59,7 +55,7 @@
<div class="LDtrans">
<div class="mdui-container">
<div class="akarom-articletag akarom-articletag-style blur mdui-shadow-1">
<div class="akarom-articletag akarom-articletag-style blur mdui-shadow-0">
<i class="mdui-list-item-icon mdui-icon material-icons">color_lens</i>
<div class="akarom-articletag-options">
<span class="akarom-hoverable" id="toggleFont" title="在黑体与宋体之间切换">切换字体</span>
@@ -75,13 +71,36 @@
<div class="article mdui-typo">
<?php echo Fancybox($this->content); ?>
<?php
$content = $this->content;
$tocResult = generateTOC($content);
// 显示目录
echo $tocResult['toc'];
$content = $tocResult['content'];
$content = Fancybox($content);
$content = parseCustomGitHubTag($content);
echo $content;
?>
<br>
<br>
</div>
<div class="hr mdui-typo">
<hr style="margin-bottom: 10px;">
<div class="mdui-dialog yuan blur" id="reward">
<div class="mdui-container mdui-center akarom-rewardbox">
<img class="btnyuan" src="<?php $this->options->AKAROMrewardimg(); ?>">
</div>
</div>
<div class="mdui-typo blur LDtrans yuan akarom-panel-copy">
<div class="akarom-corner-symbol-lb">&copy;</div>
<?php if($this->user->hasLogin()): ?>
@@ -99,11 +118,7 @@
<i class="mdui-icon material-icons">thumb_up</i><b>赞赏文章</b>
</span>
</span>
<div class="mdui-dialog yuan blur" id="reward">
<div class="mdui-container mdui-center akarom-rewardbox">
<img class="btnyuan" src="<?php $this->options->AKAROMrewardimg(); ?>">
</div>
</div>
<br>
<?php endif; ?>
<?php endif; ?>
@@ -111,26 +126,19 @@
<?php endif; ?>
<p class="copyright mdui-text-center">
文章最后更新时间<?php
if (class_exists('\Typecho\Date')) {
$modifiedDate = new \Typecho\Date($this->modified);
} else {
$modifiedDate = new Typecho_Date($this->modified);
}
echo $modifiedDate->format('Y年m月d日 H:i');
?>
最后更新时间:<?php echo date('Y年m月d日' , $this->modified); ?>
<?php if ($this->fields->AKAROMarticleCopyright != 'hide' && $this->fields->AKAROMarticleCopyright != null): ?>
<?php if ($this->fields->AKAROMarticleCopyright == 'SA'): ?>
<br>本文章版权声明: 遵循 <a target="_blank" href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh"> CC BY-NC-SA </a> 版权协议</p>
<br>遵循 <a target="_blank" href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh"> CC BY-NC-SA </a> 协议</p>
<?php elseif ($this->fields->AKAROMarticleCopyright == 'ND'): ?>
<br>本文章版权声明: 遵循 <a target="_blank" href="https://creativecommons.org/licenses/by-nc-nd/4.0/deed.zh"> CC BY-NC-ND </a> 版权协议</p>
<br>遵循 <a target="_blank" href="https://creativecommons.org/licenses/by-nc-nd/4.0/deed.zh"> CC BY-NC-ND </a> 协议</p>
<?php else: ?>
<br>本文章版权声明: <b>禁止转载</b></p>
<br>版权声明: <b>禁止转载</b></p>
<?php endif; ?>
<?php endif; ?>
<hr>
</div>
<?php $this->need('config/comments.php'); ?>
<br>
</div>