- // ==UserScript==
- // [url=home.php?mod=space&uid=48079]@name[/url] 查看小黑屋是被谁封禁的
- // [url=home.php?mod=space&uid=2522887]@namespace[/url] xmdhs
- // [url=home.php?mod=space&uid=2203813]@VERSION[/url] 0.3
- // @description 查看小黑屋是被谁封禁的。
- // [url=home.php?mod=space&uid=1231151]@author[/url] xmdhs
- // [url=home.php?mod=space&uid=111591]@match[/url] */forum.php?mod=misc&action=showdarkroom
- // ==/UserScript==
- var b = document.getElementsByClassName("pg");
- if (b.length == 0) {
- bb = 10000
- } else {
- var bb = b[0].childNodes[0].attributes[3].value
- bb = bb + "0"
- }
- var x = new Ajax('JSON');
- x.getJSON("forum.php?mod=misc&action=showdarkroom&cid=" + bb, function (s) {
- var list = s.data;
- var a = document.getElementsByClassName("bm dt");
- a[0].children[0].children[0].innerHTML += '<th class="xw1" style="width:105px;">操作者</th>'
- var c = a[0].childNodes[1].children.length
- for (let index = 0; index < c; index++) {
- b = a[0].children[0].children[index].id;
- var uid = b.substring(12);
- if (uid > 0) {
- var operator = list[uid].operator;
- var operatorid = list[uid].operatorid;
- a[0].children[0].children[index].innerHTML += '<td><a href="home.php?mod=space&uid=' + operatorid + '" target="_blank">' + operator + '</a></td>';
- }
- }
- }
- )
- if ($('darkroommore')) {
- $('darkroommore').onclick = function () {
- var obj = this;
- var cid = parseInt(obj.getAttribute('cid').valueOf());
- var url = 'forum.php?mod=misc&action=showdarkroom&cid=' + cid + '&t=' + parseInt((+new Date() / 1000) / (Math.random() * 1000));
- var table = $('darkroomtable');
- var tablerows = table.rows.length;
- var x = new Ajax('JSON');
- x.getJSON(url, function (s) {
- if (s && s.message) {
- if (s.message.dataexist == 1) {
- obj.setAttribute('cid', s.message.cid);
- } else {
- obj.style.display = 'none';
- }
- var list = s.data;
- for (i in list) {
- if ($('darkroomuid_' + list[i].uid)) {
- continue;
- }
- var newtr = table.insertRow(tablerows);
- if (tablerows % 2 == 0) {
- newtr.className = 'alt';
- }
- newtr.insertCell(0).innerHTML = '<a href="home.php?mod=space&uid=' + list[i].uid + '" target="_blank">' + list[i].username + '</a>';
- newtr.insertCell(1).innerHTML = list[i].action;
- newtr.insertCell(2).innerHTML = list[i].groupexpiry;
- newtr.insertCell(3).innerHTML = list[i].dateline;
- newtr.insertCell(4).innerHTML = list[i].reason;
- newtr.insertCell(5).innerHTML = '<a href="home.php?mod=space&uid=' + list[i].operatorid + '" target="_blank">' + list[i].operator + '</a>';
- tablerows++;
- }
- }
- });
- };
- }
复制代码 |