Given the influx of threads complaining about the PRSI, ShinyDren's excellent post about hiding the PRSI (and other sub-fora) from the Latest Reply sidebar has received a surprising lack of attention, so I'm reiterating it here.
The scripts below grabs the list of forums you've ignored when you visit the Forums You Ignore page, and then it hides every reply that falls under corresponding thread-node-numbers from the sidebar.
You'll need a browser extension that can run user scripts, like TamperMonkey. Paste the following code into a new user script, click save, and view the Forums You Ignore page so it can grab the list. Thanks, @ShinyDren!
EDIT: Below, I've added the ability to also hide your ignored forums from the main list of forums, so right now, I don't even see a PRSI below the Site and Forum Feedback forum. Probably not the most useful addition for most, but I'm also using a stylesheet that makes Xenforo's list of forums look more like VBulletin used to.
The scripts below grabs the list of forums you've ignored when you visit the Forums You Ignore page, and then it hides every reply that falls under corresponding thread-node-numbers from the sidebar.
You'll need a browser extension that can run user scripts, like TamperMonkey. Paste the following code into a new user script, click save, and view the Forums You Ignore page so it can grab the list. Thanks, @ShinyDren!
Code:
// ==UserScript==
// @name MacRumors - Hide Ignored Forums in Latest Replies in Sidebar
// @namespace mr.ShinyDren
// @version 0.3
// @description Hide posts in Latest Replies in sidebar if they are in a node being ignored via site account settings.
// @author ShinyDren
// @match https://forums.macrumors.com/
// @match https://forums.macrumors.com/account/ignored-forums
// @grant none
// ==/UserScript==
// localStorage is assumed
var ignoredNodeRegex = /-47$/i; // fallback value
var numHidden = 0;
function copyIgnoredToLocalstorage() {
if ( localStorage.getItem("_mod_sd_siteIgnoreForums") === null ) { // See if the localStorage item exists, display info message if not (only show message once).
alert("Congratulations, it appears this is the first time running this script on the \"Forums You Ignore\" settings page.\n\nAny forums you select to ignore here will also be used to hide posts in the sidebar on the front page of the forums.");
}
var regexList = '';
var checkedItems = document.querySelectorAll("ul.ignoredNodeList li input:checked"); // Get all matches.
for (i = 0; i < checkedItems.length; i++) {
var myValue = checkedItems[i].getAttribute("value");
if ( i > 0 ) {
regexList = regexList + "|";
}
regexList = regexList + "-" + myValue + "$";
}
localStorage.setItem("_mod_sd_siteIgnoreForums", regexList);
}
function checkReplies() { // Called once at page load.
var theReplies = document.querySelectorAll(".sidebar .widget .avatarList li"); // Get all matches.
if ( localStorage.getItem("_mod_sd_siteIgnoreForums") !== null ) { // If the ignoreForums value has been set use it instead of the fallback value.
ignoredNodeRegex = new RegExp(localStorage.getItem("_mod_sd_siteIgnoreForums"), 'i');
}
for (i = 0; i < theReplies.length; i++) {
if ( ignoredNodeRegex.test(theReplies[i].classList.item(1)) ) { // Contains the text.
theReplies[i].style.display = "none"; // Hide the reply.
numHidden++;
}
}
if ( numHidden > 0 ) {
var myNode = document.createElement("LI");
var myTextnode = document.createTextNode(numHidden + " replies hidden per your request");
myNode.appendChild(myTextnode);
myNode.className = "userTitle"; // match other text
myNode.style.padding = "10px 0 0 15px"; // adjust spacing
theReplies[1].parentNode.appendChild(myNode);
}
}
var myLoc = location.pathname;
//alert(myLoc); // for testing
if ( myLoc == "/account/ignored-forums" ) { // Get ignored items from page
copyIgnoredToLocalstorage();
}
if ( myLoc == "/" ) { // Check/Hide replies
checkReplies();
}
EDIT: Below, I've added the ability to also hide your ignored forums from the main list of forums, so right now, I don't even see a PRSI below the Site and Forum Feedback forum. Probably not the most useful addition for most, but I'm also using a stylesheet that makes Xenforo's list of forums look more like VBulletin used to.
Code:
// ==UserScript==
// @name MacRumors - Hide Ignored Forums AND Their Latest Replies
// @namespace mr.ShinyDren
// @version 0.31
// @description Hide posts in Latest Replies in sidebar if they are in a node being ignored via site account settings.
// @author ShinyDren & Danger
// @match https://forums.macrumors.com/
// @match https://forums.macrumors.com/account/ignored-forums
// @grant none
// ==/UserScript==
// localStorage is assumed
var ignoredNodeRegex = /47$/i; // fallback value
var numHidden = 0;
function copyIgnoredToLocalstorage() {
if ( localStorage.getItem("_mod_sd_siteIgnoreForums") === null ) { // See if the localStorage item exists, display info message if not (only show message once).
alert("Congratulations, it appears this is the first time running this script on the \"Forums You Ignore\" settings page.\n\nAny forums you select to ignore here will also be used to hide posts in the sidebar on the front page of the forums.");
}
var regexList = '';
var checkedItems = document.querySelectorAll("ul.ignoredNodeList li input:checked"); // Get all matches.
for (i = 0; i < checkedItems.length; i++) {
var myValue = checkedItems[i].getAttribute("value");
if ( i > 0 ) {
regexList = regexList + "|";
}
regexList = regexList + myValue + "$";
}
localStorage.setItem("_mod_sd_siteIgnoreForums", regexList);
}
function checkReplies() { // Called once at page load.
var theReplies = document.querySelectorAll(".sidebar .widget .avatarList li"); // Get all matches.
var theForums = document.querySelectorAll(".level_2");
if ( localStorage.getItem("_mod_sd_siteIgnoreForums") !== null ) { // If the ignoreForums value has been set use it instead of the fallback value.
ignoredNodeRegex = new RegExp(localStorage.getItem("_mod_sd_siteIgnoreForums"), 'i');
}
for (i = 0; i < theForums.length; i++) {
//console.log(theReplies[i].classList.item(3));
if ( ignoredNodeRegex.test(theForums[i].classList.item(3)) ) { // Contains the text.
theForums[i].style.display = "none"; // Hide the forum.
}
}
for (i = 0; i < theReplies.length; i++) {
//console.log(theReplies[i].classList.item(3));
if ( ignoredNodeRegex.test(theReplies[i].classList.item(1)) ) { // Contains the text.
theReplies[i].style.display = "none"; // Hide the reply.
numHidden++;
}
}
if ( numHidden > 0 ) {
var myNode = document.createElement("LI");
var myTextnode = document.createTextNode(numHidden + " replies hidden per your request");
myNode.appendChild(myTextnode);
myNode.className = "userTitle"; // match other text
myNode.style.padding = "10px 0 0 15px"; // adjust spacing
theReplies[1].parentNode.appendChild(myNode);
}
}
var myLoc = location.pathname;
//alert(myLoc); // for testing
if ( myLoc == "/account/ignored-forums" ) { // Get ignored items from page
copyIgnoredToLocalstorage();
}
if ( myLoc == "/" ) { // Check/Hide replies
checkReplies();
}
Last edited: