Skip to content

Instantly share code, notes, and snippets.

@dvingerh
Last active April 26, 2017 20:35
Show Gist options
  • Save dvingerh/26055ada1d8fef6d7d6b4f3fa632665b to your computer and use it in GitHub Desktop.
Save dvingerh/26055ada1d8fef6d7d6b4f3fa632665b to your computer and use it in GitHub Desktop.
HackForums Userscript: View all posts of other users in a thread easily with this script, adding an extra button next to the TS button. (HackForums View Self Posts Other Members Button)
// ==UserScript==
// @name HF View Self Posts Other Members Button
// @namespace HackForums View Self Posts Other Members Button
// @description View all posts of other users in a thread easily with this script, adding an extra button next to the TS button.
// @include *hackforums.net/showthread.php?*
// @require http://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js
// @version 0.1
// ==/UserScript==
var tid;
var uid;
if (window.location.href.indexOf("tid") > 0)
{
tid = /tid=(\d*)/.exec(window.location.href)[1];
}
if (window.location.href.indexOf("pid") > 0)
{
tid = /pid=(\d*)/.exec(window.location.href)[1];
}
$('a.bitButton[title="Trust Scan"]').each(function() {
uid = /uid=(\d*)/.exec(this.href)[1];
$(this).after(`<a style="margin-left: 5px;" href="/showthread.php?tid=${tid}&mode=single&uid=${uid}" class="bitButton">View Posts</a>`);
});
//var tidSplit = window.location.href.split('=');
//$('a').each(function() {
// if ($(this).text() === "TS")
// {
// var uidSplit = $(this).attr('href').split('=');
// var combinedUrl = "showthread.php?tid=" + tidSplit[1] + "&mode=single&uid=" + uidSplit[1];
// $(this).after('<a style="margin-left: 5px;" href="' + combinedUrl + '" class="bitButton">View Posts</a>');
// }
//});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment