3.2.16: 删三项无用功能、选项重排为 10 组、修移动端提示条偏左
删除 - 微信二维码:配置项 s_wechat / 隐藏上传 s_wechat_url、footer 浮动块、 默认图注册表条目、CSS 规则、wechat.png - Font Awesome:选项 g_fontawesome、theme-core 入队、58KB 样式、 assets/fonts/webfonts 全套字体(2.8MB,CSS 删后零引用) - 多人模式:选项 multiusers、page-content / page-toolbar 两处分支 选项重排(9 组 → 10 组) 全站配置 / 顶部导航 / 首页配置 / 文章配置 / 站长信息 / 页脚配置 / 哀悼模式 / 收录与统计 / 邮件通知 / 自定义代码 哀悼 5 个字段从「首页配置」独立成「哀悼模式」——它不是首页专属功能。 g_404/g_chrome/g_animate/g_gravatar 等归「全站配置」,s_copyright 归「页脚配置」。 修复 - footer.php 版权行此前无条件硬编码,后台 s_copyright 填了不生效 - 附加日期命中时 yang_mourning_today_name() 返回空串,提示条退化成 只说「今天是纪念日」而不给名字 - 小屏哀悼提示条 padding 写成 `7px 40px 7px 12px`(右宽左窄给关闭按钮 让位),内容盒中心 181 vs 视口中心 195,整体偏左 14px。关闭按钮本就 absolute 不占内部流,改为左右等宽 + 缩小按钮。桌面端同类错误 3.2.14 已修, 此处漏了同一个断点。 加载顺序 theme-options.php 可能早于 theme-mourning.php / theme-custom-code.php 加载, 新增 yang_opt_* 四个 function_exists 包装,避免裸调用导致后台白屏。 验证:静态断言 62/0 · 后台面板 14/0 · 反向验证 7/7 与 44/0 · 提示条 4 视口几何 20/0(注入旧 bug 精确复现 -14px)· 线上 3 视口 33/0
This commit is contained in:
@@ -52,9 +52,6 @@ function theme_autoload()
|
||||
if (kratos_option('g_animate', false)) {
|
||||
wp_enqueue_style('animate', ASSET_PATH . '/assets/css/animate.min.css', array(), '3.7.2');
|
||||
}
|
||||
if (kratos_option('g_fontawesome', false)) {
|
||||
wp_enqueue_style('fontawesome', ASSET_PATH . '/assets/css/fontawesome.min.css', array(), '5.13.0');
|
||||
}
|
||||
wp_enqueue_style('kratos', ASSET_PATH . '/assets/css/kratos.min.css', array(), THEME_VERSION);
|
||||
if (kratos_option('g_adminbar', true)) {
|
||||
$admin_bar_css = "
|
||||
|
||||
+92
-22
@@ -180,28 +180,64 @@ function yang_is_mourning_today()
|
||||
$days = yang_mourning_days();
|
||||
|
||||
// 自定义附加日期(用户自己填的,如特定年份的哀悼日)
|
||||
if (kratos_option('g_rip_extra', '')) {
|
||||
$extra = kratos_option('g_rip_extra', '');
|
||||
foreach (preg_split('/[\s,,、;;]+/u', (string) $extra) as $one) {
|
||||
$one = trim($one);
|
||||
if ($one === '') {
|
||||
continue;
|
||||
}
|
||||
// 支持 MM-DD 与 YYYY-MM-DD 两种写法
|
||||
if (preg_match('/^\d{2}-\d{2}$/', $one)) {
|
||||
$days[] = $one;
|
||||
} elseif (preg_match('/^(\d{4})-(\d{2})-(\d{2})$/', $one, $m)) {
|
||||
// 带年份的只在当年生效,不是周年循环
|
||||
if ((int) $m[1] === (int) current_time('Y')) {
|
||||
$days[] = $m[2] . '-' . $m[3];
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach (yang_mourning_extra_days() as $one) {
|
||||
$days[] = $one;
|
||||
}
|
||||
|
||||
return in_array($md, $days, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 把「附加日期」输入框里的自由文本解析成月日列表
|
||||
*
|
||||
* 支持两种写法,语义不同,不能混为一谈:
|
||||
* · `MM-DD` —— 每年循环(05-12 每年都会触发)
|
||||
* · `YYYY-MM-DD` —— 只在指定那年触发(2020-04-04 是一次性事件,
|
||||
* 明年 4 月 4 日不该再自动变黑白)
|
||||
*
|
||||
* 分隔符容错:空格、回车、英文逗号、中文逗号、顿号、分号都认,
|
||||
* 因为用户复制粘贴来源五花八门,要求他只准用半角空格不现实。
|
||||
*
|
||||
* 非法格式**静默跳过**而不是报错:这是个自由文本框,中途保存到
|
||||
* 一半(比如只打了 `10-`)不应该让整个后台保存失败。
|
||||
*/
|
||||
function yang_mourning_extra_days()
|
||||
{
|
||||
$raw = kratos_option('g_rip_extra', '');
|
||||
if (!is_string($raw) || trim($raw) === '') {
|
||||
return array();
|
||||
}
|
||||
|
||||
$out = array();
|
||||
foreach (preg_split('/[\s,,、;;]+/u', $raw) as $one) {
|
||||
$one = trim($one);
|
||||
if ($one === '') {
|
||||
continue;
|
||||
}
|
||||
if (preg_match('/^(\d{1,2})-(\d{1,2})$/', $one, $m)) {
|
||||
// MM-DD:补零后与 current_time('m')-current_time('d') 可比
|
||||
$out[] = sprintf('%02d-%02d', (int) $m[1], (int) $m[2]);
|
||||
} elseif (preg_match('/^(\d{4})-(\d{1,2})-(\d{1,2})$/', $one, $m)) {
|
||||
if ((int) $m[1] === (int) current_time('Y')) {
|
||||
$out[] = sprintf('%02d-%02d', (int) $m[2], (int) $m[3]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
|
||||
/**
|
||||
* 附加日期的原始文本(后台选项说明里回显"当前填的是什么"用)
|
||||
*
|
||||
* 单独抽出来是因为后台 desc 里要展示它,而 desc 在
|
||||
* kratos_options() 里拼装 —— 那里不该重复一遍取值逻辑。
|
||||
*/
|
||||
function yang_mourning_extra_raw()
|
||||
{
|
||||
$raw = kratos_option('g_rip_extra', '');
|
||||
return is_string($raw) ? trim($raw) : '';
|
||||
}
|
||||
|
||||
/**
|
||||
* 输出黑白样式
|
||||
*
|
||||
@@ -240,18 +276,26 @@ function yang_mourning_status_text()
|
||||
return __('当前为手动常开模式:站点一直黑白,与日期无关。', 'kratos');
|
||||
}
|
||||
if (!kratos_option('g_rip_auto', false)) {
|
||||
return __('自动哀悼未开启。', 'kratos');
|
||||
return __('自动哀悼未开启。(上面的「手动常开」也没勾,所以现在整站是彩色的。)', 'kratos');
|
||||
}
|
||||
|
||||
$days = yang_mourning_days();
|
||||
$extra = yang_mourning_extra_days();
|
||||
foreach ($extra as $one) {
|
||||
if (!in_array($one, $days, true)) {
|
||||
$days[] = $one;
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($days)) {
|
||||
return __('自动哀悼已开启,但一个日期都没勾选,因此不会生效。', 'kratos');
|
||||
return __('自动哀悼已开启,但一个日期都没有 —— 清单没勾、附加日期也没填,因此不会生效。', 'kratos');
|
||||
}
|
||||
sort($days);
|
||||
$today = current_time('m') . '-' . current_time('d');
|
||||
$is = in_array($today, $days, true);
|
||||
return sprintf(
|
||||
/* translators: 1: 今天的月日, 2: 是否处于哀悼, 3: 勾选的日期列表 */
|
||||
__('今天是 %1$s,%2$s。已启用:%3$s', 'kratos'),
|
||||
/* translators: 1: 今天的月日, 2: 是否处于哀悼, 3: 生效的日期列表 */
|
||||
__('今天是 %1$s,%2$s。当前会变黑白的日期:%3$s', 'kratos'),
|
||||
$today,
|
||||
$is ? __('正在哀悼,站点已黑白', 'kratos') : __('不在哀悼日', 'kratos'),
|
||||
implode('、', $days)
|
||||
@@ -341,9 +385,17 @@ function yang_mourning_notice_bar()
|
||||
不同步下移的话,它会和提示条叠在一起、把站点标题遮住(实测重叠 31px)。
|
||||
这里只用一条 top 偏移把它挪到提示条下方;没有提示条时 --ymb-h 为 0。 */
|
||||
body.has-yang-mourning-bar .k-nav{top:var(--ymb-h,0px)}
|
||||
/* 小屏:左右 padding 必须等宽。
|
||||
曾写成 `7px 40px 7px 12px`(右宽左窄,给关闭按钮让位),
|
||||
结果内容盒中心 = 181,而视口中心 = 195,文字整体偏左 14px —— 桌面端同样
|
||||
的错在 3.2.14 修过,这里漏了同一个断点。
|
||||
关闭按钮本来就是 absolute、不占内部流,所以它的空间由"缩小自身"解决,
|
||||
不能靠单边 padding 去让:right:6px + 更小字号/内边距后宽度约 20px,
|
||||
落在右侧 40px 的 padding 区内,与文字不重叠。 */
|
||||
@media (max-width:560px){
|
||||
.yang-mourning-bar{font-size:12.5px;padding:7px 40px 7px 12px;letter-spacing:0}
|
||||
.yang-mourning-bar{font-size:12.5px;padding:7px 40px;letter-spacing:0}
|
||||
.yang-mourning-bar .ymb-inner{gap:6px}
|
||||
.yang-mourning-bar .ymb-close{right:6px;font-size:17px;padding:2px 5px}
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
@@ -429,13 +481,31 @@ function yang_mourning_page_is_current()
|
||||
* 今天哀悼的纪念日名称(用于提示条文案)
|
||||
*
|
||||
* 取第一个命中的,取不到返回空串。
|
||||
*
|
||||
* ── 为什么附加日期也要给个名字 ──────────────────────────────
|
||||
* 清单里的日期都有正式名称,附加日期是用户自己填的、系统不知道叫什么。
|
||||
* 早先这里只查 presets,于是用附加日期触发的哀悼,提示条会退化成
|
||||
* 「今天是纪念日,本站以黑白致哀」—— 名字丢了,而这条提示的全部意义
|
||||
* 就是告诉访客"今天是哪个纪念日"。所以附加日期命中时,明确说明
|
||||
* 这是自定义的纪念日,让文案仍然完整、不露出系统的无知。
|
||||
*/
|
||||
function yang_mourning_today_name()
|
||||
{
|
||||
if (!yang_is_mourning_today()) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$md = current_time('m') . '-' . current_time('d');
|
||||
$presets = yang_mourning_presets();
|
||||
|
||||
if (isset($presets[$md]) && in_array($md, yang_mourning_days(), true)) {
|
||||
return $presets[$md]['name'];
|
||||
}
|
||||
|
||||
// 命中的是「附加日期」里用户自己填的那一天
|
||||
if (in_array($md, yang_mourning_extra_days(), true)) {
|
||||
return __('纪念日', 'kratos');
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
@@ -71,9 +71,8 @@ if (!function_exists('yang_image_defaults')):
|
||||
// 顶部图片导航的背景。CSS 是 height:300px + cover。
|
||||
'top_img' => '/assets/img/default-banner.jpg',
|
||||
|
||||
// 下面三个主题包里本来就有图,只是这里显式登记,
|
||||
// 下面两个主题包里本来就有图,只是这里显式登记,
|
||||
// 让"所有图片字段都有默认"这件事可被一处查全。
|
||||
's_wechat_url' => '/assets/img/wechat.png',
|
||||
'g_donate_alipay' => '/assets/img/donate.png',
|
||||
'g_donate_wechat' => '/assets/img/donate.png',
|
||||
);
|
||||
|
||||
+433
-358
@@ -1,6 +1,18 @@
|
||||
<?php
|
||||
/**
|
||||
* 主题选项
|
||||
*
|
||||
* ── 分类原则(3.2.15 重排)────────────────────────────────────
|
||||
* 原来九个头部分类里有几处明显错位:
|
||||
* · 哀悼功能挂在「首页配置」下面 —— 它影响的是整站(首页、文章页、说明页),
|
||||
* 跟首页没有关系;
|
||||
* · 国旗、备案、版权拆在「页脚」但「404 图片」在全站,都是零碎的;
|
||||
* · 「收录配置」把 robots.txt 一起塞进来,其实那是另一件事。
|
||||
*
|
||||
* 现在的顺序按「访客看到的顺序」排:整站基础 → 顶部 → 首页 → 文章 →
|
||||
* 站长 → 页脚 → 专项功能 → 收录 → 邮件 → 自定义代码。
|
||||
* 每一项只出现在它真正生效的地方,不再有"在首页配置里改整站行为"这种事。
|
||||
*
|
||||
* @author Yongquan Yang <yangyq.net>
|
||||
* @license MIT License
|
||||
* @version 2020.09.21
|
||||
@@ -43,6 +55,61 @@ if (!function_exists('yang_options_default_img')) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 哀悼相关辅助函数的安全访问
|
||||
*
|
||||
* 同样的道理:yang_mourning_presets() / yang_mourning_status_text() /
|
||||
* yang_mourning_extra_raw() 都在 inc/theme-mourning.php 里,由
|
||||
* functions.php 按顺序 require。只要有人(子主题、迁移脚本、别的插件)
|
||||
* 在 theme-mourning.php 之前触发了 kratos_options(),这里就会 Fatal,
|
||||
* 整个后台白屏,且报错指向本文件,很难联想到是加载顺序问题。
|
||||
*
|
||||
* 降级策略:缺函数时按"没有纪念日 / 没有状态说明"降级 ——
|
||||
* 后台那几个控件会变空,但页面能打开、能保存、能继续用。
|
||||
*/
|
||||
if (!function_exists('yang_opt_mourning_presets')) {
|
||||
function yang_opt_mourning_presets()
|
||||
{
|
||||
return function_exists('yang_mourning_presets')
|
||||
? yang_mourning_presets()
|
||||
: array();
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('yang_opt_mourning_status')) {
|
||||
function yang_opt_mourning_status()
|
||||
{
|
||||
return function_exists('yang_mourning_status_text')
|
||||
? yang_mourning_status_text()
|
||||
: '';
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('yang_opt_mourning_extra_raw')) {
|
||||
function yang_opt_mourning_extra_raw()
|
||||
{
|
||||
return function_exists('yang_mourning_extra_raw')
|
||||
? yang_mourning_extra_raw()
|
||||
: '';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 自定义 CSS 的默认值(来自 inc/theme-custom-code.php)
|
||||
*
|
||||
* 同样是加载顺序问题:这个函数在 theme-custom-code.php 里,
|
||||
* 而 kratos_options() 可能被更早触发。缺了就返回空串,
|
||||
* 后台的「自定义 CSS」框是空的,但能打开、能填、能保存。
|
||||
*/
|
||||
if (!function_exists('yang_opt_default_custom_css')) {
|
||||
function yang_opt_default_custom_css()
|
||||
{
|
||||
return function_exists('yang_default_custom_css')
|
||||
? yang_default_custom_css()
|
||||
: '';
|
||||
}
|
||||
}
|
||||
|
||||
function kratos_options()
|
||||
{
|
||||
$sitename = get_bloginfo('name');
|
||||
@@ -52,15 +119,6 @@ function kratos_options()
|
||||
$seorobots = '<a href="' . home_url() . '/robots.txt" target="_blank">robots.txt</a>';
|
||||
$seoreading = '<a href="' . admin_url('options-reading.php') . '" target="_blank">' . __('设置-阅读-对搜索引擎的可见性', 'kratos') . '</a>';
|
||||
|
||||
$cc_array = array(
|
||||
'one' => __('知识共享署名 4.0 国际许可协议', 'kratos'),
|
||||
'two' => __('知识共享署名-非商业性使用 4.0 国际许可协议', 'kratos'),
|
||||
'three' => __('知识共享署名-禁止演绎 4.0 国际许可协议', 'kratos'),
|
||||
'four' => __('知识共享署名-非商业性使用-禁止演绎 4.0 国际许可协议', 'kratos'),
|
||||
'five' => __('知识共享署名-相同方式共享 4.0 国际许可协议', 'kratos'),
|
||||
'six' => __('知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议', 'kratos'),
|
||||
);
|
||||
|
||||
$top_array = array(
|
||||
'banner' => __( '图片导航', 'kratos' ),
|
||||
'color' => __( '颜色导航', 'kratos' ),
|
||||
@@ -68,6 +126,9 @@ function kratos_options()
|
||||
|
||||
$options = array();
|
||||
|
||||
/* ══════════════════════════════════════════════════════════
|
||||
* 一、全站配置 —— 影响每一个页面的东西
|
||||
* ══════════════════════════════════════════════════════════ */
|
||||
$options[] = array(
|
||||
'name' => __('全站配置', 'kratos'),
|
||||
'type' => 'heading',
|
||||
@@ -90,28 +151,15 @@ function kratos_options()
|
||||
*
|
||||
* std 里存的是**绝对 URL**,一旦用户保存表单就会被写进数据库。
|
||||
* 数据库里躺着一个写死的主题目录地址是隐患:主题目录改名、
|
||||
* 换 CDN、或站点迁移域名之后,那条记录就指向不存在的文件
|
||||
* (线上 s_wechat_url 指向早已删除的 kratos-master 目录,就是这么坏掉的)。
|
||||
* 换 CDN、或站点迁移域名之后,那条记录就指向不存在的文件,
|
||||
* 页面上是破图,而用户在后台看到的仍是"已设置",很难自己发现。
|
||||
*
|
||||
* 所以默认值一律由运行时提供(yang_option_image()),库里保持空。
|
||||
* 这样默认图地址永远由当前请求现算,改目录也不用改数据。
|
||||
*/
|
||||
'type' => 'upload',
|
||||
);
|
||||
$options[] = array(
|
||||
'name' => __('是否添加国旗', 'kratos'),
|
||||
'desc' => __('在页脚添加国旗', 'kratos'),
|
||||
'std' => '0',
|
||||
'id' => 'g_flag',
|
||||
'type' => 'checkbox',
|
||||
);
|
||||
$options[] = array(
|
||||
'name' => __('国旗地址', 'kratos'),
|
||||
'desc' => __('选择国旗图片地址。<b>留空则自动使用主题自带的默认国旗</b>。', 'kratos'),
|
||||
'id' => 'g_flag_url',
|
||||
/* 不写 std —— 理由同 g_icon:默认值由运行时给,库里不存绝对地址。 */
|
||||
'type' => 'upload',
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('背景颜色', 'kratos'),
|
||||
'desc' => __('全站页面的背景颜色,需填写十六进制颜色码', 'kratos'),
|
||||
@@ -119,105 +167,374 @@ $options[] = array(
|
||||
'std' => '#f5f5f5',
|
||||
'type' => 'color',
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('前台管理员导航', 'kratos'),
|
||||
'desc' => __('开启前台管理员导航', 'kratos'),
|
||||
'std' => '1',
|
||||
'id' => 'g_adminbar',
|
||||
'type' => 'checkbox',
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('多人模式', 'kratos'),
|
||||
'desc' => __('在文章列表显示当前文章作者,在文章页面页脚显示当前作者介绍', 'kratos'),
|
||||
'id' => 'multiusers',
|
||||
'type' => 'checkbox',
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('CSS 动画库', 'kratos'),
|
||||
'desc' => __('开启 animate.css 效果', 'kratos'),
|
||||
'std' => '0',
|
||||
'id' => 'g_animate',
|
||||
'type' => 'checkbox',
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('Font Awesome', 'kratos'),
|
||||
'desc' => __('开启 Font Awesome 字体', 'kratos'),
|
||||
'std' => '0',
|
||||
'id' => 'g_fontawesome',
|
||||
'type' => 'checkbox',
|
||||
);
|
||||
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('禁止生成缩略图', 'kratos'),
|
||||
'desc' => __('是否禁止生成多种尺寸图片资源', 'kratos'),
|
||||
'id' => 'g_removeimgsize',
|
||||
'std' => '0',
|
||||
'type' => 'checkbox',
|
||||
);
|
||||
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('Gutenberg 编辑器', 'kratos'),
|
||||
'desc' => __('开启 Gutenberg 编辑器', 'kratos'),
|
||||
'std' => '0',
|
||||
'id' => 'g_gutenberg',
|
||||
'type' => 'checkbox',
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('Gravatar 加速', 'kratos'),
|
||||
'desc' => __('开启 Gravatar 头像加速', 'kratos'),
|
||||
'std' => '0',
|
||||
'id' => 'g_gravatar',
|
||||
'type' => 'checkbox',
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('Chrome 导航栏颜色', 'kratos'),
|
||||
'desc' => __('Chrome 移动端浏览器导航栏的颜色', 'kratos'),
|
||||
'desc' => __('Chrome 移动端浏览器地址栏的颜色', 'kratos'),
|
||||
'id' => 'g_chrome',
|
||||
'std' => '#282a2c',
|
||||
'type' => 'color',
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('微信二维码', 'kratos'),
|
||||
'desc' => __('开启页面右下角浮动微信二维码', 'kratos'),
|
||||
'id' => 's_wechat',
|
||||
'type' => 'checkbox',
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'id' => 's_wechat_url',
|
||||
/* 后台显示的初始值必须与前台实际用的默认图**同一份来源**,
|
||||
否则用户在后台看到 A 图、前台显示 B 图,一保存又把 A 写进库,
|
||||
前台跟着退回 A —— 前后台像两个产品。
|
||||
所以这里统一从 yang_image_defaults() 取,不在两处各写一遍路径。 */
|
||||
'std' => yang_options_default_img('s_wechat_url'),
|
||||
'type' => 'upload',
|
||||
'class' => 'hidden',
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('404 页面图片', 'kratos'),
|
||||
'desc' => __('访客打开不存在的地址时显示的配图', 'kratos'),
|
||||
'id' => 'g_404',
|
||||
'std' => yang_options_default_img('g_404'),
|
||||
'type' => 'upload',
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('收录配置', 'kratos'),
|
||||
'name' => __('前台管理员导航', 'kratos'),
|
||||
'desc' => __('登录管理员后,页面顶部显示 WordPress 管理工具条', 'kratos'),
|
||||
'std' => '1',
|
||||
'id' => 'g_adminbar',
|
||||
'type' => 'checkbox',
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('CSS 动画库', 'kratos'),
|
||||
'desc' => __('开启 animate.css 效果。会增加一个约 60KB 的样式文件,不需要就别开。', 'kratos'),
|
||||
'std' => '0',
|
||||
'id' => 'g_animate',
|
||||
'type' => 'checkbox',
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('Gravatar 加速', 'kratos'),
|
||||
'desc' => __('把评论头像的请求转发到国内可访问的镜像,改善加载速度', 'kratos'),
|
||||
'std' => '0',
|
||||
'id' => 'g_gravatar',
|
||||
'type' => 'checkbox',
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('禁止生成缩略图', 'kratos'),
|
||||
'desc' => __('上传图片时不再额外生成多种尺寸的副本,节省磁盘空间', 'kratos'),
|
||||
'id' => 'g_removeimgsize',
|
||||
'std' => '0',
|
||||
'type' => 'checkbox',
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('Gutenberg 编辑器', 'kratos'),
|
||||
'desc' => __('开启 WordPress 区块编辑器。关闭则使用经典编辑器。', 'kratos'),
|
||||
'std' => '0',
|
||||
'id' => 'g_gutenberg',
|
||||
'type' => 'checkbox',
|
||||
);
|
||||
|
||||
/* ══════════════════════════════════════════════════════════
|
||||
* 二、顶部导航 —— 页头那一条
|
||||
* ══════════════════════════════════════════════════════════ */
|
||||
$options[] = array(
|
||||
'name' => __('顶部导航', 'kratos'),
|
||||
'type' => 'heading',
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __( '顶部样式', 'kratos' ),
|
||||
'desc' => __('请选择顶部样式(图片导航或颜色导航)', 'kratos'),
|
||||
'id' => 'top_select',
|
||||
'std' => 'banner',
|
||||
'type' => 'select',
|
||||
'options' => $top_array
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('图片导航背景', 'kratos'),
|
||||
'desc' => __('顶部样式选「图片导航」时使用。<b>留空则自动使用主题自带的默认图片</b>。', 'kratos'),
|
||||
'id' => 'top_img',
|
||||
'std' => yang_options_default_img('top_img'),
|
||||
'class' => 'hidden',
|
||||
'type' => 'upload',
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('颜色导航背景', 'kratos'),
|
||||
'desc' => __('顶部样式选「颜色导航」时使用', 'kratos'),
|
||||
'id' => 'top_color',
|
||||
'std' => '#24292e',
|
||||
'class' => 'hidden',
|
||||
'type' => 'color',
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('副标题', 'kratos'),
|
||||
'desc' => __('显示在站点标题旁边的一句短话', 'kratos'),
|
||||
'id' => 'top_title',
|
||||
'std' => 'Kratos',
|
||||
'class' => 'hidden',
|
||||
'type' => 'text',
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('标题描述', 'kratos'),
|
||||
'std' => __('一款专注于用户阅读体验的响应式博客主题', 'kratos'),
|
||||
'id' => 'top_describe',
|
||||
'class' => 'hidden',
|
||||
'type' => 'text',
|
||||
);
|
||||
|
||||
/* ══════════════════════════════════════════════════════════
|
||||
* 三、首页配置 —— 只管首页列表长什么样
|
||||
* ══════════════════════════════════════════════════════════ */
|
||||
$options[] = array(
|
||||
'name' => __('首页配置', 'kratos'),
|
||||
'type' => 'heading',
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('特色图片', 'kratos'),
|
||||
'desc' => __('在首页文章列表的每篇标题上方显示一张配图', 'kratos'),
|
||||
'std' => '1',
|
||||
'id' => 'g_thumbnail',
|
||||
'type' => 'checkbox',
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('默认特色图', 'kratos'),
|
||||
'desc' => __('文章既没有正文图片、也没有设置特色图时,用这张顶上。<b>留空则自动使用主题自带的默认图片</b>。', 'kratos'),
|
||||
'id' => 'g_postthumbnail',
|
||||
'class' => 'hidden',
|
||||
'std' => yang_options_default_img('g_postthumbnail'),
|
||||
'type' => 'upload',
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('无内容图片', 'kratos'),
|
||||
'desc' => __('搜索不到结果、或分类下还没有文章时显示的插画。<b>留空则自动使用主题自带的默认图片</b>。', 'kratos'),
|
||||
'id' => 'g_nothing',
|
||||
'std' => yang_options_default_img('g_nothing'),
|
||||
'type' => 'upload',
|
||||
);
|
||||
|
||||
/* ══════════════════════════════════════════════════════════
|
||||
* 四、文章配置 —— 打开单篇文章才看得到的东西
|
||||
* ══════════════════════════════════════════════════════════ */
|
||||
$options[] = array(
|
||||
'name' => __('文章配置', 'kratos'),
|
||||
'type' => 'heading',
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('页面布局', 'kratos'),
|
||||
'desc' => __('文章页面是否显示侧边栏。仅在文章详情页生效。', 'kratos'),
|
||||
'id' => "g_article_widgets",
|
||||
'std' => "two_side",
|
||||
'type' => "images",
|
||||
'options' => array(
|
||||
'one_side' => $imagepath . 'col-12.png',
|
||||
'two_side' => $imagepath . 'col-8.png')
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('文章打赏', 'kratos'),
|
||||
'desc' => __('在文章底部显示打赏按钮,点开是收款二维码', 'kratos'),
|
||||
'id' => 'g_donate',
|
||||
'type' => 'checkbox',
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('支付宝收款码', 'kratos'),
|
||||
'desc' => __('<b>留空则自动使用主题自带的默认图片</b>。', 'kratos'),
|
||||
'id' => 'g_donate_alipay',
|
||||
'std' => yang_options_default_img('g_donate_alipay'),
|
||||
'type' => 'upload',
|
||||
'class' => 'hidden',
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('微信收款码', 'kratos'),
|
||||
'desc' => __('<b>留空则自动使用主题自带的默认图片</b>。', 'kratos'),
|
||||
'id' => 'g_donate_wechat',
|
||||
'std' => yang_options_default_img('g_donate_wechat'),
|
||||
'type' => 'upload',
|
||||
'class' => 'hidden',
|
||||
);
|
||||
|
||||
/* ══════════════════════════════════════════════════════════
|
||||
* 五、站长信息 —— 文章页页脚那张名片
|
||||
* ══════════════════════════════════════════════════════════ */
|
||||
$options[] = array(
|
||||
'name' => __('站长信息', 'kratos'),
|
||||
'type' => 'heading',
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('个人头像', 'kratos'),
|
||||
'desc' => __('显示在文章底部作者名片里。<b>留空则自动使用主题自带的默认头像</b>。', 'kratos'),
|
||||
'id' => 'a_gravatar',
|
||||
'std' => yang_options_default_img('a_gravatar'),
|
||||
'type' => 'upload',
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('个人昵称', 'kratos'),
|
||||
'id' => 'a_nickname',
|
||||
'std' => 'Kratos',
|
||||
'type' => 'text',
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('个人简介', 'kratos'),
|
||||
'std' => __('保持饥渴的专注,追求最佳的品质', 'kratos'),
|
||||
'id' => 'a_about',
|
||||
'type' => 'textarea',
|
||||
);
|
||||
|
||||
/* ══════════════════════════════════════════════════════════
|
||||
* 六、页脚配置 —— 页面最底下那几行
|
||||
* ══════════════════════════════════════════════════════════ */
|
||||
$options[] = array(
|
||||
'name' => __('页脚配置', 'kratos'),
|
||||
'type' => 'heading',
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('版权信息', 'kratos'),
|
||||
'desc' => __('页脚显示的那行版权声明。<b>留空则自动用「COPYRIGHT © 当前年份 站点名称 版权所有」</b>。', 'kratos'),
|
||||
'id' => 's_copyright',
|
||||
/* 有意不写 std:std 里写死的年份过一年就变成旧年份,
|
||||
而且一旦保存就永久留在库里。改由 footer.php 每次现算。 */
|
||||
'type' => 'textarea',
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('是否显示国旗', 'kratos'),
|
||||
'desc' => __('在页脚显示一面国旗', 'kratos'),
|
||||
'std' => '0',
|
||||
'id' => 'g_flag',
|
||||
'type' => 'checkbox',
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('国旗图片', 'kratos'),
|
||||
'desc' => __('<b>留空则自动使用主题自带的默认国旗</b>。', 'kratos'),
|
||||
'id' => 'g_flag_url',
|
||||
/* 不写 std —— 理由同 g_icon:默认值由运行时给,库里不存绝对地址。 */
|
||||
'type' => 'upload',
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('工信部备案信息', 'kratos'),
|
||||
'id' => 's_icp',
|
||||
'placeholder' => __('例如:京ICP证xxxxxx号', 'kratos'),
|
||||
'type' => 'text',
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('公安网备案信息', 'kratos'),
|
||||
'id' => 's_gov',
|
||||
'placeholder' => __('例如:京公网安备 xxxxxxxxxxxx号', 'kratos'),
|
||||
'type' => 'text',
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('公安网备案链接', 'kratos'),
|
||||
'id' => 's_gov_link',
|
||||
'placeholder' => __('例如:http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=xxxxx', 'kratos'),
|
||||
'type' => 'text',
|
||||
);
|
||||
|
||||
/* ══════════════════════════════════════════════════════════
|
||||
* 七、哀悼模式 —— 整站级功能,与首页无关
|
||||
*
|
||||
* 这一组原来错放在「首页配置」下面。它影响的是整站配色
|
||||
* (首页、文章页、说明页都变黑白),放首页下面会让人以为
|
||||
* 只改首页,而且想找它的人第一反应不会去点「首页配置」。
|
||||
* 单独成组,名字直说它是什么。
|
||||
* ══════════════════════════════════════════════════════════ */
|
||||
$options[] = array(
|
||||
'name' => __('哀悼模式', 'kratos'),
|
||||
'type' => 'heading',
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('手动常开', 'kratos'),
|
||||
'desc' => __('勾上就一直黑白,与日期无关。这是老的开关,日常建议用下面的「按纪念日自动哀悼」。', 'kratos'),
|
||||
'id' => 'g_rip',
|
||||
'type' => 'checkbox',
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('按纪念日自动哀悼', 'kratos'),
|
||||
'desc' => __('勾选后,只有在下表勾选的那些日期才会自动黑白,其余日子正常显示。日期按站点时区判断,只比对月和日,每年循环。', 'kratos'),
|
||||
'id' => 'g_rip_auto',
|
||||
'type' => 'checkbox',
|
||||
);
|
||||
|
||||
// 把内置清单转成 multicheck 需要的格式
|
||||
$rip_legal = array();
|
||||
$rip_custom = array();
|
||||
foreach (yang_opt_mourning_presets() as $md => $info) {
|
||||
$entry = array(
|
||||
'name' => $md . ' ' . $info['name'],
|
||||
'note' => $info['note'],
|
||||
);
|
||||
if (isset($info['group']) && $info['group'] === 'legal') {
|
||||
$rip_legal[$md] = $entry;
|
||||
} else {
|
||||
$rip_custom[$md] = $entry;
|
||||
}
|
||||
}
|
||||
|
||||
$rip_default = array();
|
||||
foreach (yang_opt_mourning_presets() as $md => $info) {
|
||||
$rip_default[$md] = !empty($info['default']) ? 1 : 0;
|
||||
}
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('纪念日清单', 'kratos'),
|
||||
'desc' => __('勾选需要自动黑白的日期。<b>默认一个都不勾</b>,请按自己的意愿挑选。前三个是法定纪念日,后面几个是民间通行做法。日期按站点时区判断,只比对月和日,每年循环。', 'kratos'),
|
||||
'id' => 'g_rip_days',
|
||||
'std' => $rip_default,
|
||||
'type' => 'multicheck',
|
||||
'options' => array_merge($rip_legal, $rip_custom),
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('附加日期', 'kratos'),
|
||||
'desc' => sprintf(
|
||||
__('清单里没有的日期填这里。<br><b>%1$s</b> 表示每年循环(如 05-12);<b>%2$s</b> 表示只在当年生效(如 2020-04-04,用于历次全国哀悼日这类一次性事件)。<br>多个日期用空格或逗号分隔。当前填的是 <b>%3$s</b>。', 'kratos'),
|
||||
'MM-DD',
|
||||
'YYYY-MM-DD',
|
||||
esc_html(yang_opt_mourning_extra_raw() === '' ? __('(空)', 'kratos') : yang_opt_mourning_extra_raw())
|
||||
),
|
||||
'id' => 'g_rip_extra',
|
||||
'type' => 'text',
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('说明页路径', 'kratos'),
|
||||
'desc' => sprintf(
|
||||
/* 注意:desc 会过 wp_kses($allowedtags),那是 WordPress 的默认白名单,
|
||||
只放行 a/abbr/b/br/em/i/strong 等,**不放行 <code>** ——
|
||||
写 <code> 会被静默剥掉,页面上只剩裸文字。所以这里用 <b> 强调。 */
|
||||
__('变黑白时,页面顶部会出现一条提示,点进去是一个说明页面(彩色),讲清楚为什么变黑白、哪几天会变。<br>这里可以改那个页面的路径。留空默认 <b>memory</b>,即 %s<br><b>注意:</b>不要和已有文章或页面的路径重名。', 'kratos'),
|
||||
esc_url(home_url('/memory/'))
|
||||
),
|
||||
'id' => 'g_rip_page_slug',
|
||||
'std' => 'memory',
|
||||
'type' => 'text',
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'desc' => yang_opt_mourning_status(),
|
||||
'type' => 'info',
|
||||
);
|
||||
|
||||
/* ══════════════════════════════════════════════════════════
|
||||
* 八、收录与统计 —— 给搜索引擎看的
|
||||
* ══════════════════════════════════════════════════════════ */
|
||||
$options[] = array(
|
||||
'name' => __('收录与统计', 'kratos'),
|
||||
'type' => 'heading',
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('分享图片', 'kratos'),
|
||||
'desc' => __('搜索引擎或者社交工具分享首页时抓取的图片', 'kratos'),
|
||||
'desc' => __('搜索引擎或者社交工具分享首页时抓取的图片。<b>留空则自动使用主题自带的默认图片</b>。', 'kratos'),
|
||||
'id' => 'seo_shareimg',
|
||||
'std' => yang_options_default_img('seo_shareimg'),
|
||||
'type' => 'upload',
|
||||
@@ -238,13 +555,13 @@ $options[] = array(
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('统计代码', 'kratos'),
|
||||
'desc' => __('注意:输入 HTML/JS 代码时请注意辨别代码安全!', 'kratos'),
|
||||
'desc' => __('填在页脚的统计脚本(如站点访问量统计)。注意:输入 HTML/JS 代码时请注意辨别代码安全!', 'kratos'),
|
||||
'id' => 'seo_statistical',
|
||||
'type' => 'textarea',
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('robots.txt 配置', 'kratos'),
|
||||
'name' => __('robots.txt 内容', 'kratos'),
|
||||
'desc' => __('- 需要 ', 'kratos') . $seoreading . __(' 是开启的状态,下面的配置才会生效', 'kratos'),
|
||||
'type' => 'info',
|
||||
);
|
||||
@@ -265,182 +582,17 @@ $options[] = array(
|
||||
'type' => 'textarea',
|
||||
);
|
||||
|
||||
/* ══════════════════════════════════════════════════════════
|
||||
* 九、邮件通知 —— SMTP 与评论提醒
|
||||
* ══════════════════════════════════════════════════════════ */
|
||||
$options[] = array(
|
||||
'name' => __('首页配置', 'kratos'),
|
||||
'type' => 'heading',
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('哀悼功能', 'kratos'),
|
||||
'desc' => __('开启后站点首页与文章页转为黑白。这是老的手动开关,开了就一直黑白,与日期无关。日常建议用下面的「按纪念日自动哀悼」。', 'kratos'),
|
||||
'id' => 'g_rip',
|
||||
'type' => 'checkbox',
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('按纪念日自动哀悼', 'kratos'),
|
||||
'desc' => __('勾选后,只有在下表勾选的那些日期才会自动黑白,其余日子正常显示。日期按站点时区判断,只比对月和日,每年循环。', 'kratos'),
|
||||
'id' => 'g_rip_auto',
|
||||
'type' => 'checkbox',
|
||||
);
|
||||
|
||||
// 把内置清单转成 multicheck 需要的格式
|
||||
$rip_options = array();
|
||||
$rip_legal = array();
|
||||
$rip_custom = array();
|
||||
foreach (yang_mourning_presets() as $md => $info) {
|
||||
$entry = array(
|
||||
'name' => $md . ' ' . $info['name'],
|
||||
'note' => $info['note'],
|
||||
);
|
||||
if (isset($info['group']) && $info['group'] === 'legal') {
|
||||
$rip_legal[$md] = $entry;
|
||||
} else {
|
||||
$rip_custom[$md] = $entry;
|
||||
}
|
||||
}
|
||||
|
||||
$rip_default = array();
|
||||
foreach (yang_mourning_presets() as $md => $info) {
|
||||
$rip_default[$md] = !empty($info['default']) ? 1 : 0;
|
||||
}
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('纪念日清单', 'kratos'),
|
||||
'desc' => __('勾选需要自动黑白的日期。<b>默认一个都不勾</b>,请按自己的意愿挑选。前三个是法定纪念日,后面几个是民间通行做法。日期按站点时区判断,只比对月和日,每年循环。', 'kratos'),
|
||||
'id' => 'g_rip_days',
|
||||
'std' => $rip_default,
|
||||
'type' => 'multicheck',
|
||||
'options' => array_merge($rip_legal, $rip_custom),
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('附加日期', 'kratos'),
|
||||
'desc' => __('可选。填 MM-DD 表示每年循环(如 05-12);填 YYYY-MM-DD 表示只在当年生效(如 2020-04-04,用于历次全国哀悼日这类一次性事件)。多个日期用空格或逗号分隔。', 'kratos'),
|
||||
'id' => 'g_rip_extra',
|
||||
'type' => 'text',
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('说明页路径', 'kratos'),
|
||||
'desc' => sprintf(
|
||||
/* 注意:desc 会过 wp_kses($allowedtags),那是 WordPress 的默认白名单,
|
||||
只放行 a/abbr/b/br/em/i/strong 等,**不放行 <code>** ——
|
||||
写 <code> 会被静默剥掉,页面上只剩裸文字。所以这里用 <b> 强调。 */
|
||||
__('变黑白时,页面顶部会出现一条提示,点进去是一个说明页面(彩色),讲清楚为什么变黑白、哪几天会变。<br>这里可以改那个页面的路径。留空默认 <b>memory</b>,即 %s<br><b>注意:</b>不要和已有文章或页面的路径重名。', 'kratos'),
|
||||
esc_url(home_url('/memory/'))
|
||||
),
|
||||
'id' => 'g_rip_page_slug',
|
||||
'std' => 'memory',
|
||||
'type' => 'text',
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'desc' => yang_mourning_status_text(),
|
||||
'type' => 'info',
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('特色图片', 'kratos'),
|
||||
'desc' => __('开启站点首页特色图片功能', 'kratos'),
|
||||
'std' => '1',
|
||||
'id' => 'g_thumbnail',
|
||||
'type' => 'checkbox',
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('默认特色图', 'kratos'),
|
||||
'desc' => __('当文章中没有图片并且没有设置特色图时在首页显示', 'kratos'),
|
||||
'id' => 'g_postthumbnail',
|
||||
'class' => 'hidden',
|
||||
'std' => yang_options_default_img('g_postthumbnail'),
|
||||
'type' => 'upload',
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('无内容图片', 'kratos'),
|
||||
'desc' => __('当搜索不到文章或文章分类中没有文章时显示', 'kratos'),
|
||||
'id' => 'g_nothing',
|
||||
'std' => yang_options_default_img('g_nothing'),
|
||||
'type' => 'upload',
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('文章配置', 'kratos'),
|
||||
'type' => 'heading',
|
||||
);
|
||||
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('文章打赏', 'kratos'),
|
||||
'desc' => __('开启文章页面打赏功能', 'kratos'),
|
||||
'id' => 'g_donate',
|
||||
'type' => 'checkbox',
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('支付宝二维码', 'kratos'),
|
||||
'id' => 'g_donate_alipay',
|
||||
'std' => yang_options_default_img('g_donate_alipay'),
|
||||
'type' => 'upload',
|
||||
'class' => 'hidden',
|
||||
'type' => 'upload',
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('微信二维码', 'kratos'),
|
||||
'id' => 'g_donate_wechat',
|
||||
'std' => yang_options_default_img('g_donate_wechat'),
|
||||
'type' => 'upload',
|
||||
'class' => 'hidden',
|
||||
'type' => 'upload',
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('页面布局', 'kratos'),
|
||||
'desc' => __('是否显示侧边栏小工具(默认显示侧边栏),仅在文章页面生效', 'kratos'),
|
||||
'id' => "g_article_widgets",
|
||||
'std' => "two_side",
|
||||
'type' => "images",
|
||||
'options' => array(
|
||||
'one_side' => $imagepath . 'col-12.png',
|
||||
'two_side' => $imagepath . 'col-8.png')
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('站长配置', 'kratos'),
|
||||
'type' => 'heading',
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('个人头像', 'kratos'),
|
||||
'id' => 'a_gravatar',
|
||||
'std' => yang_options_default_img('a_gravatar'),
|
||||
'type' => 'upload',
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('个人昵称', 'kratos'),
|
||||
'id' => 'a_nickname',
|
||||
'std' => 'Kratos',
|
||||
'type' => 'text',
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('个人简介', 'kratos'),
|
||||
'std' => __('保持饥渴的专注,追求最佳的品质', 'kratos'),
|
||||
'id' => 'a_about',
|
||||
'type' => 'textarea',
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('邮件配置', 'kratos'),
|
||||
'name' => __('邮件通知', 'kratos'),
|
||||
'type' => 'heading',
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('SMTP 服务', 'kratos'),
|
||||
'desc' => __('开启 SMTP 服务功能', 'kratos'),
|
||||
'desc' => __('用第三方邮箱发信。不开启时走服务器本地发信,很多主机上会被判定为垃圾邮件。', 'kratos'),
|
||||
'id' => 'm_smtp',
|
||||
'type' => 'checkbox',
|
||||
);
|
||||
@@ -479,7 +631,7 @@ $options[] = array(
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('邮箱密码', 'kratos'),
|
||||
'desc' => __('填写邮箱密码', 'kratos'),
|
||||
'desc' => __('填写邮箱密码或授权码', 'kratos'),
|
||||
'id' => 'm_passwd',
|
||||
'class' => 'hidden',
|
||||
'type' => 'password',
|
||||
@@ -491,86 +643,9 @@ $options[] = array(
|
||||
'type' => 'sendmail',
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('顶部配置', 'kratos'),
|
||||
'type' => 'heading',
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __( '顶部样式', 'kratos' ),
|
||||
'desc' => __('请选择顶部样式(颜色导航或图片导航)', 'kratos'),
|
||||
'id' => 'top_select',
|
||||
'std' => 'banner',
|
||||
'type' => 'select',
|
||||
'options' => $top_array
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('颜色导航', 'kratos'),
|
||||
'id' => 'top_color',
|
||||
'std' => '#24292e',
|
||||
'class' => 'hidden',
|
||||
'type' => 'color',
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('图片导航', 'kratos'),
|
||||
'id' => 'top_img',
|
||||
'std' => yang_options_default_img('top_img'),
|
||||
'class' => 'hidden',
|
||||
'type' => 'upload',
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('副标题', 'kratos'),
|
||||
'id' => 'top_title',
|
||||
'std' => 'Kratos',
|
||||
'class' => 'hidden',
|
||||
'type' => 'text',
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('标题描述', 'kratos'),
|
||||
'std' => __('一款专注于用户阅读体验的响应式博客主题', 'kratos'),
|
||||
'id' => 'top_describe',
|
||||
'class' => 'hidden',
|
||||
'type' => 'text',
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('页脚配置', 'kratos'),
|
||||
'type' => 'heading',
|
||||
);
|
||||
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('工信部备案信息', 'kratos'),
|
||||
'id' => 's_icp',
|
||||
'placeholder' => __('例如:京ICP证xxxxxx号', 'kratos'),
|
||||
'type' => 'text',
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('公安网备案信息', 'kratos'),
|
||||
'id' => 's_gov',
|
||||
'placeholder' => __('例如:京公网安备 xxxxxxxxxxxx号', 'kratos'),
|
||||
'type' => 'text',
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('公安网备案连接', 'kratos'),
|
||||
'id' => 's_gov_link',
|
||||
'placeholder' => __('例如:http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=xxxxx', 'kratos'),
|
||||
'type' => 'text',
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('版权信息', 'kratos'),
|
||||
'id' => 's_copyright',
|
||||
'std' => 'COPYRIGHT © 2020 ' . $sitename . '. ALL RIGHTS RESERVED.',
|
||||
'type' => 'textarea',
|
||||
);
|
||||
|
||||
/* ══════════════════════════════════════════════════════════
|
||||
* 十、自定义代码 —— 兜底用,放最后
|
||||
* ══════════════════════════════════════════════════════════ */
|
||||
$options[] = array(
|
||||
'name' => __('自定义代码', 'kratos'),
|
||||
'type' => 'heading',
|
||||
@@ -580,7 +655,7 @@ $options[] = array(
|
||||
'name' => __('自定义 CSS', 'kratos'),
|
||||
'desc' => __('附加样式,在所有主题样式之后加载。保存后立即生效,随主题升级保留。', 'kratos'),
|
||||
'id' => 'g_custom_css',
|
||||
'std' => yang_default_custom_css(),
|
||||
'std' => yang_opt_default_custom_css(),
|
||||
'type' => 'code',
|
||||
'settings' => array('rows' => 14),
|
||||
);
|
||||
@@ -595,4 +670,4 @@ $options[] = array(
|
||||
);
|
||||
|
||||
return $options;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user