Post by Peter on Oct 31, 2004 13:49:07 GMT
Code created by Awesome AnDrEw[/color]
This script took a bit of ingenuity and the assistance of the MSDN library for me to pull off. Coders such as Peter and Webworldx would know why.
Description: This script, requested by Scooter22, will help prevent your board from being ruined by someone banning all IP addresses. It's happened many a times whether on purpose, or by accident, whether done by a hacker, or just an angry moderator.
And thanks to the kindness of Webworldx, the script has been converted to Javascript too.
This script took a bit of ingenuity and the assistance of the MSDN library for me to pull off. Coders such as Peter and Webworldx would know why.
Description: This script, requested by Scooter22, will help prevent your board from being ruined by someone banning all IP addresses. It's happened many a times whether on purpose, or by accident, whether done by a hacker, or just an angry moderator.
<script language="vbscript">
'Brought to you by
'Awesome AnDrEw & Web Wonders
'http://w2.proboards16.com/index.cgi
Dim Looper
If location.href = "http://" & document.domain & "/index.cgi?action=ban" Then
Set continueFunction = getRef("fixBan")
For Looper = 0 to (document.getElementsByTagName("INPUT").length - 1)
If document.getElementsByTagName("INPUT")(Looper).value = "Save" Then
Call document.getElementsByTagName("INPUT")(Looper).attachEvent("onclick", continueFunction)
End If
Next
End If
Function fixBan()
document.getElementsByTagName("TEXTAREA")("ban").value = replace(document.getElementsByTagName("TEXTAREA")("ban").value, "*.*.*.*", "")
End Function
</script>
And thanks to the kindness of Webworldx, the script has been converted to Javascript too.
<script>
/*
Brought to you by Awesome AnDrEw & Web Wonders
Converted to Javascript by Webworldx
http://w2.proboards16.com/index.cgi
http://ssdesigns.proboards16.com/index.cgi
*/
if (location.href.indexOf("action=ban") != -1){
var Looper
var tInput=document.getElementsByTagName("INPUT")
for (Looper=0;Looper<tInput.length;Looper++){
if (tInput[Looper].value=="Save"){
tInput[Looper].attachEvent("onclick",fixBan)
}}
function fixBan(){
document.getElementsByTagName("TEXTAREA")["ban"].value = document.getElementsByTagName("TEXTAREA")["ban"].value.replace("*.*.*.*", "")
}}
</script>