// ==UserScript==
// @name phpresource
// @namespace http://php-resource.de/forum/*
// @description für vBulletin auf php-resource.de
// @include http://php-resource.de/forum/*
// @exclude http://php-resource.de/forum/search.php?s=&action=getnew
// ==/UserScript==
// header und footer entfernen
var allParagraphs = document.getElementsByTagName('p');
allParagraphs[allParagraphs.length-1].parentNode.removeChild(allParagraphs[allParagraphs.length-1]);
allParagraphs[allParagraphs.length-1].parentNode.removeChild(allParagraphs[allParagraphs.length-1]);
var allTables = document.getElementsByTagName('table');
allTables[0].parentNode.removeChild(allTables[0]);
allTables[2].parentNode.removeChild(allTables[2]);
allTables[allTables.length-1].parentNode.removeChild(allTables[allTables.length-1]);
if (window.location.pathname != '/forum/newreply.php') {
allTables[allTables.length-1].parentNode.removeChild(allTables[allTables.length-1]);
}
// textarea breiter
if (window.location.pathname == '/forum/newreply.php' || window.location.pathname == '/forum/editpost.php' || window.location.pathname == '/forum/newthread.php') {
var textarea = document.getElementsByTagName('textarea')[0];
textarea.cols = 95;
textarea.style.fontFamily = 'monospace';
}
// links
var allLinks = document.getElementsByTagName('a');
allLinks[0].parentNode.removeChild(allLinks[0]);
// text
var f = document.getElementsByTagName('font');
if (window.location.pathname == '/forum/index.php') {
f[0].innerHTML = 'Neues';
f[1].parentNode.removeChild(f[1]);
} else {
allLinks[0].innerHTML = 'Forum';
f[0].innerHTML = 'Neues | ' + f[0].innerHTML;
}
// CSS
var css = document.styleSheets[0];
css.insertRule("a { text-decoration: underline !important; }", css.cssRules.length);
// images
var allImages = document.getElementsByTagName('img');
for (i = 0; i < allImages.length; ) {
if (allImages[i].src.indexOf('images/off.gif') != -1) {
allImages[i].parentNode.replaceChild(document.createTextNode('off | '), allImages[i]);
} else if (allImages[i].src.indexOf('images/on.gif') != -1) {
allImages[i].parentNode.replaceChild(document.createTextNode('ON |'), allImages[i]);
} else if (allImages[i].src.indexOf('images/profile.gif') != -1) {
allImages[i].parentNode.replaceChild(document.createTextNode('Profile | '), allImages[i]);
} else if (allImages[i].src.indexOf('images/sendpm.gif') != -1) {
allImages[i].parentNode.replaceChild(document.createTextNode('PM | '), allImages[i]);
} else if (allImages[i].src.indexOf('images/email.gif') != -1) {
allImages[i].parentNode.replaceChild(document.createTextNode('Email | '), allImages[i]);
} else if (allImages[i].src.indexOf('images/home.gif') != -1) {
allImages[i].parentNode.replaceChild(document.createTextNode('WWW | '), allImages[i]);
} else if (allImages[i].src.indexOf('images/find.gif') != -1) {
allImages[i].parentNode.replaceChild(document.createTextNode('Find | '), allImages[i]);
} else if (allImages[i].src.indexOf('images/buddy.gif') != -1) {
allImages[i].parentNode.replaceChild(document.createTextNode('Buddy'), allImages[i]);
} else if (allImages[i].src.indexOf('images/newthread.gif') != -1) {
allImages[i].parentNode.replaceChild(document.createTextNode('new_thread'), allImages[i]);
// } else if (allImages[i].src.indexOf('images/reply.gif') != -1) {
// allImages[i].parentNode.replaceChild(document.createTextNode('reply'), allImages[i]);
} else if (allImages[i].src.indexOf('images/edit.gif') != -1) {
allImages[i].parentNode.replaceChild(document.createTextNode('edit'), allImages[i]);
// } else if (allImages[i].src.indexOf('images/quote.gif') != -1) {
// allImages[i].parentNode.replaceChild(document.createTextNode(' | QUOTE'), allImages[i]);
// } else if (allImages[i].src.indexOf('images/firstnew.gif') != -1) {
// allImages[i].parentNode.replaceChild(document.createTextNode('NEW!'), allImages[i]);
} else if (allImages[i].src.indexOf('images/posticon') != -1
|| allImages[i].src.indexOf('images/printer.gif') != -1
|| allImages[i].src.indexOf('images/sendtofriend.gif') != -1
|| allImages[i].src.indexOf('images/subscribe.gif') != -1) {
allImages[i].parentNode.removeChild(allImages[i]);
} else {
i++;
}
}