What's new

Want to view the Images on the Forum? This thread shows how!

Ivernia

Establishing Nation
Joined
Jun 15, 2012
Messages
1,643
Location
Meath, Ireland
Capital
Royal City Caladbolg
Nick
Pádraig
Noticed that people post with links to images? Want to see the image in the post? This is what you have to do!

First you need to download an extension app called ''tampermonkey'' (Chrome) or ''Greasemonkey'' (Firefox)

You can google it on the interwebs, should be the first or second thing to come up. :3


Once you've got that installed,

1. Click the tampermonkey/greasemonkey icon that's in the top right of your chrome/firefox browser.

2. select ''add a new script''

3. it'll load up the script page

4. if there's any text just backspace it all

5. paste this in it's place:

PHP:
// ==UserScript==// @name           NSEurope Image Enabler
// @namespace      http://userscripts.org/users/161086
// @description    Displays links to images as actual images on the forums, bypassing the restrictions on images in posts. Shamelessly ripped from the Argomir Bethesa Forums Script.
// @include        http://www.ns-europe.eu/*
// @include        http://www.ns-europe.eu/forum/*
// @include        http://www.ns-europe.eu/wikim/*
// @include        http://ns-europe.eu/wikim/*
// @include        http://ns-europe.eu/*
// @include        http://ns-europe.eu/forum/*
// @include        http://ns-europe.eu/showthread.php?*
// @include        http://www.europe-game.eu/*
// @include        http://www.europe-game.eu/forum/*
// @include        http://www.europe-game.eu/wikim/*
// @include        http://www.europe-game.eu/showthread.php?*
// @include        http://europe-game.eu/*
// @include        http://europe-game.eu/forum/*
// @include        http://europe-game.eu/wikim/*
// @include        http://europe-game.eu/showthread.php?*

// ==/UserScript==

function getIMGWidth(imgSrc){
    var newImg = new Image();
    newImg.src = imgSrc;
    var width = newImg.width;
    return width;
}

function importImages(){
    var maxWidth = 768;        // RResizes images wider than the specified value. Change to something more to your likings if you find the images too small/large.
    
    var idCount = 0;    // Currently not used, but will be implemented later
    var links = document.getElementsByTagName("a");
    if(links != null){
        for(i=0;i<links.length;i++){
            var link = links[i];
            var temp = link.href;
            var text = link.innerHTML;
            temp = temp.toLowerCase();
            temp = temp.slice(-4);
            if(temp == '.jpg' || temp == '.png' || temp == '.gif'|| temp == '.bmp' || temp == '.svg'){
                if(getIMGWidth(link) > maxWidth){
                    link.innerHTML = '<img src="' + link.href + '" width="' + maxWidth + '" id="img' + idCount + '" title="' + text + '">';
                    idCount = idCount + 1;
                }
                else{
                    link.innerHTML = '<img src="' + link.href + '" id="img' + idCount + '" title="' + text + '">';
                    idCount = idCount + 1;
                }                    
            }
        }
    }
}

function insertCredits(){
    footer = document.getElementById("copyright");
    footer.innerHTML = footer.innerHTML + "<br>BGS Forum Image Enabler script for Greasemonky by <a href=http://forums.bethsoft.com/index.php?/user/541071-argomirr/'>Argomirr</a><br>Thanks for using!";
}

importImages(); insertCredits();


That's it! Save that ''script''. and keep the app active and turned on. Should work fine.

If you have any problems, send a PM to me, Ivernia, for clarification on anything.
 
Last edited:

Furlanìe

Establishing Nation
Joined
May 8, 2015
Messages
1,212
Location
Friuli - Italy
Capital
Grau
Nick
Alos
I followed your instructions and it worked even though I use Opera; at least I checked in your news page and I see them.
what I do not know is how to make them visible myself. if I use the command ''link'' in the ''Go advanced'' options it doesn't work, you always have to click on the link to see the image. like this
what am I doing wrong? :rolleyes2:

If I'm not supposed to write here I'll delete the message, I tryed to write you a private message but it says ''Ivernia has exceeded their stored private messages quota''
 
Last edited by a moderator:

Ivernia

Establishing Nation
Joined
Jun 15, 2012
Messages
1,643
Location
Meath, Ireland
Capital
Royal City Caladbolg
Nick
Pádraig
Well I wouldn't know for sure but I think if you put a link onto text the image won't pop out, I think you have to just slap the link right out on the page like ''www.imagehere.org.ca.ie.etc''

Try that and let me know if it works? Also sorry about the full inbox, I need to save them all externally and then clear them out.
 

Furlanìe

Establishing Nation
Joined
May 8, 2015
Messages
1,212
Location
Friuli - Italy
Capital
Grau
Nick
Alos
justo copy and paste it? nope, it doesn't work. maybe the problem is that I use Opera? or just the fact that I'm an extremely unlucky human being?
 

Saaremaa

Establishing Nation
Joined
Feb 16, 2013
Messages
784
If you use photobucket, copy and paste not the direct link, but the IMG link. That way it would work.
 
Joined
Apr 14, 2016
Messages
8
Location
USA
Capital
Nontenay-kotan
Nick
Aynu
I get an unrecoverable error on line #9 "return width;" not sure why. Can't you just view the images normally like most other forums?
 
Top