flarum 论坛 插件修改

此插件在中国使用日期不是很理想,于是决定修改代码

下面是插件信息:

User Statistics

A Flarum extension. Add some user statistics in flarum posts, this extension require clarkwinkelmann/flarum-ext-likes-received and will be installed automatically.

flarum 论坛 插件修改_第1张图片

flarum 论坛 插件修改_第2张图片

Usage

Remember to set the permission to "All" for clarkwinkelmann/flarum-ext-likes-received to make it works for guests.

Installation

Install with composer:

composer require justoverclock/user-statistics:"*"

Updating

composer update justoverclock/user-statistics:"*"
php flarum cache:clear

安装教程就不介绍了。进入安装目录,

index/vendor/justoverclock/user-statistics/js/dist

找到 forum.js

flarum 论坛 插件修改_第3张图片

var a=e.joinTime().toString().split(" ").slice(1,4).join(" "),

替换成

var joinTime = e.joinTime();var date = new Date(joinTime);var year = date.getFullYear();var month = ("0" + (date.getMonth() + 1)).slice(-2);var day = ("0" + date.getDate()).slice(-2);var formattedDate = year + "-" + month + "-" + day;var a = formattedDate,

然后在跟目录执行

php flarum cache:clear

flarum 论坛 插件修改_第4张图片

然后前端界面就变成了。

完工。

你可能感兴趣的:(flarum,前端,javascript,开发语言,flarum)