废了不少力气,博客终于弄的差不多了,也许还存在不少问题,实在不知道怎么弄了,以后再慢慢改吧,这里记录下针对系统源码的修改,方便以后升级的时候再次修改(不过 typecho 的更新好像已经遥遥无期了)。
评论无限回复
为了美观,在后台评论设置中把回复层数改成了2层后,第二层的评论却没有回复按钮,当与访客回复多几句的时候访客因没有上一层的回复按钮,然后就只能重新开楼回复。解决方法如下:
把负责评论渲染的类/var/Widget/Comments/Archive.php
的 reply
方法(大概在472行)的 if 判断中的 !$this->isTopLevel
条件去掉,评论右下角的回复的链接就显示出来了。
去除后台官方日志
打开根目录下的 admin/index.php
,找到下面的代码,删除,大概在96-105行。
<div class="col-mb-12 col-tb-4" role="complementary">
<section class="latest-link">
<h3><?php _e('官方最新日志'); ?></h3>
<div id="typecho-message">
<ul>
<li><?php _e('读取中...'); ?></li>
</ul>
</div>
</section>
</div>
去除后台版本更新检测
同样是在 admin/index.php
,找到下面的代码,删除,大概在105-147行。
<script>
$(document).ready(function () {
var ul = $('#typecho-message ul'), cache = window.sessionStorage,
html = cache ? cache.getItem('feed') : '',
update = cache ? cache.getItem('update') : '';
if (!!html) {
ul.html(html);
} else {
html = '';
$.get('<?php $options->index('/action/ajax?do=feed'); ?>', function (o) {
for (var i = 0; i < o.length; i ++) {
var item = o[i];
html += '<li><span>' + item.date + '</span> <a href="' + item.link + '" target="_blank">' + item.title
+ '</a></li>';
}
ul.html(html);
cache.setItem('feed', html);
}, 'json');
}
function applyUpdate(update) {
if (update.available) {
$('<div class="update-check"><p>'
+ '<?php _e('您当前使用的版本是 %s'); ?>'.replace('%s', update.current) + '<br />'
+ '<strong><a href="' + update.link + '" target="_blank">'
+ '<?php _e('官方最新版本是 %s'); ?>'.replace('%s', update.latest) + '</a></strong></p></div>')
.appendTo('.welcome-board').effect('highlight');
}
}
if (!!update) {
applyUpdate($.parseJSON(update));
} else {
update = '';
$.get('<?php $options->index('/action/ajax?do=checkVersion'); ?>', function (o, status, resp) {
applyUpdate(o);
cache.setItem('update', resp.responseText);
}, 'json');
}
});
</script>