|
Post by tunescool on Aug 3, 2010 7:11:47 GMT -8
aaron is modding a code to put my sub boards underneath the board cell since theres so many and i thought itd be easier to access. but i wanna use this one for boards that only have one or two sub boards. can you put an array to enter boards that i want to use it on in
<script type="text/javascript"> <!-- var fjumpList=document.getElementById('forumjump').options;
for (tds=document.getElementsByTagName('td'), i=0; i<tds.length; i++) { if (tds[i].width=="50%" && tds[i].className.match(/windowbg/) && tds[i].align=="left" && tds[i].firstChild.innerHTML.match(/sub-board/)) { tds[i].firstChild.rows[0].cells[0].innerHTML=tds[i].firstChild.rows[0].cells[0].innerHTML.replace(/\(\d+\ssub-board(s?)\)/,''); bname=tds[i].getElementsByTagName('a')[0].href.split('board=')[1]; btitle=tds[i].getElementsByTagName('b')[0].innerHTML; var dest=document.createElement('div'); dest.style.paddingTop="1"; var holdstuff; dest.innerHTML=holdstuff=""; rgxp=new RegExp("\\\/index.cgi\\\?board="+bname,"i"); for (j=0; j<fjumpList.length; j++) { if (fjumpList[j].value.match(rgxp)) { while (fjumpList[j+1].innerHTML.match(/-{3}\s/)) { holdstuff+="<a href='"+ fjumpList[j+1].value +"'><font color='116600' style='font-weight: bold; font-size:10'>"+ fjumpList[j+1].innerHTML.replace('--- ','') +"</font></a>, "; j++; } holdstuff=holdstuff.substr(0,holdstuff.length-2); break; } } dest.innerHTML=holdstuff; dest.align="right"; tds[i].firstChild.rows[0].cells[1].appendChild(dest); } }
// --> </script>
|
|
|
Post by Wormopolis on Aug 5, 2010 3:01:22 GMT -8
<script type="text/javascript"> <!-- var fjumpList=document.getElementById('forumjump').options;
boardsToAffect="general|board2|board3|board4";
for (tds=document.getElementsByTagName('td'), i=0; i<tds.length; i++) { if (tds.width=="50%" && tds.className.match(/windowbg/) && tds.align=="left" && tds.firstChild.innerHTML.match(/sub-board/)) { tds.firstChild.rows[0].cells[0].innerHTML=tds.firstChild.rows[0].cells[0].innerHTML.replace(/\(\d+\ssub-board(s?)\)/,''); bname=tds.getElementsByTagName('a')[0].href.split('board=')[1]; btitle=tds.getElementsByTagName('b')[0].innerHTML; var dest=document.createElement('div'); dest.style.paddingTop="1"; var holdstuff; dest.innerHTML=holdstuff=""; rgxp=new RegExp("\\\/index.cgi\\\?board="+bname,"i"); rgxp2=new RegExp("^("+boardsToAffect+")$",""); for (j=0; j<fjumpList.length; j++) { if (fjumpList[j].value.match(rgxp) && bname.match(rgxp2)) { while (fjumpList[j+1].innerHTML.match(/-{3}\s/)) { holdstuff+="<a href='"+ fjumpList[j+1].value +"'><font color='116600' style='font-weight: bold; font-size:10'>"+ fjumpList[j+1].innerHTML.replace('--- ','') +"</font></a>, "; j++; } holdstuff=holdstuff.substr(0,holdstuff.length-2); break; } } dest.innerHTML=holdstuff; dest.align="right"; tds.firstChild.rows[0].cells[1].appendChild(dest); } }
// --> </script>
|
|
|
Post by tunescool on Aug 5, 2010 3:36:07 GMT -8
i created a test sub board and it didnt show up. the ones in the code show up, thanks wormo. i know im always changing stuff after i see something else i like...
|
|
|
Post by Wormopolis on Aug 5, 2010 11:42:54 GMT -8
you changed the variable at the top correct? are you saying it didnt work?
|
|
|
Post by tunescool on Aug 5, 2010 12:49:49 GMT -8
it works fine, i was saying the test board i put in another forum didnt show up and the code was doing its job not picking up sub boards if not in a selected forum
|
|
|
Post by Wormopolis on Aug 6, 2010 0:12:07 GMT -8
ah... well excellent then.
|
|