Post by coolcoolcool on Jul 4, 2007 19:53:36 GMT -8
Description: Many coders have made their own main page board modification. I decided to make my own, which gives a more simple look and shortens the board length. To see all it does, look at the preview below, so that I don't have to explain every aspect of it. It works best in combination with a board shrinking code.
Preview: Preview (Code 1)
Compatibility: Tested in Firefox 2.0, Internet Explorer 6.0, Safari 3 Beta, Opera 9.21
Location: Top of (Main Footer, or Global Footers)
Versions: 2
1. Has [Last Post] with a link to the last post. (Code 1)
2. Has [Last Post - the name of it] (Code 2)
Code 1:
<script type="text/javascript">
<!--
if(location.href.match(/\.com(\/(index\.cgi(#\w+|\?(action=home)?)?)?)?$/i)){
for(var td = document.getElementsByTagName("td"),i = td.length-1,p = document.createElement("span"),f = document.createElement("font"); i > -1; i--){
if(td.className.match(/window/i) && td.width=="8%" && td.vAlign=="middle"){
p.appendChild(td.firstChild);
p.innerHTML = p.innerHTML + " ";
td.nextSibling.insertBefore(p, td.nextSibling.firstChild);
td.nextSibling.firstChild.nextSibling.size="1";
td.nextSibling.firstChild.nextSibling.innerHTML = "[" + td.nextSibling.firstChild.nextSibling.innerHTML + "]";
f.size="1";
if(td.nextSibling.lastChild.lastChild.innerHTML.match(/mod/i)){
f.appendChild(td.nextSibling.lastChild.lastChild.cloneNode(true));
f.innerHTML = "[" + f.innerHTML + "]";
td.nextSibling.lastChild.lastChild.previousSibling.style.display="none";
td.nextSibling.lastChild.lastChild.style.display="none";
}
f.innerHTML = ((td.nextSibling.nextSibling.nextSibling.nextSibling.innerHTML.match(/by/i)) ? "[<a href=\"" + td.nextSibling.nextSibling.nextSibling.nextSibling.firstChild.lastChild.href + "\" title=\""+ td.nextSibling.nextSibling.nextSibling.nextSibling.firstChild.innerHTML.replace(/<(BR|br).?>/gi," ").replace(/<.+?>/gi,"") + "\">Last Post</a>]" : "") + "[Topics: " + td.nextSibling.nextSibling.firstChild.innerHTML + "][Posts: " + td.nextSibling.nextSibling.nextSibling.firstChild.innerHTML + "]" + f.innerHTML;
td.nextSibling.firstChild.nextSibling.appendChild(f);
td.nextSibling.nextSibling.nextSibling.nextSibling.style.display="none";
td.nextSibling.nextSibling.nextSibling.style.display="none";
td.nextSibling.nextSibling.style.display="none";
td.style.display="none";
p = document.createElement("span");
f = document.createElement("font");
} else if(td.colSpan == "5"){
td.colSpan = "1";
} else if(td.className.match(/titlebg/i) && td.innerHTML.match(/(top|post)/i)){
td.style.display="none";
} else if(td.colSpan == "2" && !td.innerHTML.match(/(in|st|bi)/i)){
td.parentNode.style.display = "none";
break;
}
}
}
//-->
</script>
Code 2:
<script type="text/javascript">
<!--
if(location.href.match(/\.com(\/(index\.cgi(#\w+|\?(action=home)?)?)?)?$/i)){
for(var td = document.getElementsByTagName("td"),i = td.length-1,p = document.createElement("span"),f = document.createElement("font"); i > -1; i--){
if(td.className.match(/window/i) && td.width=="8%" && td.vAlign=="middle"){
p.appendChild(td.firstChild);
p.innerHTML = p.innerHTML + " ";
td.nextSibling.insertBefore(p, td.nextSibling.firstChild);
td.nextSibling.firstChild.nextSibling.size="1";
td.nextSibling.firstChild.nextSibling.innerHTML = "[" + td.nextSibling.firstChild.nextSibling.innerHTML + "]";
f.size="1";
if(td.nextSibling.lastChild.lastChild.innerHTML.match(/mod/i)){
f.appendChild(td.nextSibling.lastChild.lastChild.cloneNode(true));
f.innerHTML = "[" + f.innerHTML + "]";
td.nextSibling.lastChild.lastChild.previousSibling.style.display="none";
td.nextSibling.lastChild.lastChild.style.display="none";
}
f.innerHTML = ((td.nextSibling.nextSibling.nextSibling.nextSibling.innerHTML.match(/by/i)) ? "[<a href=\"" + td.nextSibling.nextSibling.nextSibling.nextSibling.firstChild.lastChild.href + "\" title=\""+ td.nextSibling.nextSibling.nextSibling.nextSibling.firstChild.innerHTML.replace(/<(BR|br).?>/gi," ").replace(/<.+?>/gi,"") + "\">Last Post</a> - " + td.nextSibling.nextSibling.nextSibling.nextSibling.firstChild.lastChild.innerHTML + "]" : "") + "[Topics: " + td.nextSibling.nextSibling.firstChild.innerHTML + "][Posts: " + td.nextSibling.nextSibling.nextSibling.firstChild.innerHTML + "]" + f.innerHTML;
td.nextSibling.firstChild.nextSibling.appendChild(f);
td.nextSibling.nextSibling.nextSibling.nextSibling.style.display="none";
td.nextSibling.nextSibling.nextSibling.style.display="none";
td.nextSibling.nextSibling.style.display="none";
td.style.display="none";
p = document.createElement("span");
f = document.createElement("font");
} else if(td.colSpan == "5"){
td.colSpan = "1";
} else if(td.className.match(/titlebg/i) && td.innerHTML.match(/(top|post)/i)){
td.style.display="none";
} else if(td.colSpan == "2" && !td.innerHTML.match(/(in|st|bi)/i)){
td.parentNode.style.display = "none";
break;
}
}
}
//-->
</script>
Preview: Preview (Code 1)
Compatibility: Tested in Firefox 2.0, Internet Explorer 6.0, Safari 3 Beta, Opera 9.21
Location: Top of (Main Footer, or Global Footers)
Versions: 2
1. Has [Last Post] with a link to the last post. (Code 1)
2. Has [Last Post - the name of it] (Code 2)
Code 1:
<script type="text/javascript">
<!--
if(location.href.match(/\.com(\/(index\.cgi(#\w+|\?(action=home)?)?)?)?$/i)){
for(var td = document.getElementsByTagName("td"),i = td.length-1,p = document.createElement("span"),f = document.createElement("font"); i > -1; i--){
if(td.className.match(/window/i) && td.width=="8%" && td.vAlign=="middle"){
p.appendChild(td.firstChild);
p.innerHTML = p.innerHTML + " ";
td.nextSibling.insertBefore(p, td.nextSibling.firstChild);
td.nextSibling.firstChild.nextSibling.size="1";
td.nextSibling.firstChild.nextSibling.innerHTML = "[" + td.nextSibling.firstChild.nextSibling.innerHTML + "]";
f.size="1";
if(td.nextSibling.lastChild.lastChild.innerHTML.match(/mod/i)){
f.appendChild(td.nextSibling.lastChild.lastChild.cloneNode(true));
f.innerHTML = "[" + f.innerHTML + "]";
td.nextSibling.lastChild.lastChild.previousSibling.style.display="none";
td.nextSibling.lastChild.lastChild.style.display="none";
}
f.innerHTML = ((td.nextSibling.nextSibling.nextSibling.nextSibling.innerHTML.match(/by/i)) ? "[<a href=\"" + td.nextSibling.nextSibling.nextSibling.nextSibling.firstChild.lastChild.href + "\" title=\""+ td.nextSibling.nextSibling.nextSibling.nextSibling.firstChild.innerHTML.replace(/<(BR|br).?>/gi," ").replace(/<.+?>/gi,"") + "\">Last Post</a>]" : "") + "[Topics: " + td.nextSibling.nextSibling.firstChild.innerHTML + "][Posts: " + td.nextSibling.nextSibling.nextSibling.firstChild.innerHTML + "]" + f.innerHTML;
td.nextSibling.firstChild.nextSibling.appendChild(f);
td.nextSibling.nextSibling.nextSibling.nextSibling.style.display="none";
td.nextSibling.nextSibling.nextSibling.style.display="none";
td.nextSibling.nextSibling.style.display="none";
td.style.display="none";
p = document.createElement("span");
f = document.createElement("font");
} else if(td.colSpan == "5"){
td.colSpan = "1";
} else if(td.className.match(/titlebg/i) && td.innerHTML.match(/(top|post)/i)){
td.style.display="none";
} else if(td.colSpan == "2" && !td.innerHTML.match(/(in|st|bi)/i)){
td.parentNode.style.display = "none";
break;
}
}
}
//-->
</script>
Code 2:
<script type="text/javascript">
<!--
if(location.href.match(/\.com(\/(index\.cgi(#\w+|\?(action=home)?)?)?)?$/i)){
for(var td = document.getElementsByTagName("td"),i = td.length-1,p = document.createElement("span"),f = document.createElement("font"); i > -1; i--){
if(td.className.match(/window/i) && td.width=="8%" && td.vAlign=="middle"){
p.appendChild(td.firstChild);
p.innerHTML = p.innerHTML + " ";
td.nextSibling.insertBefore(p, td.nextSibling.firstChild);
td.nextSibling.firstChild.nextSibling.size="1";
td.nextSibling.firstChild.nextSibling.innerHTML = "[" + td.nextSibling.firstChild.nextSibling.innerHTML + "]";
f.size="1";
if(td.nextSibling.lastChild.lastChild.innerHTML.match(/mod/i)){
f.appendChild(td.nextSibling.lastChild.lastChild.cloneNode(true));
f.innerHTML = "[" + f.innerHTML + "]";
td.nextSibling.lastChild.lastChild.previousSibling.style.display="none";
td.nextSibling.lastChild.lastChild.style.display="none";
}
f.innerHTML = ((td.nextSibling.nextSibling.nextSibling.nextSibling.innerHTML.match(/by/i)) ? "[<a href=\"" + td.nextSibling.nextSibling.nextSibling.nextSibling.firstChild.lastChild.href + "\" title=\""+ td.nextSibling.nextSibling.nextSibling.nextSibling.firstChild.innerHTML.replace(/<(BR|br).?>/gi," ").replace(/<.+?>/gi,"") + "\">Last Post</a> - " + td.nextSibling.nextSibling.nextSibling.nextSibling.firstChild.lastChild.innerHTML + "]" : "") + "[Topics: " + td.nextSibling.nextSibling.firstChild.innerHTML + "][Posts: " + td.nextSibling.nextSibling.nextSibling.firstChild.innerHTML + "]" + f.innerHTML;
td.nextSibling.firstChild.nextSibling.appendChild(f);
td.nextSibling.nextSibling.nextSibling.nextSibling.style.display="none";
td.nextSibling.nextSibling.nextSibling.style.display="none";
td.nextSibling.nextSibling.style.display="none";
td.style.display="none";
p = document.createElement("span");
f = document.createElement("font");
} else if(td.colSpan == "5"){
td.colSpan = "1";
} else if(td.className.match(/titlebg/i) && td.innerHTML.match(/(top|post)/i)){
td.style.display="none";
} else if(td.colSpan == "2" && !td.innerHTML.match(/(in|st|bi)/i)){
td.parentNode.style.display = "none";
break;
}
}
}
//-->
</script>