|
Post by Wormopolis on Aug 15, 2010 2:36:02 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:
<script type="text/javascript"> <!-- // show board on newest topics list // v2.0 // by Wormopolis - www.wormocodes.com // keep header intact
displayStyle='cell'; //column or cell. cell style puts board name under each thread title newThreadButton=true; //put a new thread button instead of board name
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=(newThreadButton ? '' : 'Board'); clntitle.width='1%'; clntitle.align='center'; clntitle.colSpan=1; 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=(newThreadButton ? 'New Thread' : fjtitle); nwcl=document.createElement('td'); nwcl.className='windowbg'; nwcl.align='center'; nwcl.width='1%'; blnk=document.createElement('a'); blnk.href="/index.cgi?board="+thrb+(newThreadButton ? '&action=post' :''); 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((newThreadButton ? 'New Thread ' : '')+'in board: '+fjtitle)); tds[t].appendChild(document.createElement('br')); blnk=document.createElement('a'); blnk.href="/index.cgi?board="+thrb+ '&action=post'; blnk.appendChild(nfnt); blnk.title='Create New Thread'; tds[t].appendChild((newThreadButton ? blnk : nfnt) ); } } } }
// --> </script>
Preview: using it with column setting on this site
|
|
|
Post by Wormopolis on Nov 2, 2011 16:00:48 GMT -8
version update 1.01: fixed a colspan issue I just noticed.
|
|
|
Post by Wormopolis on Nov 17, 2011 18:01:06 GMT -8
version upgrade 2.0: added in "new thread" link as an option
|
|
biancardi
Not New Member
Posts: 22
biancardi said 0 great things
|
Post by biancardi on Mar 5, 2013 13:11:53 GMT -8
Will you be doing this for V5? I've asked over at proboards, but i came over here to see if you have any tips on how to do this in V5. This has been very helpful for my board.
|
|
|
Post by Wormopolis on Mar 5, 2013 23:42:34 GMT -8
Is there a newest topics list? or do you mean the "recent threads" list?
|
|
biancardi
Not New Member
Posts: 22
biancardi said 0 great things
|
Post by biancardi on Mar 6, 2013 9:57:52 GMT -8
they call it /threads/recent
I think that new topics was an oxymoron, as they were really recent threads...the url for the old version was index.cgi?action=newestthreads.
|
|