因为本论坛也是基于Discourse模版!所以适用于大多数论坛~
由于众多佬友询问如何使用,那我也不能再偷懒了!下面一步步手把手教学吧!
首先先下载篡改猴插件!
上面是edge浏览器的,下面是chrome浏览器的!其实通用的!
安装完成之后,将其固定在工具栏中!
![]()
点击这个进入到扩展选项
点击油猴脚本的图标!
全选删除上面原有代码,将下面的进行复制,粘贴进去即可,按ctrl+s进保持。
// ==UserScript==
// @name MJJ分数与排名显示
// @namespace http://tampermonkey.net/
// @version 2025-9-9
// @description 显示排名和积分(含今日排名)
// @author You
// @match https://mjjbox.com/*
// @icon https://mjjbox.com/user_avatar/mjjbox.com/admin/48/106_2.png
// @grant none
// ==/UserScript==
(function () {
'use strict';
// 创建显示元素
function createDisplay() {
const headerUL = document.querySelector(".icons.d-header-icons");
if (!headerUL) return;
const li = document.createElement('li');
li.id = 'nodeScoreHeader_score_id';
li.className = 'icon-header icon-header-small icon-header-link';
li.style.marginLeft = '12px';
const button = document.createElement('button');
button.id = 'nodeScoreHeader_id_val';
button.className = 'btn no-text btn-icon ai-bot-button icon btn-flat';
button.style.width = 'auto';
button.style.cursor = 'pointer';
button.title = '点击查看排行榜';
button.innerHTML = '加载中...';
button.onclick = () => window.open(`${window.location.origin}/leaderboard/1`, '_blank');
li.appendChild(button);
headerUL.insertBefore(li, headerUL.firstChild);
}
// 获取用户ID并执行后续操作
function init() {
const interval = setInterval(() => {
const userImgBTN = document.getElementById("toggle-current-user");
if (!userImgBTN) return;
try {
const userID = userImgBTN.querySelector("img").src.split('/').slice(-3)[0];
clearInterval(interval);
// 获取今日排名
fetch(`${window.location.origin}/leaderboard/1.json?period=daily`)
.then(res => res.json())
.then(dailyData => {
const dailyRank = dailyData?.personal?.position;
// 获取全局排名
fetch(`${window.location.origin}/leaderboard/1.json`)
.then(res => res.json())
.then(data => {
const rank = data?.personal?.position;
// 获取积分
fetch(`${window.location.origin}/u/${userID}.json`)
.then(res => res.json())
.then(data => {
const score = data?.user?.gamification_score;
const btn = document.getElementById("nodeScoreHeader_id_val");
if (btn && rank && score) {
let displayText = '';
// 添加今日排名(如果存在)
if (dailyRank) {
displayText += `今日排名: <span style="color:orange;font-weight:bold">${dailyRank}</span> `;
}
// 添加全局排名和积分
displayText += `排名: <span style="color:red;font-weight:bold">${rank}</span> 积分: <span style="color:green;font-weight:bold">${score}</span>`;
btn.innerHTML = displayText;
}
});
});
})
.catch(() => {
// 如果获取今日排名失败,只显示全局排名和积分
fetch(`${window.location.origin}/leaderboard/1.json`)
.then(res => res.json())
.then(data => {
const rank = data?.personal?.position;
fetch(`${window.location.origin}/u/${userID}.json`)
.then(res => res.json())
.then(data => {
const score = data?.user?.gamification_score;
const btn = document.getElementById("nodeScoreHeader_id_val");
if (btn && rank && score) {
btn.innerHTML = `排名: <span style="color:red;font-weight:bold">${rank}</span> 积分: <span style="color:green;font-weight:bold">${score}</span>`;
}
});
});
});
} catch (e) {
// 忽略错误
}
}, 1000);
// 30秒后清除定时器,避免无限循环
setTimeout(() => clearInterval(interval), 30000);
}
// 执行初始化
createDisplay();
init();
})();
如果操作成功,重新访问MJJ网站时就会显示下面的排名积分

实际使用效果~



