Post by Wormopolis on Aug 15, 2010 2:37:29 GMT -8
Browser Tested: IE and FF
placement: Global Footer
This will add board titles to either a new column or below the thread titles on the New Topics Table. variable at top allows the choice.
code:
Preview: using it on wormocodes.com
placement: Global Footer
This will add board titles to either a new column or below the thread titles on the New Topics Table. variable at top allows the choice.
code:
<script type="text/javascript">
<!--
// show board on newest topics list
// by Wormopolis - www.wormocodes.com
// keep header intact
displayStyle='column'; //column or cell. cell style puts board name under each thread title
if (location.href.match(/newestthreads/)) {
fj=document.getElementById('forumjump');
for (tds=document.getElementsByTagName('td'), t=0; t<tds.length; t++) {
if (tds[t].width.match(/4(3|8)%/) && tds[t].className.match(/catbg/) && displayStyle=='column') {
clntitle=tds[t].cloneNode(true);
clntitle.firstChild.firstChild.firstChild.innerHTML='Board';
clntitle.width='1%'; clntitle.align='center';
tds[t].width=(parseInt(tds[t].width)-1)+"%";
tds[t].parentNode.insertBefore(clntitle,tds[t--].nextSibling);
if (document.ammForm) {
vtabl=document.ammForm.parentNode.parentNode;
vtabl.rows[0].cells[0].colSpan++;
vtabl.rows[vtabl.rows.length-1].cells[0].colSpan++;
} else {
vtabl=tds[t].parentNode.previousSibling.firstChild.colSpan++;
}
}
if (tds[t].width.match(/4(3|8)%/) && tds[t].className.match(/windowbg/) && tds[t].getElementsByTagName('font')[0]) {
thr=tds[t].getElementsByTagName('font')[0].getElementsByTagName('a')[0];
thrb=(thr.href.match(/board=(.*?)($|&)/) ? RegExp.$1 : '');
for (fjopts=fj.options, o=0; o<fjopts.length; o++) {
if (fjopts[o].value.match(new RegExp('board='+thrb+'$',''))) {
fjtitle=fjopts[o].innerHTML.replace(/\-+/,'');
break;
}
}
if (displayStyle=='column') {
nfnt=document.createElement('font'); nfnt.size=2;
nfnt.innerHTML=fjtitle;
nwcl=document.createElement('td'); nwcl.className='windowbg'; nwcl.align='center'; nwcl.width='1%';
blnk=document.createElement('a');
blnk.href="/index.cgi?board="+thrb;
blnk.appendChild(nfnt); nwcl.appendChild(blnk);
tds[t].width=(parseInt(tds[t].width)-1)+"%";
tds[t].parentNode.insertBefore(nwcl,tds[t--].nextSibling);
} else if (displayStyle=='cell') {
nfnt=document.createElement('font'); nfnt.size=1;
nfnt.appendChild(document.createTextNode('in board: '+fjtitle));
tds[t].appendChild(document.createElement('br'));
tds[t].appendChild(nfnt);
}
}
}
}
// -->
</script>
Preview: using it on wormocodes.com