Author Topic: Hiding all posts from another user  (Read 3602 times)

Offline Tony

  • Administrator
  • Oil baron
  • *******
  • Posts: 5104
  • Fo' shizzle, biodizzle
    • Southampton Waste Oil Collection
  • Location: Southampton
Hiding all posts from another user
« on: June 11, 2014, 09:40:55 PM »
Thanks to Julianf.

This modifies your web browser to no longer show posts by a particular forum user.  It uses software installed on your browser (called either greasemonkey or tampermonkey).  Any posts you make will still be visible for all to see, you'd just filter at your end what you see.  That's your choice, if that's what you want to do.

  • click https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo?hl=en
  • click install
  • when installed, click the thing at the top left, that looks a bit like a video tape
  • click add new user script
  • copy and paste this
    Quote
    // ==UserScript==
    // @name           smf (simple machines forum) - ignore list
    // @namespace      http://www.biopowered.co.uk/forum/index.php
    // @include        http://www.biopowered.co.uk/*
    // @version        0.1
    // @author         reeloo
    // ==/UserScript==

    var smf_url = 'http://www.biopowered.co.uk/forum/index.php';
    var banned = new Array();
    banned.push(999999999999);
    for (var i = 0; i < banned.length; i++) {
        var uid = banned;
        var expression = "id('forumposts')/form[1]/" +
                    "div[starts-with(@class, 'windowbg') " +
                    "and descendant::a[contains(@href, 'u=" + uid + "')]]";
        var nodes = document.evaluate(expression, document, null,
                XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
        for (var j = 0; j < nodes.snapshotLength; j++) {
            var node = nodes.snapshotItem(j);
            node.style.display = 'none';
        }
    }
  • click save

You must change 999999999999 in red above to the user number you wish to hide.  To find that, click their profile link, the user name is given in the URL at the end, such as u=1 (in my case).
« Last Edit: June 11, 2014, 09:52:13 PM by Tony »