2022-01-07 11:15:42 +08:00
|
|
|
|
<?php
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 主题页脚
|
2026-10-23 12:55:41 +08:00
|
|
|
|
* @author Yongquan Yang <yangyq.net>
|
2022-01-07 11:15:42 +08:00
|
|
|
|
* @license MIT License
|
|
|
|
|
|
* @version 2020.04.12
|
|
|
|
|
|
*/
|
|
|
|
|
|
?>
|
|
|
|
|
|
<div class="k-footer">
|
|
|
|
|
|
<div class="f-toolbox">
|
2026-10-23 22:56:10 +08:00
|
|
|
|
<div class="gotop">
|
2022-01-07 11:15:42 +08:00
|
|
|
|
<div class="gotop-btn">
|
|
|
|
|
|
<span class="kicon i-up"></span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="search">
|
|
|
|
|
|
<span class="kicon i-find"></span>
|
|
|
|
|
|
<form class="search-form" role="search" method="get" action="<?php echo home_url('/'); ?>">
|
|
|
|
|
|
<input type="text" name="s" id="search" placeholder="<?php _e('搜点什么呢?', 'kratos'); ?>" style="display:none"/>
|
|
|
|
|
|
</form>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="container">
|
|
|
|
|
|
<div class="row">
|
|
|
|
|
|
<div class="col-12 text-center">
|
|
|
|
|
|
<p class="social">
|
|
|
|
|
|
<?php
|
|
|
|
|
|
$social = array('s_sina', 's_bilibili', 's_coding', 's_gitee', 's_twitter', 's_telegram', 's_linkedin', 's_youtube', 's_github', 's_stackflow', 's_email');
|
|
|
|
|
|
foreach ($social as $social) {
|
|
|
|
|
|
if (kratos_option($social)) {
|
|
|
|
|
|
echo '<a target="_blank" rel="nofollow" href="' . kratos_option($social . '_url') . '"><i class="kicon i-' . str_replace("s_", "", $social) . '"></i></a>';
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
?>
|
|
|
|
|
|
</p>
|
|
|
|
|
|
<?php
|
|
|
|
|
|
$sitename = get_bloginfo('name');
|
2026-10-23 22:56:10 +08:00
|
|
|
|
/* 版权行:优先用后台「页脚配置 - 版权信息」里填的内容。
|
|
|
|
|
|
早先这里是无条件硬编码,后台那个输入框填了也不生效 ——
|
|
|
|
|
|
用户在后台改了、前台毫无变化,是很容易被当成 bug 的
|
|
|
|
|
|
那种"功能失灵"。空值才回退到自动拼的默认文案。 */
|
|
|
|
|
|
$copy = kratos_option('s_copyright', '');
|
|
|
|
|
|
if (!is_string($copy) || trim($copy) === '') {
|
|
|
|
|
|
$copy = 'COPYRIGHT © ' . date('Y') . ' ' . $sitename . ' 版权所有';
|
|
|
|
|
|
}
|
|
|
|
|
|
/* 输出必须转义。这个值是后台管理员填的,但后台账号被盗
|
|
|
|
|
|
或者多人站点里有人权限被降,都会让这里变成注入点;
|
|
|
|
|
|
而且版权行里出现 <b> 之类也只会显示成怪异的样子。
|
|
|
|
|
|
换行保留:用户可能分行写。 */
|
|
|
|
|
|
echo '<p>' . nl2br(esc_html($copy)) . '</p>';
|
2026-10-23 09:06:16 +08:00
|
|
|
|
echo '<p>THEME <a href="https://git.yangyq.net/laoyang/wordpress-kratos-yang" target="_blank" rel="nofollow">KRATOS YANG</a> Modified BY <a href="https://yangyq.net" target="_blank" rel="nofollow">老杨</a></p>';
|
2022-01-07 11:15:42 +08:00
|
|
|
|
if (kratos_option('s_icp')) {
|
|
|
|
|
|
echo '<p><a href="https://beian.miit.gov.cn/" target="_blank" rel="nofollow">' . kratos_option('s_icp') . '</a></p>';
|
|
|
|
|
|
}
|
|
|
|
|
|
if (kratos_option('s_gov')) {
|
|
|
|
|
|
echo '<p><a href="' . kratos_option('s_gov_link', '#') . '" target="_blank" rel="nofollow" ><i class="police-ico"></i>' . kratos_option('s_gov') . '</a></p>';
|
|
|
|
|
|
}
|
2026-10-28 16:33:41 +08:00
|
|
|
|
/* 统计脚本:内容由用户在「收录与统计 → 统计代码」里填,
|
|
|
|
|
|
开关由「埋点开关」控制(见 inc/theme-stat.php)。
|
|
|
|
|
|
开关与代码分离,是为了让"临时停掉统计"不必删代码 ——
|
|
|
|
|
|
删了之后想恢复就得重新去百度后台找那串 hash。 */
|
|
|
|
|
|
if (yang_stat_tracking_enabled() && kratos_option('seo_statistical')) {
|
|
|
|
|
|
echo '<p>' . kratos_option('seo_statistical') . '</p>';
|
|
|
|
|
|
}
|
2026-10-23 19:50:07 +08:00
|
|
|
|
/* 国旗:勾了「是否添加国旗」才显示。以前 src 直接取选项,
|
|
|
|
|
|
用户没上传地址就得到 <img src="">,页面上是一个破图图标。
|
|
|
|
|
|
逻辑抽到 yang_flag_block() 里,测试能直接测同一个函数,
|
|
|
|
|
|
不必"照着抄一遍"(抄件永远是对的,模板改坏了也发现不了)。 */
|
|
|
|
|
|
echo yang_flag_block();
|
2022-01-07 11:15:42 +08:00
|
|
|
|
?>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<?php wp_footer(); ?>
|
2026-10-23 09:06:16 +08:00
|
|
|
|
<?php
|
|
|
|
|
|
/**
|
2026-10-26 09:00:17 +08:00
|
|
|
|
* 这里原来有一段「Prism 代码高亮兜底」。
|
2026-10-23 09:06:16 +08:00
|
|
|
|
*
|
2026-10-26 09:00:17 +08:00
|
|
|
|
* 3.2.42 起已删除。原因:
|
|
|
|
|
|
* 代码高亮改由主题自研接管(inc/theme-highlight.php + highlight.js 自托管),
|
|
|
|
|
|
* 服务端就把每个 <pre> 规范成了卡片结构,前端 hljs 一次性上色完成。
|
|
|
|
|
|
* Prism 那段留着有两个害处:
|
|
|
|
|
|
* ① 它会对同一批 `<pre><code>` 再扫一遍,把 hljs 已经写好的
|
|
|
|
|
|
* `<span class="hljs-*">` 当文本重新包一层,产出嵌套 span,
|
|
|
|
|
|
* 首尾行高算错、行号对不齐;
|
|
|
|
|
|
* ② Prism 的 autoloader 会去拉 wp-editormd 的语言包,
|
|
|
|
|
|
* 而 wp-editormd 已被关停/可能被删,地址 404 时控制台报错。
|
2026-10-23 09:06:16 +08:00
|
|
|
|
*
|
2026-10-26 09:00:17 +08:00
|
|
|
|
* ⚠️ 如果将来要恢复 Prism,必须同时关掉 yang_hl_enabled(),
|
|
|
|
|
|
* 两套高亮器不能同时在一页里跑。
|
2026-10-23 09:06:16 +08:00
|
|
|
|
*/
|
|
|
|
|
|
?>
|
2022-01-07 11:15:42 +08:00
|
|
|
|
</body>
|
|
|
|
|
|
</html>
|