Typecho去除官方日志

打开 admin/index.php,找到下面的代码并删除,在 93-102 行。

{tabs}
{tabs-pane label="代码"}

  <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>

{/tabs-pane}
{tabs-pane label="代码位置"}
微信截图_20230411100556.png
{/tabs-pane}
{/tabs}

Typecho去除更新检测

接着找到下面的代码并删除,在 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('&lt;?php $options-&gt;index('/action/ajax?do=feed'); ?&gt;', function (o) {
            for (var i = 0; i &lt; o.length; i ++) {
                var item = o[i];
                html += '&lt;li&gt;&lt;span&gt;' + item.date + '&lt;/span&gt; &lt;a href=&quot;' + item.link + '&quot; target=&quot;_blank&quot;&gt;' + item.title
                    + '&lt;/a&gt;&lt;/li&gt;';
            }

            ul.html(html);
            cache.setItem('feed', html);
        }, 'json');
    }

    function applyUpdate(update) {
        if (update.available) {
            $('&lt;div class=&quot;update-check&quot;&gt;&lt;p&gt;'
                + '&lt;?php _e('您当前使用的版本是 %s'); ?&gt;'.replace('%s', update.current) + '&lt;br /&gt;'
                + '&lt;strong&gt;&lt;a href=&quot;' + update.link + '&quot; target=&quot;_blank&quot;&gt;'
                + '&lt;?php _e('官方最新版本是 %s'); ?&gt;'.replace('%s', update.latest) + '&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/div&gt;')
            .appendTo('.welcome-board').effect('highlight');
        }
    }

    if (!!update) {
        applyUpdate($.parseJSON(update));
    } else {
        update = '';
        $.get('&lt;?php $options-&gt;index('/action/ajax?do=checkVersion'); ?&gt;', function (o, status, resp) {
            applyUpdate(o);
            cache.setItem('update', resp.responseText);
        }, 'json');
    }
});

&lt;/script&gt;</code></pre>
分类: Typecho 标签: 经验教程typecho优化

评论

暂无评论数据

暂无评论数据

目录