<?php
/**********************************************************
* ______ ______ ___ _______ ___ ___ _______ *
* | _ \ | _ \ | | | _ || Y || _ | *
* |. | \|. | \|. | |. 1___||. || 1___| *
* |. | |. | |. |___ |. |___ |. \_/ ||____ | *
* |: 1 |: 1 |: 1 ||: 1 ||: | ||: 1 | *
* |::.. . /|::.. . /|::.. . ||::.. . ||::.|:. ||::.. . | *
* `------' `------' `-------'`-------'`--- ---'`-------' *
* _______ _______ *
* .--.--. | _ | | | *
* | | | |___| | __ |___| | *
* \___/ _(__ | |__| / ___/ *
* |: 1 | |: 1 \ *
* |::.. . | |::.. . | *
* `-------' `-------' *
* *
* Script: DDLCMS v3.2 *
* Author: Little Dragon *
* Email: hide@address.com *
* Website: http://www.ddlcms.com *
* *
* Please direct bug reports, suggestions or feedback *
* to the DDLCMS forums: *
* *
* http://www.ddlcms.com/forums *
* *
* DDLCMS is a commercial grade content management *
* system for DDL site owners. It is provided free *
* of charge, provided: *
* *
* 1. You keep the linkback to http://www.ddlcms.com *
* in the footer. *
* *
* 2. You keep the sponsored links to Sharingzone.net *
* on your site. *
* *
* By using this script, you agree that you will not *
* modify, remove, or replace any encoded parts of *
* this script. All encoded parts MUST remain intact *
* for your site to remain in good standing. *
* *
**********************************************************/
session_start();
if(!isset($_SESSION) || !is_array($_SESSION) || !array_key_exists('authuser', $_SESSION))
{
$_SESSION = NULL;
session_destroy();
header('Location: ' . $site_url . '/admin/');
}
define('ADMINDIR', dirname(__FILE__) . '/');
define('WWWROOT', substr(ADMINDIR, 0, -6));
define('BASEDIR', substr(WWWROOT, 0, ##BASEDIR##));
require(BASEDIR . 'funcs.inc');
require(BASEDIR . 'config.php');
require(ADMINDIR . 'adminheader.php');
?>
<tr>
<td width="180" style="padding: 0;">
<?php
# Get total unique IP addresses in IP field of iplog table
$get = dbcom('SELECT ip FROM iplog WHERE ip <> "0";');
while($rows = mysql_fetch_array($get))
{
$row[] = $rows['ip'];
}
$rawips = count($row);
if($rawips > 0)
{
$uniqueips = count(array_unique($row));
}
else
{
$uniqueips = 0;
}
# Get total banned ips from iplog table
$countbanned = dbcom('SELECT count(bannedip) as banned FROM iplog WHERE bannedip <> "0";');
$rows = mysql_fetch_object($countbanned);
$numbannedips = $rows->banned;
# Get total urls in urls table
$urlcount = 0;
$get = dbcom('SELECT url FROM urls;');
if(mysql_num_rows($get))
{
while($row = mysql_fetch_array($get))
{
$urls[$urlcount] = $row['url'];
$urlcount++;
}
}
?>
<div class='sidebartitle'>
Maintenance
</div>
<a href="<?php echo $site_url; ?>/admin/autosubmitter.php?go=urls"> • View URLs</a> (<?php echo $urlcount; ?>)<br />
<a href="<?php echo $site_url; ?>/admin/autosubmitter.php?go=addurls"> • Add URLs</a><br />
<a href="<?php echo $site_url; ?>/admin/autosubmitter.php?go=viewips"> • View IPs</a> (<?php echo $rawips; ?>)<br />
<a href="<?php echo $site_url; ?>/admin/autosubmitter.php?go=bannedips"> • Banned IPs</a> (<?php echo $numbannedips; ?>)
</td>
<!-- END LEFT SIDE -->
<!-- BEGIN RIGHT SIDE -->
<td width="790" align="left" valign="top" class="mainbox">
<?php
# when banning an IP address from the autosubmitter, insert a date 100 years from now, so it never gets deleted
if(checkURLQuery('autosubmitter.php', $_GET) === TRUE)
{
$go = $_GET['go'];
switch($go)
{
case 'urls':
$e->edit_urls();
break;
case 'addurls':
$e->add_urls();
break;
case 'viewips':
$e->viewips();
break;
case 'bannedips':
$e->bannedips();
break;
}
}
else
{
?>
<h2>Public Autosubmitter Administration</h2>
<?php
if(checkPostForm('publicAutoSubmitter', $_POST) === TRUE)
{
dbcom('UPDATE config SET publicAutoSubmitter = "' . $_POST['enablePublicAutoSubmitter'] . '" WHERE siteID = ' . $siteID . ' LIMIT 1;');
?>
<p>Settings saved. <a href="javascript:history.go(-1)">Go back</a>.</p>
<?php
}
else
{
?>
<p><a href="<?php echo $site_url; ?>/admin/autosubmitter.php?go=viewips"> <img src="<?php echo $site_url; ?>/admin/images/view.png" height="16" width="16" border="0" align="middle" alt="View or ban IP addresses" /> View or ban IP addresses</a></p>
<blockquote> • <?php echo $uniqueips; ?> unique IP addresses are logged of people using your Autosubmitter (for the past month).
<br /> • <?php echo $rawips; ?> raw IP addresses are logged of people using your Autosubmitter (for the past month).</blockquote>
<p><a href="<?php echo $site_url; ?>/admin/autosubmitter.php?go=urls"> <img src="<?php echo $site_url; ?>/admin/images/view.png" height="16" width="16" border="0" align="middle" alt="View or Delete URLS" /> View or delete submit page URLs</a></p>
<blockquote> • <?php echo $urlcount; ?> URLs in your auto submit-to list.</blockquote>
<p><a href="<?php echo $site_url; ?>/admin/autosubmitter.php?go=addurls"> <img src="<?php echo $site_url; ?>/admin/images/add.png" height="16" width="16" border="0" align="middle" alt="Add one or more URLS" /> Add one or more URLs</a></p>
<blockquote> • You can copy and paste multiple URLs at once!</blockquote>
<br />
<form action="<?php echo $site_url; ?>/admin/autosubmitter.php" method="post">
<span><b>Enable Public AutoSubmitter: </b></span>
<?php
if($publicAutoSubmitter == 1)
{
?>
<input type="radio" name="enablePublicAutoSubmitter" id="optEnablePublicAutoSubmitterYes" value="1" checked="checked" /><label for="optEnablePublicAutoSubmitterYes">Yes</label>
<input type="radio" name="enablePublicAutoSubmitter" id="optEnablePublicAutoSubmitterNo" value="0" /><label for="optEnablePublicAutoSubmitterNo">No</label>
<?php
}
else
{
?>
<input type="radio" name="enablePublicAutoSubmitter" id="optEnablePublicAutoSubmitterYes" value="1" /><label for="optEnablePublicAutoSubmitterYes">Yes</label>
<input type="radio" name="enablePublicAutoSubmitter" id="optEnablePublicAutoSubmitterNo" checked="checked" /><label for="optEnablePublicAutoSubmitterNo">No</label>
<?php
}
?>
<br />
<br />
<input type="submit" value="Submit" class="formbutton" />
</form>
<?php
}
}
?>
</td>
</tr>
<!-- END RIGHT SIDE -->
<?php
require(ADMINDIR . 'adminfooter.php');
?>