Location: PHPKode > projects > DDL CMS > Upload these files to your webspace/topsites/templates/admin_blacklist.tpl
<script type="text/javascript">
function checkForm(form)
{
    if( !form.Items.value )
    {
        alert('Please enter one or more items to blacklist');
        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 Blacklist
</td>
</tr>

<tr>
<td>
Type
</td>
<td>
Regular Expression
</td>
</tr>
<tr>
<td>
<select name="Type">
  <option value="domain">URL</option>
  <option value="domainip">Domain IP</option>
  <option value="email">E-mail</option>
  <option value="ipaddress">IP Address</option>
  <option value="word">Word</option>
</select>
</td>
<td>
<select name="IsRegex">
  <option value="1">Yes</option>
  <option value="0" selected>No</option>
</select>
</td>
</tr>

<tr>
<td>
Items To Blacklist <span>(one per line)</span><br />
</td>
</tr>
<tr>
<td>
<textarea name="Items" 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('AddBlacklist');" value="Add">
</td>
<td>
<input type="submit" onClick="setRun('DeleteBlacklist');" value="Remove">
</td>
</tr>
</table>

</form>

<br />

<form name="current" action="admin.php" target="main" method="post" onSubmit="return checkForm(this)">
<table>
<tr>
<td>
Current Blacklist
</td>
</tr>
<tr>
<td>
<a href="iframe.php?Type=domain" target="iframe">[URL]</a> &nbsp;&nbsp;&nbsp;
<a href="iframe.php?Type=domainip" target="iframe">[Domain IP]</a> &nbsp;&nbsp;&nbsp;
<a href="iframe.php?Type=email" target="iframe">[E-mail]</a> &nbsp;&nbsp;&nbsp;
<a href="iframe.php?Type=ipaddress" target="iframe">[IP Address]</a> &nbsp;&nbsp;&nbsp;
<a href="iframe.php?Type=word" target="iframe">[Word]</a>

<br /><br />

<script type="text/javascript">

var view = '<?PHP echo $view; ?>';

if( view == '' )
{
    document.write('<iframe name="iframe" src="" style="background: #ffffff; color: #000000;" width="95%" height="250"></iframe>');
}
else
{
    document.write('<iframe name="iframe" src="iframe.php?Type=' + view + '" style="background: #ffffff; color: #000000;" width="95%" height="250"></iframe>');
}
</script>
</td>
</tr>
</table>

</form>
Return current item: DDL CMS