Location: PHPKode > projects > DDL CMS > Upload these files to your webspace/topsites/templates/admin_bannedips.tpl
<script type="text/javascript">
function checkForm(form)
{
    if( !form.Items.value )
    {
        alert('Please enter one or more IPs to ban');
        return false;
    }

    return true;
}

function setRun(value)
{
    document.form.Run.value = value;
}

function fixPerLine(item)
{
    if( item.value.match(/\r\n/) )
    {
        var strings = item.value.split("\r\n");

        item.value = '';

        for( var i = 0; i < strings.length; i++ )
        {
            if( strings[i] != '' )
            {
                strings[i] = strings[i].replace(/^\s+|\s+$/, '');

                item.value += strings[i] + "\r\n";
            }
        }
        
        item.value = item.value.replace(/(\r\n)+$/g, '');
    }
    else if( item.value.match(/[^\r]\n/) )
    {
        item.value = item.value.replace(/\n\n+/g, "\n");

        RegExp.multiline = true;
        item.value = item.value.replace(/^\s+|\s+$/g, '');
    }
}

function fixDelete(item)
{
    if( item.value.match(/\s+\[Delete\]/) )
    {
        item.value = item.value.replace(/\s+\[Delete\]/g, "");
    }
}
</script>
<?PHP
if( isset($message) )
{
?>
<div id="message">
<?PHP echo $message; ?>
</div>
<br />
<?PHP
}
?>

<form name="form" action="admin.php" target="_self" method="post" onSubmit="return checkForm(this)">

<table>
<input type="hidden" name="Run">
<tr>
<td>
Manage Banned IPs
</td>
</tr>

<tr>
<td>
IPs to Ban <span>(one per line)</span><br />
</td>
</tr>
<tr>
<td colspan="2">
<textarea name="IP_Addresses" rows="10" cols="30" wrap="off" onChange="fixPerLine(this)" onKeyUp="fixDelete(this)"></textarea>
</td>
</tr>

</table>

<br />


<table>
<tr>
<td>
<input type="submit" onClick="setRun('AddBannedIP');" value="Add">
</td>
<td>
<input type="submit" onClick="setRun('DeleteBannedIP');" value="Remove">
</td>
</tr>
</table>

</form>

<br />

<table>
<form name="current" action="admin.php" target="main" method="post" onSubmit="return checkForm(this)">
<tr>
<td>
Current Banned IPs
</td>
</tr>
<tr>
<td>
<iframe name="iframe" src="main.php?T=bannediplist" width="95%" height="250"></iframe>
</td>
</tr>
</table>

</form>
Return current item: DDL CMS