100%
|
Post by Aaron on Nov 26, 2004 18:05:14 GMT -8
All Board Footers: <script type="text/javascript"> <!-- // Scratch Thread Link if Locked - By Naruto
// Put "yes" if you want the text "Locked" after the thread's link var LockedText = "yes"
var TD = document.getElementsByTagName("TD"); for(t=0;t<TD.length;t++) { if(TD[t].className=="windowbg2" && TD[t].vAlign=="middle" && TD[t].align=="center" && TD[t].width=="6%" && TD[t].innerHTML.match(/(locked.gif)/i)) { if(LockedText.match(/^yes$/i)) { TD[t+2].innerHTML = TD[t+2].innerHTML.replace(/><b>(.+?)<\/b><\/a>/i,"><s><b>$1<\/b><\/s><\/a> - Locked"); } else { TD[t+2].innerHTML = TD[t+2].innerHTML.replace(/><b>(.+?)<\/b><\/a>/i,"><s><b>$1<\/b><\/s><\/a>"); } } } //--> </script>This will draw a line through the thread if it's locked. Preview: narutotesting.proboards36.com/index.cgi?board=general2!!!ATTENTION: Edit all green. If you need any help on this, post here.
|
|
|
Post by maxpower57 on Nov 26, 2004 20:45:17 GMT -8
dude nice code!
|
|
|
Post by Uchiha Susuke on Nov 26, 2004 21:08:24 GMT -8
that's a great idea!
oooh, for the sake of learning (always good to learn more) i'd like to make some suggestions ^_^
well, for one, when replacing with the new text, you had the \ before all the /'s even though they weren't in RegExp form (though it's valid HTML, not XHTML)
and, here's for the learning part! ^_^ this is just a little edited version i made to save space, some good things to take's a looksie at
<script type="text/javascript"> <!-- // Scratch Thread Link if Locked - By Naruto
// Put "yes" if you want the text "Locked" after the thread's link var LockedText = "yes"
var TD = document.getElementsByTagName("TD"); LockedText = (LockedText.match(/^yes$/gim)) ? " - Locked" : ""; for(t=0;t<TD.length;t++) { if(TD[t].className=="windowbg2" && TD[t].vAlign=="middle" && TD[t].align=="center" && TD[t].width=="6%" && TD[t].innerHTML.match(/(locked.gif)/i)) { TD[t+2].innerHTML = TD[t+2].innerHTML.replace(/><b>(.+?)<\/b><\/a>/i,"><s><b>$1</b></s></a>"+LockedText); } } //--> </script>
|
|
|
Post by Kenshin on Dec 1, 2004 13:48:57 GMT -8
Great coding and idea for a code..Your getting better by the mintue
|
|
|
Post by ShadowyOne on Dec 1, 2004 14:39:34 GMT -8
Nice, I'm sure people'll use it.
|
|
|
Post by Smashey on Dec 1, 2004 17:52:48 GMT -8
Great work.
|
|
|
Post by justlooking on Dec 2, 2004 1:03:06 GMT -8
very clever thanks
|
|
|
Post by Sephiroth on Mar 19, 2005 9:59:01 GMT -8
2 Questions.
-Does it strikethrough locked and sticky threads too? -Do we put a url where it says "locked.gif"?
|
|
|
Post by Eric on Mar 19, 2005 10:29:41 GMT -8
2 Questions. -Does it strikethrough locked and sticky threads too? -Do we put a url where it says "locked.gif"? Not sticky threads, I'm pretty that's because many sticky threads are purposefully locked. You don't put a URL, you just put the part after the last slash in the URL so say you have: test.com/images/bluelock.gifYou would put: bluelock.gif
|
|
|
Post by DEIRULES2004 on Mar 23, 2005 1:02:15 GMT -8
I like the code and all...But Im wondering if there is one without having the "Scratch" through the text..just the word "Locked" beside the text?
|
|