侧边栏壁纸
博主头像
Xw'Blog 博主等级

羌笛何须怨杨柳,春风不度玉门关。

  • 累计撰写 41 篇文章
  • 累计创建 9 个标签
  • 累计收到 3 条评论

目 录CONTENT

文章目录

[Typecho]增加评论弹幕

Xiao
2024-04-30 / 0 评论 / 0 点赞 / 33 阅读 / 0 字 / 正在检测是否收录...
温馨提示:
本文最后更新于2024-05-15,若内容或图片失效,请留言反馈。 部分素材来自网络,若不小心影响到您的利益,请联系我们删除。

需要修改的文件header.php

  • 路径usr/themes/Joe/public/header.php

options->JBarragerStatus === 'on') : ?>
    widget('Widget_Comments_Recent@index', 'pageSize=15')->to($comments); ?>
    
        have()) : ?>
            next()) : ?>
                
                    
                    content); ?>

options->JBarragerStatus === 'on') : ?>
options->JBarragerStatus === 'on') : ?>

修改文件include.php

  • 路径 usr/themes/Joe/public/include.php

options->JBarragerStatus === 'on') : ?>

修改文件functions.php

  • 路径usr/themes/Joe/functions.php

$JBarragerStatus = new Typecho_Widget_Helper_Form_Element_Select(
    'JBarragerStatus',
      array('off' => '关闭(默认)', 'on' => '开启'),
    'off',
    '是否开启弹幕功能(仅限PC)',
    '介绍:开启后,网站将会显示评论弹幕功能,该功能采用CSS动画引擎,并非传统JS操作DOM,无任何性能消耗。'
    );
$JBarragerStatus->setAttribute('class', 'joe_content joe_other');
$form->addInput($JBarragerStatus->multiMode());

修改config.php

  • 位置:usr/themes/Joe/public/config.php

/* 弹幕 */
DOCUMENT_BARRAGER: 'options->JBarragerStatus === 'on' ? 'on' : 'off' ?>'

上传前端代码

  • 位置:usr/themes/Joe/library

评论区