Conversaciones » Peticiones de scripts

PunBB ignore user.

§
Publicado: 24/09/2014

PunBB ignore user.

Hi.
It seems there's no functional script to ignore user on Punbb's boards.
Is it possible to make a simple script to do this ? No fancy options, just a line to fill with id's user. =)
I'm so annoyed by some users on a few boards, I'm considering learning javascript if no one can do that haha. To make a functional script in Javascript Blocker (http://javascript-blocker.toggleable.com Its an OSX safari's extension compatible with greasemonkey's scripts) or a WHOLE safari's extension...
Sorry for my bad english and thanks in advance for your time and attention.

§
Publicado: 24/09/2014
// ==UserScript==
// @name          Filter people on a punBB board
// @description   Filters people on a punBB board
// @author        Jixun
// @version       1.0
// @namespace     org.jixun.hide.punbb.user

// @include       http://board.url.here/*

// @run-at        document-start
// @license       MIT License
// ==/UserScript==

var listOfUsers = ['Admin', 'somebody'];

addEventListener ('DOMContentLoaded', function () {
    [].forEach.call (document.querySelectorAll ('.main-topic > .post'), function (post) {
        var user = post.querySelector('.post-byline > em > a, .post-byline > strong').textContent;
        if (listOfUsers.indexOf (user) != -1) {
            post.style.display = 'none';
        }
    });
}, false);

Then just fill in the @include and listOfUsers and that's done :3

§
Publicado: 24/09/2014
Editado: 24/09/2014

Thanks but it doesn't seems to work.
I tried the script in Firefox (regular Greasemonkey) and Safari (Javascript Blocker with greasemonkey features), with the user's nickname and his id (it's a number). No change.
Here's one post of the guy, it might help : http://pastebin.com/e5WZTi8t

§
Publicado: 25/09/2014
// ==UserScript==
// @name          Filter people on a punBB board
// @description   Filters people on a punBB board
// @author        Jixun
// @version       1.0
// @namespace     org.jixun.hide.punbb.user

// @include       http://board.url.here/*

// @run-at        document-start
// @license       MIT License
// ==/UserScript==

var listOfUsers = ['Someone'];

addEventListener ('DOMContentLoaded', function () {
    [].forEach.call (document.querySelectorAll ('#punviewtopic td > .blockpost'), function (post) {
        var user = post.querySelector('.postleft a').textContent;
        if (listOfUsers.indexOf (user) != -1) {
            post.style.display = 'none';
        }
    });
}, false);

Fixed version.

§
Publicado: 25/09/2014

It doesn't work with Javascript Blocker but it work with Ninjakit. Damn Safari7...
Thank you ! =)

§
Publicado: 25/09/2014
It doesn't work with Javascript Blocker but it work with Ninjakit. Damn Safari7...
Thank you ! =)

You're welcome :3

Publicar respuesta

Inicia sesión para responder.