1
0
Fork 1

Add filtering for bad communities

pull/1/head
mdPlusPlus 1 year ago
parent 395b082b5c
commit ac5bf3732e

@ -582,14 +582,14 @@
}
}
// test if active_users is valid
$active_users = $content["active_users"];
// test if active_users is valid
/*if($active_users == -1) {
$active_users = "N/A"; // this breaks sortTable()
}*/
$line =
" <tr>" . PHP_EOL .
" <tr id=\"" . $id . "\">" . PHP_EOL .
" <td class=\"td_identifier\">" . $id . "</td>" . PHP_EOL .
" <td>" . $content["name"] . "</td>" . PHP_EOL .
" <td>" . $content["description"] . "</td>" . PHP_EOL .
@ -650,7 +650,7 @@
" <script src=\"script.js\" defer></script>" . PHP_EOL .
" <title>" . $title . "</title>" . PHP_EOL .
" </head>" . PHP_EOL .
" <body onload=\"setLastChecked(" . $timestamp . ")\">" . PHP_EOL;
" <body onload=\"onLoad(" . $timestamp . ")\">" . PHP_EOL;
$post =
" </body>" . PHP_EOL .
"</html>" . PHP_EOL;

@ -1,3 +1,33 @@
function onLoad(timestamp) {
setLastChecked(timestamp);
hideBadCommunities();
sortTable(1); // 1 == Name
}
function hideBadCommunities() {
const testCommunityIDs = [
"2e9345+c7fb", // TestRoom
"762ba9+c7fb", // TesterRoom
"b4d829+c7fb", // Test
"e5853a+c7fb", // testtest
"test+118d", // Testing 1, 2, 3
"test+13f6", // Testing room
"test+fe93" // 测试Test)
];
const badCommunityIDs = [
"60fa60+c7fb" // "N-word" Community
];
testCommunityIDs.forEach(hideElementByID);
badCommunityIDs.forEach(hideElementByID);
}
function hideElementByID(id) {
element = document.getElementById(id);
element.style.display = "none";
}
function copyToClipboard(text) {
navigator.clipboard.writeText(text);
}

@ -2,6 +2,8 @@
#tbl_communities { width:100%; }
th { background-color: lightgray; }
#th_identifier { width:9%; }
.td_identifier { font-family: monospace; }
#th_name { width:13%; }