Skip to content

Commit

Permalink
🎉 Perf: 一些小改动
Browse files Browse the repository at this point in the history
  • Loading branch information
BigCoke233 authored Oct 6, 2019
1 parent cb42cfd commit 043c72d
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion includes/comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<span class="comment-reply">
<?php $comments->reply('<i class="iconfont icon-return"></i>'); ?>
</span>
<?php $comments->content(); ?>
<?php Contents::commentsParent($comments); $comments->content(); ?>
</div>
<p class="comment-meta">
<span class="comment-author"><?php $comments->author(); ?></span>
Expand Down
5 changes: 1 addition & 4 deletions includes/head.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,4 @@
<link href="https://fonts.googleapis.com/css?family=Noto+Sans+SC:300|Noto+Serif+SC:300&display=swap" rel="stylesheet">
<style>.body-dark .pio-action .pio-home{background-image: url(<?php Utils::indexTheme('images/icons/home.png'); ?>);}.body-dark .pio-action .pio-close{background-image: url(<?php Utils::indexTheme('images/icons/remove.png'); ?>);}.body-dark .pio-action .pio-skin{background-image: url(<?php Utils::indexTheme('images/icons/skin.png'); ?>);}.body-dark .pio-action .pio-info{background-image: url(<?php Utils::indexTheme('images/icons/info.png'); ?>);}.body-dark .pio-action .pio-night{background-image: url(<?php Utils::indexTheme('images/icons/night.png'); ?>);}@media (min-width:992px) {.search{background-image:url(<?php Utils::indexTheme('images/search.png'); ?>);}.login{background-image:url(<?php Utils::indexTheme('images/login.png'); ?>)}}.search {background-position: bottom right;background-repeat: no-repeat}.login {background-position: bottom left;background-repeat:no-repeat}<?php $this->options->cssEcho(); ?></style>
</head>
<body class="<?php if($this->options->bodyFonts && $this->options->bodyFonts=1): ?> body-serif<?php endif; ?><?php if($this->options->grayTheme && $this->options->grayTheme=1): ?> body-gray<?php endif; ?> body-contentsize-normal">
<!--[if lt IE 9]>
<div class="message error browsehappy" role="dialog">当前网页 <strong>不支持</strong> 你正在使用的浏览器. 为了正常的访问, 请 <a href="http://browsehappy.com/">升级你的浏览器</a>.</div>
<![endif]-->
<body class="<?php if(date("H") > 20 || date("H") < 7){echo 'body-dark';} ?><?php if($this->options->bodyFonts && $this->options->bodyFonts=1): ?> body-serif<?php endif; ?><?php if($this->options->grayTheme && $this->options->grayTheme=1): ?> body-gray<?php endif; ?> body-contentsize-normal">
4 changes: 3 additions & 1 deletion includes/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,9 @@
<p><?php $this->options->bannerIntro(); ?></p>
<?php elseif($this->is('post') || $this->is('page')): ?>
<h1><?php $this->title(); ?></h1>
<p class="header-meta"><?php if($this->is('post')): ?><i class="iconfont icon-block"></i> <?php $this->category(','); ?>&emsp;<?php endif; ?><i class="iconfont icon-comments"></i> <?php $this->commentsNum('None', 'Only 1', '%d'); ?>&emsp;<i class="iconfont icon-clock"></i> <?php $this->date(); ?></p>
<p class="header-meta">
<?php if($this->fields->meta==''): ?><?php if($this->is('post')): ?><i class="iconfont icon-block"></i> <?php $this->category(','); ?>&emsp;<?php endif; ?><i class="iconfont icon-comments"></i> <?php $this->commentsNum('None', 'Only 1', '%d'); ?>&emsp;<i class="iconfont icon-clock"></i> <?php $this->date(); ?><?php else: echo $this->fields->meta; endif; ?>
</p>
<?php else: ?><?php endif; ?>
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions libs/Contents.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit;

/*
* 该主体代码来自 熊猫小A(AlanDecode) 的项目,感谢~
* 该文件大部分代码来自 熊猫小A(AlanDecode) 的项目,感谢~
* https://github.com/AlanDecode/typecho-theme-dev-framework
*/

Expand Down Expand Up @@ -55,7 +55,7 @@ static public function parseContent($data, $widget, $last)
* 通过查询数据库
* 获取上级评论人
*/
public static function getParent($comment)
public static function commentsParent($comment)
{
$recipients = [];
$db = Typecho_Db::get();
Expand Down Expand Up @@ -180,4 +180,4 @@ public static function getRecentComments($num = 10)

return $comments;
}
}
}
8 changes: 5 additions & 3 deletions libs/Options.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* 主题后台设置
*/
function themeConfig($form) {

/**
* 主题设置备份
* From https://qqdie.com/archives/typecho-templates-backup-and-restore.html
Expand Down Expand Up @@ -62,8 +63,9 @@ function themeConfig($form) {
echo '<link rel="stylesheet" href="/usr/themes/Miracles/assets/css/setting.miracles.css"><link href="https://fonts.googleapis.com/css?family=Noto+Sans+SC:300|Noto+Serif+SC:300&display=swap" rel="stylesheet">';
echo '<div class="miracles-pannel">
<h1>Miracles 主题设置面板</h1>
<p>欢迎使用 Miracles 主题,目前版本是:'. $ver .'</span><br>
作者博客:<a href="https://guhub.cn">Eltrac\'s</a> | 帮助文档:<a href="https://github.com/BigCoke233/miracles/wiki">WIKI</a> | 问题反馈:<a href="https://github.com/BigCoke233/miracles/issues">issues</a></p>
<p>欢迎使用 Miracles 主题,目前版本是:'. $ver .'<br>
作者博客:<a href="https://guhub.cn">Eltrac\'s</a> | 帮助文档:<a href="https://github.com/BigCoke233/miracles/wiki">WIKI</a> | 问题反馈:<a href="https://github.com/BigCoke233/miracles/issues">issues</a>
</p>
<form class="protected" action="?MiraclesBackup" method="post">
<input type="submit" name="type" class="miracles-backup-button backup" value="备份模板数据" />&nbsp;&nbsp;
<input type="submit" name="type" class="miracles-backup-button recover" value="还原模板数据" />&nbsp;&nbsp;
Expand Down Expand Up @@ -103,7 +105,7 @@ function themeConfig($form) {
$form->addInput($CDN);

//custom style
$grayTheme = new Typecho_Widget_Helper_Form_Element_Select('grayTheme',array('0'=>'关闭','1'=>'开启'),'0','<h2>个性化</h2>哀悼模式','为京阿尼纵火事件而设计的开关,打开后网站变为黑白,Pray for 京阿尼');
$grayTheme = new Typecho_Widget_Helper_Form_Element_Select('grayTheme',array('0'=>'关闭','1'=>'开启'),'0','<h2>个性化</h2>哀悼模式','打开后网站变为黑白');
$form->addInput($grayTheme);
$bodyFonts = new Typecho_Widget_Helper_Form_Element_Select('bodyFonts',array('0'=>'无衬线字体','1'=>'衬线字体'),'0','网站字体','选择网站的字体,无衬线字体即“思源黑体”,衬线字体即“思源宋体”');
$form->addInput($bodyFonts);
Expand Down

0 comments on commit 043c72d

Please sign in to comment.