Page 1 of 1

ISO Userscript: Information and Installation Guide

PostPosted: Thu Sep 13, 2018 3:20 pm
by Schultz128
Sup nerds, you ever get tired of having to keep going back to the OP of a game to get onto someone's ISO?

What about those times you want an ISO for a person's posts in a thread outside of FM?

There's an easy work around for these issues, and this work around has been around for a while but most newer people don't know about it.


This workaround is known as an ISO Userscript.


What it do?

The ISO Userscript will make it so that there will be a link to a person's ISO in every post they make in any thread, and it looks like this:

Spoiler: Image



How it do?

The first step to get this userscript is to install an add-on into your browser known as Tampermonkey.

This add-on is available on:

  • Chrome
  • Firefox
  • Microsoft Edge
  • Safari
  • Opera Next

To install this add-on, simply go to https://tampermonkey.net/ and go to the tab with the browser you want to install this on. The tab will have a download link and additionally a video tutorial as to how to install it.

Once installed, there should be an icon for the program at the top right of your browser screen. Click on the icon and click on "Create a new script..."

Spoiler: Image


Now, you should be at a screen that looks like this:

Spoiler: Image


If you're here, perfect! What you'll need to do is delete all of the text currently on screen. Next, you'll need to copy the following text (credits to Varanus for this version of the coding) and paste it into the empty space:

Code: Select all
// ==UserScript==
// @name        FM Post Numberer
// @namespace   http://blankmediagames.com
// @author      deferentsheep
// @description Numbers posts and adds ISO
// @include     http://blankmediagames.com/phpbb/*
// @include     http://www.blankmediagames.com/phpbb/*
// @include     https://blankmediagames.com/phpbb/*
// @include     https://www.blankmediagames.com/phpbb/*
// @grantnone
// @version     1.0.8
// ==/UserScript==
// --------------------
// Configurable parameters, you may change values here
// If true, runs the script in every subforum, otherwise only in those specified by desiredForums.
var allForums = true;

// List of forums to run the script on if allForums is false. Works with subforums as well (e.g. "Forum Mafia" will enable the script in "Signups", "Game Threads", etc.).
var desiredForums = ["Game Threads", "FM Discussion"];

// --------------------

function actualThing() {

    var willRun = false;
    $(".icon-home > a").each(function(index, value) {
        var label = $(this).html();
        var i;
        for (i = 0; !willRun && i < desiredForums.length; i++) {
            if (label == desiredForums[i]) {
                willRun = true;
            }
        }
    });

    if (!allForums && !willRun) {
        return;
    }

    var threadURL = $("h2").first().children("a").first().attr("href");
    var threadNumber = "";
    var i = threadURL.search("&t=") + 3;
    while (!isNaN(threadURL[i])) {
        threadNumber += threadURL[i++];
    }

    var pageNumber = $(".pagination").find("strong").first().html();

    $(".post").each(function(index, value) {
        if ($(this).children(".inner").first().children(".postprofile").length === 0) {
            return;
        }

        var postID = $(this).attr("id").substring(1);
        var postNumber = (pageNumber - 1) * 25 + index;
        var authorLine = $(this).find(".author");
        var authorName = authorLine.find("strong").first().children("a").html();
        var authorString = authorLine.html();

        var insertIndex = authorString.search("</a>by") + 4;
        authorString = "Post <a href=\"./viewtopic.php?p=" + postID + "#p" + postID + "\"><strong>#" + postNumber + "</strong></a> " + authorString.substring(insertIndex, authorString.length);
        insertIndex = authorString.search("ยป ");
        authorString = authorString.substring(0, insertIndex) + " (<a href=\"./search.php?t=" + threadNumber + "&author=" + authorName + "\">ISO</a>)" + authorString.substring(insertIndex, authorString.length);
        authorLine.html(authorString);
    });
}

function loadScript(src, callback) {
    var s, r, t;
    r = false;
    s = document.createElement("script");
    s.type = "text/javascript";
    s.src = src;
    s.onload = s.onreadystatechange = function() {
        if (!r && (!this.readyState || this.readyState == "complete")) {
            r = true;
            callback();
        }
    };
    t = document.getElementsByTagName("script")[0];
    t.parentNode.insertBefore(s, t);
}

loadScript("//ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js", actualThing);



Make sure you copied all of the text, there's a lot of it!

Once done, go to 'File' and click 'Save'.

If all goes well, you should have the ISO Userscript working once you're on the forums!

If you have any troubleshooting issues, let me know!


And just to clarify, this isn't my work, but I'm simply bringing up old news for the newer members!

Re: ISO Userscript: Information and Installation Guide

PostPosted: Thu Sep 13, 2018 7:37 pm
by Kirize12
Would this work on mobile?

Re: ISO Userscript: Information and Installation Guide

PostPosted: Thu Sep 13, 2018 8:00 pm
by Schultz128
Kirize12 wrote:Would this work on mobile?


Unsure.

Re: ISO Userscript: Information and Installation Guide

PostPosted: Thu Sep 13, 2018 10:22 pm
by BasicFourLife
nice

Re: ISO Userscript: Information and Installation Guide

PostPosted: Fri Sep 14, 2018 1:22 pm
by TheWabbit
Dash2 wrote:I just tested it. Tampermonkey does indeed work on mobile if you have firefox

time to go firefox then

-----

is this somehow different from the old userscript?

Re: ISO Userscript: Information and Installation Guide

PostPosted: Fri Sep 14, 2018 1:39 pm
by Schultz128
TheWabbit wrote:
Dash2 wrote:I just tested it. Tampermonkey does indeed work on mobile if you have firefox

time to go firefox then

-----

is this somehow different from the old userscript?


The code that I used in the OP was made by Varanus to have the first post in a thread (OP) be known as Post #0 rather than Post #1.

Re: ISO Userscript: Information and Installation Guide

PostPosted: Fri Sep 14, 2018 1:42 pm
by Chemist1422
nice

does it work with Safari?

Re: ISO Userscript: Information and Installation Guide

PostPosted: Fri Sep 14, 2018 3:51 pm
by ejjinami
it works
nice, thx