** solution to the moderation issue ** - firefox required
-
- Posts: 6490
- Joined: Thu Jun 17, 2004 4:23 pm
- Location: Seattle, WA.
hmmm...as far as I can tell it should be as simple as setting the folder the .js file is in in the preferences>content in opera and it should work - the opera documentation even says if it sees the file has the extension user.js then it will see it as a greasemonkey fileforge wrote:I've been trying to figure that out - sweetjesus reckons you can but I dont know where you put itlongjohns wrote:so what's the word on possibility with Opera?
but for some reason it's not working
doesnt make much sense to me
http://www.opera.com/support/tutorials/userjs/
http://www.opera.com/support/tutorials/ ... easemonkey
not working here
http://www.opera.com/support/tutorials/userjs/
http://www.opera.com/support/tutorials/ ... easemonkey
not working here
I haven't used the script and don't know if I will but ever since this thread was started I haven't seen a lot of trolls posting. Good job guys. I guess if they can't get under certain people's skin then they see no point in posting anything. But I predict a lot of "noobs" will appear any minute now.
Ok, here's the new version of the script.
I should say I am standing on the shoulders of giants here, having never used XPATH before I lifted chunks from all over the place.
This version is a lot more user friendly and robust than the previous versions.
How to use it (after installing)
You don't need to edit anything anymore, this version is point and click to banish a troll.
After installing, when you read a post in a thread such as this you will see the posters name now has a faint grey [X] next to it. So I would appear as
[X] Angstrom
if you click the [X] the user is then hidden, all that remains is a blank row with an [X] in . If you want to see who the [X] person is ... hover over that [X] you will see the name of the offending party, it will say "click to show Mr Bad']3@$$man " (or something similar).
Obviously, clicking will restore all the posts by Mr Bad']3@$$man.
In the main listings such as 'general' or 'search results'
All posts started by your defined trolls Bad']3@$$man, and his friends are hidden from the main listings
How to install it
same as before
It could be and will be sped up and refined over time, but not just now, this works ... which is good enough.
right, can I go back to making music now ?
thanks.
I should say I am standing on the shoulders of giants here, having never used XPATH before I lifted chunks from all over the place.
This version is a lot more user friendly and robust than the previous versions.
How to use it (after installing)
You don't need to edit anything anymore, this version is point and click to banish a troll.
After installing, when you read a post in a thread such as this you will see the posters name now has a faint grey [X] next to it. So I would appear as
[X] Angstrom
if you click the [X] the user is then hidden, all that remains is a blank row with an [X] in . If you want to see who the [X] person is ... hover over that [X] you will see the name of the offending party, it will say "click to show Mr Bad']3@$$man " (or something similar).
Obviously, clicking will restore all the posts by Mr Bad']3@$$man.
In the main listings such as 'general' or 'search results'
All posts started by your defined trolls Bad']3@$$man, and his friends are hidden from the main listings
How to install it
same as before
- get firefox
- install greasemonkey extension
- Once installed in Firefox and restarted, in the Tools menu, Choose Greasemonkey, then New User Script
- In the dialog box, Name your script (such as Troll Killer), leave all the other boxes blank
- You might get a dialog box to associate your script with a program...browse to any text editor to associate your scripts to the text editor. An example is C:\WINDOWS\NOTEPAD.EXE
- In the window that opens up with your blank script, select all and delete.
- Then copy and paste with the following script (below)
- finally - in Tools -> Greasemonkey - > Manage User Scripts , include the following pages
http://*viewtopic.php*
http://*viewforum.php*
http://*search.php* - refresh this page and you shoudl see the little [X] appear next to usernames. Happy troll killing
Code: Select all
// ==UserScript==
// @name phpBB User Hide
// @include *viewtopic.php* *search.php* *viewforum.php*
// @description Hides/unhides a user's posts
// @exclude
// ==/UserScript==
(function() {
// Get stored hidden users from cookie
var users = [];
var cookieName = "phpUserHide";
for (var i = 0; i < document.cookie.split('; ').length; i++) {
var oneCookie = document.cookie.split('; ')[i].split('=');
if (oneCookie[0] == cookieName) {
users = oneCookie[1].split(', ');
break;
}
}
// Cursor functions
var curPointer = function(event) { event.target.style.cursor = 'pointer'; event.preventDefault(); };
var curDefault = function(event) { event.target.style.cursor = 'default'; event.preventDefault(); };
// Add or remove a user from the cookie
var addRemoveUser = function(event) {
// Parse current cookie
for(j = 0; j < document.cookie.split('; ').length; j++ ) {
var oneCookie = document.cookie.split('; ')[j].split('=');
if (oneCookie[0] == cookieName) {
users = oneCookie[1].split(', ');
break;
}
}
var user = escape(event.target.nextSibling.nextSibling.innerHTML)
isFound = true;
for (var j = 0; j < users.length; j++) {
if (users[j] == user) { users.splice(j, 1); isFound = false;}
}
if (isFound){users.push(user);}
if (users.length > 0) {
var date = new Date();
var days = 365;
date.setTime(date.getTime() + (days*24*60*60*1000));
var expires = '; expires=' + date.toGMTString();
var value = users.join(', ');
document.cookie = cookieName + '=' + value + expires + '; path=/';
} else {
document.cookie = cookieName + '=;expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/';
}
window.alert(unescape(user) + ' has been ' + (isFound ? 'added to' : 'removed from')
+ ' your hide list\n');
//event.preventDefault();
window.location.reload();
};
// Toggle display of user's post
var togglePost = function(event) {
var displayState = event.target.getAttribute('displaystate');
if (displayState == 'none'){ displayState = '';}else{displayState = 'none';}
event.target.setAttribute('displaystate', displayState);
containingRow = event.target.parentNode.parentNode;
var innerTags = containingRow.getElementsByTagName('*');
for (var i = 0; i < innerTags.length; i++) {
var tagClass = innerTags[i].getAttribute('class');
if (tagClass == 'postbody' || tagClass == 'postsig' || tagClass == 'postdetails' || innerTags[i].tagName == 'TABLE')
innerTags[i].style.display = displayState;
}
event.preventDefault();
};
// Toggle display of user's quote
var toggleQuote = function(event) {
var displayState = event.target.getAttribute('displaystate');
if (displayState == 'none'){ displayState = 'table-row';} else{ displayState = 'none';}
event.target.setAttribute('displaystate', displayState);
// Jump to parent row
var containingRow = event.target.parentNode.parentNode.parentNode.parentNode.nextSibling;
// Find containing row
while (containingRow.nodeType != 1)
containingRow = containingRow.nextSibling;
containingRow.style.display = displayState;
event.preventDefault();
};
// Find all the usernames in the postings and listing pages
var results = document.evaluate("//span[@class='name']/a", document, null, XPathResult.ANY_TYPE, null);
var resultNodes = [];
var aResult;
while (aResult = results.iterateNext())
resultNodes.push(aResult);
// Loop through every user post on the page
for (var i in resultNodes) {
var containingRow = resultNodes[i].parentNode.parentNode.parentNode;
// Format whitespace
if (resultNodes[i].nextSibling){
// its a post page
var ispostpage=true;
var user= escape(resultNodes[i].nextSibling.innerHTML);
}else{var user = escape(resultNodes[i].innerHTML);var ispostpage=false;}
// Flag whether the user is in our hide list
var isFound = true;
for (var j = 0; j < users.length; j++) {
if (users[j] == user) {
isFound = false;
}
}
// Add relevant event handlers to user's name and a toggler node
if (ispostpage){
var toggler = document.createElement('span');
toggler.setAttribute('title', "click to add or remove "+ unescape(user) +"");
toggler.appendChild(document.createTextNode('[X] '));
toggler.style.fontSize = "7pt";
toggler.style.color="#B3AAA3";
toggler.addEventListener('mouseover', curPointer, true);
toggler.addEventListener('mouseout', curDefault, true);
toggler.addEventListener('click', addRemoveUser, true);
resultNodes[i].parentNode.insertBefore(toggler, resultNodes[i]);
}
// If this user isn't in our hide list, skip to the next user
if (isFound) continue;
// Find the first element node (td) in the containing row
var elem = containingRow.firstChild;
while (elem.nodeType != 1){ elem = elem.nextSibling;}
if ( resultNodes[i].nextSibling){resultNodes[i].nextSibling.style.display = 'none';}else{
// hide an entire row of troll in listings
resultNodes[i].parentNode.parentNode.parentNode.style.display = 'none';
}
// this hides contents
var innerTags = containingRow.getElementsByTagName('*');
for (var i = 0; i < innerTags.length; i++) {
var tagClass = innerTags[i].getAttribute('class');
if (tagClass == 'postbody' || tagClass == 'postsig' || tagClass == 'postdetails' || innerTags[i].tagName == 'TABLE')
innerTags[i].style.display = 'none';
}
}
})();
right, can I go back to making music now ?
thanks.