|
Post by tunescool on Aug 6, 2010 18:22:25 GMT -8
i tried this but it took my sub board display out and is 2 lines not new and thread next to each other. and in the process i lost half my global footers, not that im blaming you or the code. i did change the width th 50%. could you make it work with my forum
<script type="text/javascript"><!-- // add "new thread" link into main page board cells // by Wormopolis - [url]Wormocodes.proboards.com[/url] // keep header intact // v 1.5
var operationMode="normal"; // "staff" if you want link on boardList for staff // "normal" if you want link on all boards except those in boardList
var boardList = "(codedb|graphgal|gfaf)"; linkstuff="<font style='font-size:8'>New Thread</font>"; //can be HTML
// no need to edit below
if (true) {
staffCheck=false; if (operationMode=='staff') { for (lnks=document.getElementsByTagName('a'), q=0; q<lnks.length; q++) { if (lnks[q].href.match(/action=admin/)) { staffCheck=true; break; } } }
for (tds=document.getElementsByTagName('td'), r=0; r<tds.length; r++) { if ( tds[r].width=="66%" && tds[r].className.match(/windowbg/) && tds[r].align=="left") { if ((operationMode=='normal' && !tds[r].getElementsByTagName('a')[0].href.match(boardList)) || (operationMode=='staff' && staffCheck && tds[r].getElementsByTagName('a')[0].href.match(boardList))) { holdthis=tds[r].getElementsByTagName('a')[0].href; tds[r].style.padding=0; nwtbl=document.createElement('table'); nwtbl.width="100%"; nwRw=nwtbl.insertRow(0); nwcl2=nwRw.insertCell(0); nwcl1=nwRw.insertCell(0); while (tds[r].firstChild) nwcl1.appendChild(tds[r].firstChild); tds[r].appendChild(nwtbl); nwcl2.width="12%" nwcl2.align="right" nwcl2.vAlign="top" nwlnk=document.createElement('a'); nwlnk.href=holdthis+"&action=post"; nwlnk.innerHTML=linkstuff; nwcl2.appendChild(nwlnk); } } }
} // --> </script>
heres mine
<script type="text/javascript"> <!-- // Add "New Thread" Link Into Main Page Board Cells // by Wormopolis - [url]Wormocodes.proboards.com[/url] // keep header intact
linkstuff="<font style='font-weight: bold; font-size:9'>New Thread</font>"; //can be HTML
for (tds=document.getElementsByTagName('td'), r=0; r<tds.length; r++) { if ( tds[r].width=="50%" && tds[r].className.match(/windowbg/) && tds[r].align=="left") { holdthis=tds[r].getElementsByTagName('a')[0].href; tds[r].style.padding=0; nwtbl=tds[r].appendChild(document.createElement('table')); nwtbl.width="100%"; nwRw=nwtbl.insertRow(0); nwcl2=nwRw.insertCell(0); nwcl1=nwRw.insertCell(0); nwcl1.appendChild(tds[r].firstChild); nwcl1.appendChild(tds[r].firstChild); nwcl1.appendChild(tds[r].firstChild); nwcl2.align="right" nwcl2.vAlign="top" nwlnk=document.createElement('a'); nwlnk.href=holdthis+"&action=post"; nwlnk.innerHTML=linkstuff; nwcl2.appendChild(nwlnk);} }
// --> </script>
|
|
|
Post by Wormopolis on Aug 6, 2010 19:51:52 GMT -8
the first code is essentially the same thing as the second, except the second was modded to work on your forum. what from the first code are you wanting added to the second?
|
|
|
Post by tunescool on Aug 6, 2010 19:56:03 GMT -8
new thread shows up new above the word thread, id want it just new thread on one line. could that be why the sub boards didnt show up
|
|
|
Post by Wormopolis on Aug 6, 2010 20:24:49 GMT -8
ah wait.. I see what you are saying now.
find this line:
nwcl2.vAlign="top"
add right after it:
nwcl2.style.width="18%";
that should force it wider.
|
|
|
Post by tunescool on Aug 6, 2010 20:51:16 GMT -8
neither new thread or the sub boards are showing up
|
|
|
Post by Wormopolis on Aug 6, 2010 23:13:18 GMT -8
I was editing the code you already had running... put that one back in.
|
|
|
Post by Wormopolis on Aug 6, 2010 23:16:45 GMT -8
it was this one:
<script type="text/javascript"> <!-- // Add "New Thread" Link Into Main Page Board Cells // by Wormopolis - [url]Wormocodes.proboards.com[/url] // keep header intact
linkstuff="<font style='font-weight: bold; font-size:9'>New Thread</font>"; //can be HTML
for (tds=document.getElementsByTagName('td'), r=0; r<tds.length; r++) { if ( tds[r].width=="50%" && tds[r].className.match(/windowbg/) && tds[r].align=="left") { holdthis=tds[r].getElementsByTagName('a')[0].href; tds[r].style.padding=0; nwtbl=tds[r].appendChild(document.createElement('table')); nwtbl.width="100%"; nwRw=nwtbl.insertRow(0); nwcl2=nwRw.insertCell(0); nwcl1=nwRw.insertCell(0); nwcl1.appendChild(tds[r].firstChild); nwcl1.appendChild(tds[r].firstChild); nwcl1.appendChild(tds[r].firstChild); nwcl2.align="right" nwcl2.vAlign="top" nwlnk=document.createElement('a'); nwlnk.href=holdthis+"&action=post"; nwlnk.innerHTML=linkstuff; nwcl2.appendChild(nwlnk);} }
// --> </script>
|
|
|
Post by tunescool on Aug 6, 2010 23:37:44 GMT -8
celebrity news and discussion show up wrong aaron didnt get the background in the last 3 cells yet. he just edited the sub board code you already did
|
|
|
Post by Wormopolis on Aug 7, 2010 1:56:19 GMT -8
you are talkign about how the sub-boards show up different right? that is a completely different code from the "new thread" code. when you said "new thread" showed up on 2 lines, I was trying to fix THAT with the edit I made above where I told you to add the new line in.
|
|
|
Post by tunescool on Aug 7, 2010 2:41:46 GMT -8
i put the last one you posted in, is that the one i should have in?
|
|
|
Post by Wormopolis on Aug 7, 2010 4:35:05 GMT -8
and I see a new thread link on every board, and all of them are on 1 line. are you seeing something different?
|
|
|
Post by tunescool on Aug 7, 2010 5:01:29 GMT -8
no i just need the sub boards straightened out in news and discussion
|
|
|
Post by Wormopolis on Aug 7, 2010 23:02:52 GMT -8
that is a completely different code that handles subboards:
<script type="text/javascript"> <!-- var fjumpList=document.getElementById('forumjump').options;
boardsToAffect="nookfeat|board2"; boardsImg="http://i709.photobucket.com/albums/ww95/tunescool/nook/grey12.jpg|url";
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"); rgxp2=new RegExp("^("+boardsToAffect+")$",""); 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; } } if(bname.match(rgxp2)){ var t = document.createElement("tr").appendChild(document.createElement("td")); t.className="windowbg2"; t.innerHTML="<b></b> " + holdstuff; t=t.parentNode.appendChild(document.createElement("td")); t.className="windowbg"; t.colSpan=2; t.style.backgroundImage="url("+boardsImg.split("|")[boardsToAffect.split(bname)[0].split("|").length - 1]+")"; tds[i].parentNode.parentNode.insertBefore(t.parentNode, tds[i].parentNode.nextSibling); continue; } dest.innerHTML=holdstuff; dest.align="right"; tds[i].firstChild.rows[0].cells[1].appendChild(dest); } } // --> </script> notice the variable at the top where you list which boards to affect?
|
|
|
Post by tunescool on Aug 7, 2010 23:16:46 GMT -8
the whole reason i started this thread was to take out new thread from some boards. you were pasting codes and whatever i have in there now obviously doesnt do that and is what did that to the one forum news and discussion. i got lost somewhere and just want the option to take some new threads out and have it be one line, new thread.
|
|
|
Post by Wormopolis on Aug 8, 2010 2:22:29 GMT -8
look back at the original post... you never said anything about removing the new thread from some of the boards. in fact NONE of your posts said anything about removing "new thread" from some of the boards. then you said that "news and discussion" was messed up and the only think I could see was the sub-boards being different then the board at the top.
So now that you said you wanted it removed, do you want to list boards to be excluded, or do you want to list boards to be included?
|
|