|
Post by Wormopolis on May 31, 2009 10:37:49 GMT -8
Browser Tested: IE, Chrome and FF placement: Global or Board footer
Add thread IDs into variable in order to hide polls no longer needed on a thread. Not as good as being able to delete polls, but as close as you can get I guess.
code:
<script type="text/javascript"> <!-- // Hide poll on selected threads v1.2 // By Wormopolis - wormocodes.proboards.com // do not repost - keep header intact
var threadIDs = "1|98|213"; //seperate multiple threads by |
if (location.href.match(/board=/)) { var thrgxp= new RegExp("thread=("+threadIDs+")($|&)","i"); //add IDs into this regexp
if (location.href.match(/action=display/) && location.href.match(thrgxp)) { for (tds=document.getElementsByTagName('td'), e=0; e<tds.length; e++) { if (tds[e].width=="20%" && tds[e].className=='catbg' && tds[e].align=='left' && tds[e].vAlign=='bottom' && tds[e].getElementsByTagName('img') && tds[e].getElementsByTagName('img')[0].alt.match(/poll/i)) { tds[e].parentNode.style.display="none"; tds[e].parentNode.nextSibling.style.display="none"; } } } else { for (lnks=document.getElementsByTagName('a'), e=0; e<lnks.length; e++) { if (lnks[e].href.match(thrgxp) && lnks[e].parentNode.parentNode.parentNode.getElementsByTagName('img') && lnks[e].parentNode.parentNode.parentNode.getElementsByTagName('img')[0].alt.match(/poll/i)) { lnks[e].parentNode.parentNode.parentNode.getElementsByTagName('img')[0].style.display="none"; } } } }
// --> </script>
Preview: It hides the poll from a thread. use your imagination.
|
|
mimblewimble
Not New Member
Posts: 1
mimblewimble said 0 great things
|
Post by mimblewimble on Feb 15, 2010 0:18:05 GMT -8
Hey, thanks for the help but I have a problem with this code. I put it in the global header and I can still see the poll on my board. I haven't used any other codes on my board.
|
|
|
Post by Wormopolis on Feb 15, 2010 0:54:07 GMT -8
has to be in footer since the poll hasnt been generated yet when the header runs.
typically, the way you forum will read things:
PB stuff for header (welcome table and CSS) Global Header Board or Main Header (depending where you are) PB stuff for main/board content Board or main footer Global Footer Stuff below footer like the "click here to make ad free" and the google bar
since polls exist in the main board content, you have to put codes that apply to them below it. This code can be placed in global footer, or if you want tighter control the board footer that the poll exists in.
you also have to make sure to put the thread id into that variable at the top. the thread id can be seen up in the URL bar (you will see thread=n)
|
|
|
Post by Wormopolis on Nov 20, 2010 21:56:58 GMT -8
version upgrade 1.2: to include LOCKED polls which I apparently forgot exist.
|
|
Kaz
Not New Member
Posts: 1
Kaz said 0 great things
|
Post by Kaz on Mar 30, 2012 12:27:57 GMT -8
Thanks really, since I had a thread that had an accidental poll but proboards doesn't have the option of taking them off without removing the entire thread...but I've found that it still didn't work for locked threads on my site, and that if someone edited a post in there it shows back up, even when you refresh.
Am I doing something improperly?
|
|
|
Post by Wormopolis on Apr 1, 2012 21:01:44 GMT -8
dunno... I would need something from you to look.
|
|
marshabar
Not New Member
Posts: 18
marshabar said 0 great things
|
Post by marshabar on Oct 24, 2012 13:49:27 GMT -8
Hiya Worm,
I tried this code in the global footer with the url of the thread in question but the poll still shows. I put the address of the topic between the [ url][ /url] right?
Thanks many,
Marshabar
|
|
marshabar
Not New Member
Posts: 18
marshabar said 0 great things
|
Post by marshabar on Oct 24, 2012 13:56:52 GMT -8
Sorry, I read ALL the words and found the thread ID. Fixed it. However the poll logo still shows but that's okay. Thanks for the code, worms. ;D
|
|
|
Post by Wormopolis on Oct 24, 2012 21:07:55 GMT -8
the poll logo on the thread listing?
|
|