Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
Pollyzoid
Nov 2, 2010

GRUUAGH you say?

Ceros_X posted:

This works for me on this thread, but when I try it on some other forum threads I get an error "Specified thread was not found in the live forums. " and clicking the embedded link goes to http://forums.somethingawful.com/showthread.php?threadid=http://forums.somethingawful.com/showthread.php?threadid=&userid=101247 (userID changed to my user ID).

I think perhaps I installed it wrong but it seems to work on this page sooo... Neat script, it really would come in handy quite often.

It didn't work because the script expects there to be a & in the URL after the threadid part. If it doesn't (when you're on the first page of a thread, for example) it results in the malformed URL you got.

So here's a corrected version. Also removed jQuery usage because Firefox didn't like that.
JavaScript code:
// ==UserScript==
// @name        sa_allposts
// @namespace   com.sa
// @include     *forums.somethingawful.com/showthread.php*
// @version     1.1
// @grant       none
// ==/UserScript==

var userid = 169765;

var tid = window.location.toString().match(/threadid=(\d+)/)[1];

var link = '<a href="showthread.php?threadid=' + tid + '&userid=' + userid +'">Check Out All My lovely Posts</a>';

var topButtons = document.querySelector('div.top ul.postbuttons li:nth-child(2)');
topButtons.insertAdjacentHTML('beforebegin', link);

var bottomButtons = document.querySelector('div.bottom ul.postbuttons li:nth-child(1)');
bottomButtons.insertAdjacentHTML('beforebegin', link);

Pollyzoid fucked around with this message at 13:03 on Nov 25, 2014

Adbot
ADBOT LOVES YOU

  • Locked thread