|
Post by Wormopolis on Jun 13, 2009 13:41:00 GMT -8
Browser Tested: IE and FF placement: main footer puts a shortcut link to creating a new thread in each board cell on the main page. code: <script type="text/javascript"> <!-- // add "new thread" link into main page board cells // by Wormopolis - Wormocodes.proboards.com // 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>
Preview: Click Here
|
|
|
Post by Wormopolis on Jun 18, 2009 0:06:25 GMT -8
updated to include EVERYTHING that might already be in the board cell rather then just the default stuff.
|
|
|
Post by Wormopolis on Jul 2, 2009 5:57:19 GMT -8
updated to include board exceptions
|
|
Richie
Not New Member
^ Yes, That's My Fugly Face!
Posts: 35
Richie said 2 great things
|
Post by Richie on Aug 3, 2009 10:50:53 GMT -8
Suggestion: maybe have the "new thread" link on certain boards for staff only? example: i want the "new thread" link on my announcements board, but i want the link to only be seen by staff, since only staff can create new threads there.
|
|
|
Post by Wormopolis on Aug 3, 2009 15:55:48 GMT -8
oooohh.. interesting....
|
|
hcfwesker
Not New Member
Posts: 37
hcfwesker said 0 great things
|
Post by hcfwesker on Oct 10, 2009 19:16:44 GMT -8
This is a great code, and like the updated board exceptions. This is actually ideal for any forum's Introduction board, so new members can immediately lcick it to make a new thread, and introduce themselves on the forum.
I'll probably only use it for the intro board, and change the text to "Introduce Yourself" or something.
Excellent Code! You're Brilliant, Wormopolis!
|
|
|
Post by Wormopolis on Oct 11, 2009 8:14:52 GMT -8
update version 1.5: added in mode to be a staff only code.
|
|
|
Post by Streamstrider on Oct 5, 2011 3:08:33 GMT -8
Is there any way to have the "New Thread" links NOT appear when someone is viewing as a guest?
EDIT: Is there a way to also prevent the link from showing up on boards that have posting disabled?
And can they be added to sub-boards?
|
|
|
Post by Wormopolis on Oct 5, 2011 23:37:39 GMT -8
Is there any way to have the "New Thread" links NOT appear when someone is viewing as a guest? Yes. that wont be hard to add in not possible. there is no way to tell from the main page if a board can be posted to or not. if you put the code in global footer it might catch that cell. never tried it. see what happens.
|
|
|
Post by Streamstrider on Oct 6, 2011 0:45:06 GMT -8
Well, the global footer idea worked pretty well. Thanks! I would like the "New Thread" links not to appear to guests though.
|
|
|
Post by Streamstrider on Oct 6, 2011 0:59:35 GMT -8
When I went to check the login boxes for the other code, I discovered that in IE the code causes some borders to go missing. Screenshot. I know it's bad, but I was trying to get both examples at the same time.
|
|
|
Post by Wormopolis on Oct 6, 2011 11:05:58 GMT -8
change this
if (true) {
to this
if (pb_username!='Guest') {
|
|
|
Post by Streamstrider on Oct 6, 2011 17:16:32 GMT -8
That did it! Thank you!
EDIT: It still removes some of the borders, between the board description and the number of topics in IE.
Okay, here's another question. Can the links be removed from specific boards by specifying certain board ids?
|
|
|
Post by Wormopolis on Oct 6, 2011 23:12:16 GMT -8
remove this line and tell me what happens in both IE and FF
tds[r].style.padding=0;
|
|
|
Post by Streamstrider on Oct 6, 2011 23:20:21 GMT -8
Removing it. One. Two. Three. XD
|
|