|
|
Well, my idea should be firly obvious, and(I hope) simple to write, I'd like a script which adds a button to vBulletin 3-based fora. These fora already have a "Go to first new post" button in front of every topic with new posts since you last opened it, but for simplicity, I'd like tojust click one button to activate all the "Go to first new post" buttons, and open them in tabs. |
|
|
IBDoF openInTabs This was written for a phpbbV2 site, hopefully I've embedded enough comments to help in getting started.
|
|
|
I must admit that I have no idea how to write a script, and I'd like for this to work. Therefore, I think I'll accept your offer and ask you to cutumize the script for this site: http://forums.e-mpire.com Please use the PlayStation Insider skin. |
|
|
Reading your request again I think this might be closer to what you wanted? // ==UserScript==
// @name vB New Topics
// @namespace http://userscripts.org/forums/2/topics/1801
// @description Open all forum new topics in tabs
// @include http://forums.e-mpire.com/forumdisplay.php*
// ==/UserScript==
var newposts = new Array();
var lnks = document.getElementById('threadslist').getElementsByTagName('a');
for (var i=0; i < lnks.length; i++) {
if (/showthread.php\?goto=newpost/.test(lnks[i].href)) {
newposts.push(lnks[i].href);
}
}
// DON'T DISPLAY IF NO NEW POSTS IN FORUM
if (!newposts.length) return;
var btn = document.getElementById('inlinemodform').getElementsByTagName('td')[0].appendChild(document.createElement('button'));
btn.innerHTML = "Read ALL new posts";
btn.style.marginLeft = '10px';
btn.style.position = 'relative';
btn.style.top = '-5px';
btn.addEventListener("click",
function(e) {
for (var i=0; i < newposts.length; i++) {
GM_openInTab(newposts[i]);
e.preventDefault();
}
}
, false);
|
|
|
Thanks, it works great :D Not really that important, but it doesn't always mark all the threads it opens. Is there any way to make it activate the "mark all threads as read" button when used? |
|
|
Hmm, a page refresh does the same job for topics in that thread.
BTW: Updated script to prevent button showing on "No NEW Posts" :oops: |
|
|
@Seph_VIII:
Have a look at http://www.ardiman.de/assets/files/firefox/vbne... (button's caption is german, sorry) @gollum: Feel free to copy the code and update your script (if you want to). |
|
|
Thread-read status not being influenced by the timeout delay - on my FF(2.0.0.12), Opera(9.25), IE7 setup. Added option to turn delay off.
Thanks @Mithandir, grabbed the code and updated - also made x-browser with Opera(9.25) and IE7. |
|
|
Nice work! Thank you. Here's another suggestion. Please insert a var "oMode" in configuration:
var oMode = true; // =true: show first unread post, =false: show first post/beginning of thread and change this section:
for (var i=0; i < lnks.length; i++) {
if (/showthread.php\?goto=newpost/.test(lnks[i].href)) {
if (oMode) {
newposts.push(lnks[i].href);
} else {
newposts.push(lnks[i].href.replace(/goto=newpost&/, ""));
}
f++
if (f+1 > maxlnks && maxlnks > 0) break;
}
}
I hope this is my last idea. ;) |
|
|
Putting it in, plus working on settings form - ready soon Keep the ideas comin' :lol: |
|
|
Thanks for all the hard work, this script has turned out really well! However, it doesn't seem to appear here: http://forums.e-mpire.com/search.php?do=getnew |