|
Post by Nightwalker on Dec 12, 2010 19:19:09 GMT
anyone see an error in this?
<script type="text/javascript"> <!-- /* Remove Report to Mod div for some mods Written by Nightwalker as requested by Splittykins You may edit but leave header please */
var getstosee= /^(nightwalker)$/;
if(!getstosee.test(pb_username)) { document.getElementById('reported_posts_message').style.display = 'none'; }
if(!getstosee.test(pb_username) && pb_action == 'admin') { var aAH = document.getElementsByTagName("a"),b=0; while(aAH[++b]){ if(aAH.href.match(/viewreportedposts/)){ aAH.parentNode.removeChild(aAH.nextSibling); aAH.style.display = "none"; }
//--> </script>
this is the part that isn't working...
if(!getstosee.test(pb_username) && pb_action == 'admin') { var aAH = document.getElementsByTagName("a"),b=0; while(aAH[++b]){ if(aAH.href.match(/viewreportedposts/)){ aAH.parentNode.removeChild(aAH.nextSibling); aAH.style.display = "none"; }
|
|
edenwax
VIP
v5 Beta Tester[M:5000]
Posts: 1,266
|
Post by edenwax on Dec 12, 2010 19:22:38 GMT
Moved to: Client Side Discussion
Javascript is client side. No worries though.
|
|
|
Post by Nightwalker on Dec 12, 2010 19:28:37 GMT
ooops...i thought for sure i posted it on client side...
|
|
edenwax
VIP
v5 Beta Tester[M:5000]
Posts: 1,266
|
Post by edenwax on Dec 12, 2010 19:37:46 GMT
xD No worries, man.
Anyways, someone who is able to fix the problem should respond soon enough.
|
|
|
Post by moneyman18 on Dec 12, 2010 19:47:58 GMT
I count 2 more opening brackets than there are closing.
|
|
|
Post by Nightwalker on Dec 12, 2010 20:31:39 GMT
wow...i forgot about those
|
|
|
Post by Nightwalker on Dec 12, 2010 20:39:49 GMT
One more thing.
Somone at support pointed out that the code makes an error when the div isn't there. How can i check to make sure it is there in the if statement?
|
|
|
Post by Nightwalker on Dec 12, 2010 20:57:43 GMT
Ok never mind i thought of a way to do it but i must have done something wrong again...
in the global header i have this:
<style type="text/css"> #reported_posts_message { display: none; } </style>
that hides the div for everyone. Now i need to get it to show so i have this:
<script type="text/javascript"> <!-- /* Remove Report to Mod div for some mods Written by Nightwalker as requested by Splittykins You may edit but leave header please */
var getstosee= /^(admin)$/;
if(getstosee.test(pb_username)) { document.getElementById('reported_posts_message').style.display = ''; }
//--> </script>
For some reason this doesn't work...
|
|
|
Post by Nightwalker on Dec 12, 2010 21:14:58 GMT
ok i got that one....
now i can't get the second part to run again...
<script type="text/javascript"> <!-- /* Remove Report to Mod div for some mods Written by Nightwalker as requested by Splittykins You may edit but leave header please */
var getstosee= /^(ggg)$/;
if(getstosee.test(pb_username)){ document.getElementById('reported_posts_message').style.display = ''; } if(!getstosee.test(pb_username) && pb_action == 'admin'){ var aAH = document.getElementsByTagName("a"),b=0; while(aAH[++b]){ if(aAH.href.match(/viewreportedposts/)){ aAH.parentNode.removeChild(aAH.nextSibling); aAH.style.display = "none"; } } }
//--> </script>
|
|
russellr
Elite Level 1
[M:5000]
rCs?
Posts: 525
|
Post by russellr on Dec 13, 2010 1:52:32 GMT
aAH = document.getElementsByTagName("a"); b=0; while(aAH[++b]){ if(aAH.href.match(/viewreportedposts/)){ aAH.
|
|
|
Post by Nightwalker on Dec 13, 2010 4:12:15 GMT
thanks
|
|
russellr
Elite Level 1
[M:5000]
rCs?
Posts: 525
|
Post by russellr on Dec 13, 2010 10:03:32 GMT
no problem was not sure if I posted that or not, blackberry is not so great for form submit buttons
|
|