页脚美化

Vela 主题设置 · 分区:底部 · 上级分区:jubu · 选项 ID:moefooter · 类型:switcher

依赖:仅当 'moefooter', '!=', '' 满足时才显示/生效。

页脚美化

功能简介

通用功能

适用场景

  • 当你希望「通用功能」生效时,开启本设置即可,无需改动主题文件。
  • 适用于需要在不写代码的前提下,快速为站点追加「页脚美化」相关表现的场景。
  • 若同一页面存在多个相似美化项,建议只开启其一,避免视觉冲突。

代码实现

📂 文件创建清单

文件 是否需新建 完整存放路径 / 所属文件夹
sections.php 否(已存在) /zibll_child/includes/acg/sections.php —— 「底部」分区的 fields 数组
本设置项 moefooter 作为 sections.phpfields 数组的一项,无需单独建文件

无需新建任何 PHP / JS / CSS 文件。本设置是 Vela 主题设置页的一个开关,字段已写在 /zibll_child/includes/acg/sections.php(相对路径 zibll_child/includes/acg/sections.php)的「底部」分区(上级分区:jubu)。开启后,前端通过 vela_get_option('moefooter') 读取开关状态,由 includes/acg/ 模块输出对应样式类或加载美化资源。

📁 本段代码存放文件

以下 CSF 字段定义 需放在 /zibll_child/includes/acg/sections.phpzibll_child/includes/acg/sections.php)的「底部」分区的 fields 数组中(该项已存在,无需重复添加;若你要新增同类设置,照此格式在对应分区追加即可)。

开关注册代码(CSF 字段定义)

array(
            array(
            'title' => '页脚美化', 
            'label'    => '可爱的底部区块',
            'desc'    => '通用功能',
            'id' => 'moefooter', 
            'default' => false, 
            'type' => 'switcher'
        ), 
        array(
            'title'   => ' ',
            'desc'   => '导航一',
            'id'      => 'title1',
            'default' => '',
            'type'    => 'text',
            'dependency' => array('moefooter', '!=', ''),
            'class'    =>'compact',
        ), 
        array(
            'title'   => ' ',
            'desc'   => '请填写导航一链接',
            'id'      => 'url1',
            'default' => '',
            'type'    => 'text',
            'dependency' => array('moefooter', '!=', ''),
            'class'    =>'compact',
        ),
        array(
            'title'   => ' ',
            'desc'   => '导航二',
            'id'      => 'title2',
            'default' => '',
            'type'    => 'text',
            'dependency' => array('moefooter', '!=', ''),
            'class'    =>'compact',
        ), 
        array(
            'title'   => ' ',
            'desc'   => '请填写导航二链接',
            'id'      => 'url2',
            'default' => '',
            'type'    => 'text',
            'dependency' => array('moefooter', '!=', ''),
            'class'    =>'compact',
        ),
        array(
            'title'   => ' ',
            'desc'   => '导航三',
            'id'      => 'title3',
            'default' => '',
            'type'    => 'text',
            'dependency' => array('moefooter', '!=', ''),
            'class'    =>'compact',
        ), 
        array(
            'title'   => ' ',
            'desc'   => '请填写导航三链接',
            'id'      => 'url3',
            'default' => '',
            'type'    => 'text',
            'dependency' => array('moefooter', '!=', ''),
            'class'    =>'compact',
        ),
        array(
            'title'   => ' ',
            'desc'   => '客服一',
            'id'      => 'kefu1',
            'default' => '',
            'type'    => 'text',
            'dependency' => array('moefooter', '!=', ''),
            'class'    =>'compact',
        ),
        array(
            'title'   => ' ',
            'desc'   => '二维码图片链接',
            'id'      => 'kefuimg1',
            'default' => '',
            'type'    => 'upload',
            'dependency' => array('moefooter', '!=', ''),
            'class'    =>'compact',
        ),
        array(
            'title'   => ' ',
            'desc'   => '客服二',
            'id'      => 'kefu2',
            'default' => '',
            'type'    => 'text',
            'dependency' => array('moefooter', '!=', ''),
            'class'    =>'compact',
        ),
        array(
            'title'   => ' ',
            'desc'   => '二维码图片链接',
            'id'      => 'kefuimg2',
            'default' => '',
            'type'    => 'upload',
            'dependency' => array('moefooter', '!=', ''),
            'class'    =>'compact',
        ),
        array(
            'title'   => ' ',
            'desc'   => '客服三',
            'id'      => 'kefu3',
            'default' => '',
            'type'    => 'text',
            'dependency' => array('moefooter', '!=', ''),
            'class'    =>'compact',
        ),
        array(
            'title'   => ' ',
            'desc'   => '图片链接',
            'id'      => 'kefuimg3',
            'default' => '',
            'type'    => 'upload',
            'dependency' => array('moefooter', '!=', ''),
            'class'    =>'compact',
        ),
        array(
            'title'   => ' ',
            'desc'   => 'QQ',
            'id'      => 'footerqq',
            'default' => '',
            'type'    => 'text',
            'dependency' => array('moefooter', '!=', ''),
            'class'    =>'compact',
        ),
        array(
            'title'   => ' ',
            'desc'   => '交流群',
            'id'      => 'footerqun',
            'default' => '',
            'type'    => 'text',
            'dependency' => array('moefooter', '!=', ''),
            'class'    =>'compact',
        ),
        array(
            'title'   => ' ',
            'desc'   => '邮箱',
            'id'      => 'email',
            'default' => '',
            'type'    => 'text',
            'dependency' => array('moefooter', '!=', ''),
            'class'    =>'compact',
        ),
        array(
            'title'   => ' ',
            'desc'   => '备案号填在这里,支持自定义html显示在最下面',
            'id'      => 'footerzdy',
            'default' => '',
            'type'    => 'text',
            'dependency' => array('moefooter', '!=', ''),
            'class'    =>'compact',
        ),
            array(
            'title' => '右下角悬浮窗口', 
            'label'    => '开启后右下角多一个悬浮窗口引导开通会员',
            'desc'    => '通用功能',
            'id' => 'vip', 
            'default' => false, 
            'type' => 'switcher'
        ), 
        array(
            'title'   => ' ',
            'desc'   => '请填写标题',
            'id'      => 'vip1',
            'default' => '冬季限时福利',
            'type'    => 'text',
            'dependency' => array('vip', '!=', ''),
            'class'    =>'compact',
        ), 
        array(
            'title'   => ' ',
            'desc'   => '请填写引导语',
            'id'      => 'vip2',
            'default' => '2023年12月28日至10月8日',
            'type'    => 'text',
            'dependency' => array('vip', '!=', ''),
            'class'    =>'compact',
        ), 
        array(
            'title'   => ' ',
            'desc'   => '请填写按钮内容',
            'id'      => 'vip3',
            'default' => '永久会员仅需68¥',
            'type'    => 'text',
            'dependency' => array('vip', '!=', ''),
            'class'    =>'compact',
        ), 
        array(
            'title'   => ' ',
            'desc'   => '倒计时',
            'id'      => 'vip4',
            'default' => '2023/12/28',
            'type'    => 'text',
            'dependency' => array('vip', '!=', ''),
            'class'    =>'compact',
        ),
        array(
            'title'   => ' ',
            'desc'   => '关闭后多长时间不在弹出 0为每次都弹出 默认1天内不再弹出',
            'id'      => 'vip6',
            'default' => '1',
            'type'    => 'text',
            'dependency' => array('vip', '!=', ''),
            'class'    =>'compact',
        ),
        array(
            'title'   => ' ',
            'desc'   => '设置旁边小图',
            'id'      => 'vip5',
            'default' => '',
            'type'    => 'upload',
            'dependency' => array('vip', '!=', ''),
            'class'    =>'compact',
        ),
            array(
                'title'   => '网站底部波浪',
                'label'   => '开启后可以在网站底部显示一个蓝色波浪',
                'id'      => 'bolang',
                'default' => false,
                'type'    => 'switcher',
            ),
            array(
                'title'   => '底部二维码滤镜一',
                'label'   => 'hue-rotate 色相旋转',
                'id'      => 'erweima1',
                'default' => false,
                'type'    => 'switcher',
            ),
            array(
                'title'   => '底部二维码滤镜二',
                'label'   => 'invert 反色',
                'id'      => 'erweima2',
                'default' => false,
                'type'    => 'switcher',
            ),
            array(
                'title'   => '底部二维码滤镜三',
                'label'   => 'drop-shadow 阴影',
                'id'      => 'erweima3',
                'default' => false,
                'type'    => 'switcher',
            ),
            array(
                'title'   => '底部收藏本站',
                'label'   => '开启后将在网站底部显示Ctrl+D收藏本站提示',
                'desc'   => '通用功能',
                'id'      => 'dixian',
                'default' => false,
                'type'    => 'switcher',
            ),
           array(
                'title'   => '网站底部广告',
                'label'   => '开启后可在网站底部显示广告',
                'desc'   => '通用功能',
                'id'      => 'advertisement',
                'default' => false,
                'type'    => 'switcher',
            ),
             array(
                'title'   => ' ',
                'desc'   => '请填写广告链接地址',
                'id'      => 'advertisement1',
                'default' => false,
                'type'    => 'text',
                'dependency' => array('advertisement', '!=', ''),
                'class'    =>'compact',

            ),
             array(
                'title'   => '右下角蒲公英',
                'label'   => '开启后网站底部将显示动态蒲公英特效',
                'desc'   => '通用功能',
                'id'      => 'plbj5',
                'default' => false,
                'type'    => 'switcher',
            ),
             array(
                'title'   => '底部导航栏',
                'label'   => '开启后可自定义网站底部导航',
                'desc'   => '通用功能',
                'id'      => 'plbj4',
                'default' => false,
                'type'    => 'switcher',
            ),
            array(
                'title'   => '文案&时间',
                'dependency' => array('plbj4', '!=', ''),
                'desc'    => '请填写左侧文案和时间',
                'id'      => 'bottomnav0',
                'default' => false,
                'type'    => 'text',
            ),
             array(
                'title'   => ' ',
                'desc'   => '请填写您的建站时间,如:2022-20-25',
                'id'      => 'timeauthor1',
                'default' => false,
                'type'    => 'text',
                'dependency' => array('plbj4', '!=', ''),
                'class'    =>'compact',

            ),
             array(
                'title'   => '导航一',
                'dependency' => array('plbj4', '!=', ''),
                'desc'    => '请填写导航文字',
                'id'      => 'bottomnav1',
                'default' => false,
                'type'    => 'text',
            ),
             array(
                'title'   => ' ',
                'dependency' => array('plbj4', '!=', ''),
                'desc'    => '请填写导航链接',
                'id'      => 'bottomhre1',
                'class'    =>'compact',
                'default' => false,
                'type'    => 'text',
            ),
             array(
                'title'   => '导航二',
                'dependency' => array('plbj4', '!=', ''),
                'id'      => 'bottomnav2',
                'desc'    => '请填写导航文字',
                'default' => false,
                'type'    => 'text',
            ),
             array(
                'title'   => ' ',
                'dependency' => array('plbj4', '!=', ''),
                'desc'    => '请填写导航链接',
                'class'    =>'compact',
                'id'      => 'bottomhre2',
                'default' => false,
                'type'    => 'text',
            ),
             array(
                'title'   => '导航三',
                'dependency' => array('plbj4', '!=', ''),
                'desc'    => '请填写导航文字',
                'id'      => 'bottomnav3',
                'default' => false,
                'type'    => 'text',
            ),
             array(
                'title'   => ' ',
                'dependency' => array('plbj4', '!=', ''),
                'desc'    => '请填写导航链接',
                'id'      => 'bottomhre3',
                'class'    =>'compact',
                'default' => false,
                'type'    => 'text',
            ),
             array(
                'title'   => '导航四',
                'dependency' => array('plbj4', '!=', ''),
                'desc'    => '请填写导航文字',
                'id'      => 'bottomnav4',
                'default' => false,
                'type'    => 'text',
            ),
             array(
                'title'   => ' ',
                'dependency' => array('plbj4', '!=', ''),
                'desc'    => '请填写导航链接',
                'class'    =>'compact',
                'id'      => 'bottomhre4',
                'default' => false,
                'type'    => 'text',
            ),
             array(
                'title'   => '导航五',
                'dependency' => array('plbj4', '!=', ''),
                'desc'    => '请填写导航文字',
                'id'      => 'bottomnav5',
                'default' => false,
                'type'    => 'text',
            ),
             array(
                'title'   => ' ',
                'dependency' => array('plbj4', '!=', ''),
                'desc'    => '请填写导航链接',
                'class'    =>'compact',
                'id'      => 'bottomhre5',
                'default' => false,
                'type'    => 'text',
            ),
      )

使用示例

  1. 后台 外观 → Vela主题设置 → 底部,找到「页脚美化」开关并打开,保存设置。
  2. 回到前台对应页面,即可看到效果(部分项仅 PC 端或仅子比主题生效,详见说明)。
  3. 在主题或插件代码中读取该设置:
$on = vela_get_option('moefooter', false);
if ($on) {
    // 开关已开启,自定义逻辑
}
© 版权声明
THE END
喜欢就支持一下吧
点赞13 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容