右下角弹幕

Vela 主题设置 · 分区:弹窗提示 · 上级分区:gongneng · 选项 ID:danmu · 类型:spinner

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

右下角弹幕

功能简介

在页面右下角显示网站付费弹幕,移动端不显示

适用场景

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

代码实现

📂 文件创建清单

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

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

📁 本段代码存放文件

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

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

array(
            array(
            'id'          => 'danmu',
            'title'       => '右下角弹幕',
            'desc'        => '在页面右下角显示网站付费弹幕,移动端不显示',
            'type'        => "switcher",
            'default'     => false,
        ),
        array(
            'class'       => 'compact',
            'dependency'  => array( 'danmu', '==', true),
            'id'          => 'danmu_limit',
            'title'       => '弹幕显示条数',
            'desc'        => '显示的弹幕条数,请根据服务器配置调整',
            'default'     => 20,
            'max'         => 100,
            'min'         => 1,
            'step'        => 10,
            'unit'        => '条',
            'type'        => 'spinner',
        ),
        array(
            'class'    =>'compact',
            'dependency'  => array( 'danmu', '==', true),
            'id'          => 'danmu_auth',
            'title'       => '认证图标',
            'desc'        => '开启后显示认证图标',
            'type'        => "switcher",
            'default'     => false,
        ),
        array(
            'class'    =>'compact',
            'dependency'  => array( 'danmu', '==', true),
            'id'          => 'danmu_vip',
            'title'       => '会员图标',
            'desc'        => '开启后显示会员图标',
            'type'        => "switcher",
            'default'     => false,
        ),
        array(
            'class'    =>'compact',
            'dependency'  => array( 'danmu', '==', true),
            'id'          => 'danmu_medal',
            'title'       => '勋章图标',
            'desc'        => '开启后显示勋章图标',
            'type'        => "switcher",
            'default'     => false,
        ),
        array(
            'class'    =>'compact',
            'dependency'  => array( 'danmu', '==', true),
            'id'          => 'danmu_level',
            'title'       => '等级图标',
            'desc'        => '开启后显示等级图标',
            'type'        => "switcher",
            'default'     => false,
        ),
            array(
                'title'   => '图床',
                'label'   => '启用后,后台右下角显示一个图床悬浮按钮',
                'desc'   => '点击后弹窗上传入口,可直接拖动上传<br>如需管理图片请先在官网登录 <a  href="https://tuchuang.org.cn/" target="_blank"></a>',
                'id'      => 'tuchuang',
                'default' => false,
                'type'    => 'switcher',
            ),
            array(
                'title'   => '日间、夜间切换提示',
                'label'   => '启用后,进行日间夜间模式切换时,谁有弹窗提示',
                'id'      => 'qiehuan',
                'default' => false,
                'type'    => 'switcher',
            ),
             array(
                'title'   => '复制成功提示框1',
                'label'   => '启用后,当用户复制内容时会有弹窗提示',
                'id'      => 'fuzhitishi1',
                'default' => false,
                'type'    => 'switcher',
            ),
              array(
                'title'   => '复制成功提示框2',
                'label'   => '启用后,当用户复制内容时会有弹窗提示',
                'id'      => 'fuzhitishi2',
                'default' => false,
                'type'    => 'switcher',
            ),
               array(
                'title'   => '复制成功提示框3',
                'label'   => '启用后,当用户复制内容时会有弹窗提示',
                'id'      => 'fuzhitishi3',
                'default' => false,
                'type'    => 'switcher',
            ),
             array(
                'title'   => '复制成功提示框4',
                'label'   => '启用后,当用户复制内容时会有弹窗提示',
                'desc'   => '仅子比可用',
                'id'      => 'fuzhitishi4',
                'default' => false,
                'type'    => 'switcher',
            ),
            array(
                'title'   => '复制后保存原文地址',
                'label'   => '启用后,用户复制内容后同时会将原文地址复制到粘贴板上',
                'id'      => 'noft1',
                'default' => false,
                'type'    => 'switcher',
            ),
            array(
            'id'         => 'vxras_Togreet',
            'type'       => 'switcher',
            'title'      => '是否显示网站时段问候语',
            // 'desc'      => '开启后信息页报错,暂未解决这个问题',
            'help'      => '开启感觉萌萌哒',
            'default'    => false,
        ),
                array(
                    'dependency' => array('vxras_Togreet', '==', 'true'),
                    'id'         => 'vxras_huanying_text',
                    'type'       => 'text',
                    'title'      => '欢迎语',
                    'dsec'       => '进入网站时的欢迎语',
                    'default'    => '欢迎访问本站<br>您的访问时本站的荣幸<br>希望您能在本站<br>找到您想要的资源',           
                ),
                array(
                    'dependency' => array('vxras_Togreet', '==', 'true'),
                    'id'         => 'vxras_wuye_text',
                    'type'       => 'text',
                    'title'      => '时段问候语午夜',
                    'dsec'       => '时段问候语午夜文本',
                    'default'    => '阿瑞斯提示您 午夜骚年,快睡觉去,妹纸等你太久了会不耐烦的哦!',           
                ),
                array(
                    'dependency' => array('vxras_Togreet', '==', 'true'),
                    'id'         => 'vxras_zaoshang_down',
                    'type'       => 'text',
                    'title'      => '时段问候语早上',
                    'dsec'       => '时段问候语早上文本',
                    'default'    => '早上好~今天又是元气满满的一天哦!先去尝尝鲜</a>~',           
                ),
                array(
                    'dependency' => array('vxras_Togreet', '==', 'true'),
                    'id'         => 'vxras_shangwu_down',
                    'type'       => 'text',
                    'title'      => '时段问候语上午',
                    'dsec'       => '时段问候语上午文本',
                    'default'    => '最难的任务适合在上午时段攻克哦,期待您的订单~',           
                ),
                array(
                    'dependency' => array('vxras_Togreet', '==', 'true'),
                    'id'         => 'vxras_zhongwu_down',
                    'type'       => 'text',
                    'title'      => '时段问候语中午',
                    'dsec'       => '时段问候语中午文本',
                    'default'    => '中午拿什么填补我空虚的胃和心灵?<br />停下手中的工作,快去吃饭吧,晚了就没的吃了',           
                ),
                array(
                    'dependency' => array('vxras_Togreet', '==', 'true'),
                    'id'         => 'vxras_xiawu_down',
                    'type'       => 'text',
                    'title'      => '时段问候语下午',
                    'dsec'       => '时段问候语下午文本',
                    'default'    => '下午时段阿瑞斯正在优化细节,力求做一个人见人爱的“细节控”哦~',           
                ),
                array(
                    'dependency' => array('vxras_Togreet', '==', 'true'),
                    'id'         => 'vxras_bangwan_texte',
                    'type'       => 'text',
                    'title'      => '时段问候语傍晚',
                    'dsec'       => '时段问候语傍晚文本',
                    'default'    => '快要下班了吧?休息会扒根烟喝杯茶~',           
                ),
                 array(
                    'dependency' => array('vxras_Togreet', '==', 'true'),
                    'id'         => 'vxras_yewan_link',
                    'type'       => 'text',
                    'title'      => '时段问候语夜晚',
                    'dsec'       => '时段问候语夜晚文本',
                    'default'    => '晚安~音乐、运动、阅读,睡前时间放松一下,灵感也许会悄悄到来!',        
                ), 
                array(
                    'dependency' => array('vxras_Togreet', '==', 'true'),
                    'id'         => 'vxras_xiuxi_down',
                    'type'       => 'text',
                    'title'      => '时段问候语该休息了',
                    'dsec'       => '时段问候语该休息了文本',
                    'default'    => '累了就早点休息~<br />晚间22:00-5:00是最佳睡眠时间哦',
            ),
      )

使用示例

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

请登录后发表评论

    暂无评论内容