sis.link.sortByPostTime

sort threads by post time

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name        sis.link.sortByPostTime
// @namespace   zhang
// @description sort threads by post time
// @include     http://www.sexinsex.net/*
// @include     http://www.sis001.com/*
// @version     1
// @grant       GM_log
// ==/UserScript==

var links = document.getElementsByTagName('A')
for (var i = 0; i < links.length; i++) {
	var link = links[i];
	var href = link.href;
	if (href.indexOf('/forumdisplay.php?') >= 0) {
		if (href.indexOf('&orderby=') < 0) {
			href += '&orderby=dateline';
		}
		if (href.indexOf('&ascdesc=') < 0) {
			href += '&ascdesc=DESC';
		}
		if (link.href!=href) {
			link.href = href;
		}
	} else if (href.indexOf('/forum-') >= 0) {
		href = href.replace(/\/forum-(\d+)-(\d+)\.html/, "/forumdisplay.php?fid=$1&filter=0&orderby=dateline&ascdesc=DESC&page=$2")
		link.href = href;
	}
}