<?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');
?>
<!-- LEFT side -->
<tr>
<td width="180" style="padding: 0;">
<div class='sidebartitle'>
Maintenance
</div>
<a href="<?php echo $site_url; ?>/admin/news.php"> • View Pages</a><br />
<a href="<?php echo $site_url; ?>/admin/addnews.php"> • Add Page</a><br />
<a href="<?php echo $site_url; ?>/admin/submitfiles.php"> • Submit Pages</a><br />
<a href="<?php echo $site_url; ?>/admin/submitfiles.php?submit_to=katz"> • Submit to Katz</a><br />
<a href="<?php echo $site_url; ?>/admin/submitfiles.php?submit_to=phaze"> • Submit to Phaze</a><br />
</td>
<!-- END LEFT SIDE -->
<!-- BEGIN RIGHT SIDE -->
<td width="790" align="left" valign="top" class="mainbox">
<?php
$editThis = new edit();
$g_total = dbcom('SELECT COUNT(id) AS TOTAL FROM news;');
$editThis->total = mysql_result($g_total,0);
if($editThis->total == '0')
{
echo "<P>No pages to display. <a href=\"$site_url/admin/addnews.php\" target=_top>Click here to create a new page.</a>";
echo "<P>You should create at least 10 new pages, then <a href=\"$site_url/admin/submitfiles.php\">submit them</a> (one click).";
echo "</td></tr><tr><td height=10></td></tr></table></td>";
require(ADMINDIR . 'adminfooter.php');
die();
}
?>
<h2>Page Maker and Auto-Submitter</h2>
<p>
<table border="0" width="100%" cellpadding="0" cellspacing="1">
<tr height="25" valign="top">
<td width="*"><b>Page Name</b></td>
<td width="50" align="center"><b>Type</b></td>
<td width="50" align="center"><b>View</b></td>
<td width="50" align="center"><b>Katz</b></td>
<td width="50" align="center"><b>Phaze</b></td>
<td width="50" align="center"><b>Edit</b></td>
<td width="50" align="center"><b>Delete</b></td>
<td width="200" align="right"><b>Updated</b> </td>
</tr>
<?php
# Get total news entries
$countnews = dbcom('SELECT COUNT(title) AS num_news FROM news;');
$rows = mysql_fetch_object($countnews);
$totalnews = $rows->num_news;
# Let's do this a bit better...
if(isset($_GET) && is_array($_GET) && count($_GET) > 0 && array_key_exists('page', $_GET) && ctype_digit($_GET['page']))
{
$page = $_GET['page'];
}
else
{
$page = 1;
}
$editThis->page = $page;
$editThis->page*=$pagelimit;
$editThis->page-=$pagelimit;
$getnews = dbcom("SELECT id, title, UNIX_TIMESTAMP(date) AS theDate, news, type, submitted FROM news ORDER BY date DESC LIMIT $editThis->page, $pagelimit;");
while($r=mysql_fetch_array($getnews))
{
extract($r);
$linecount++;
echo "<tr onmouseover=\"this.style.backgroundColor='$hovercolor'; \" onmouseout=\"this.style.backgroundColor=''; \">
<td><img src=\"$site_url/admin/images/page.png\" height=16 width=16 align=middle> $title </td>
<td align=\"center\">$type</a></td>
<td align=\"center\"><a href=\"$site_url/news-".$id."-".dot($title).".html\" target=_blank><img src=\"$site_url/admin/images/view.png\" alt=\"View Page\" height=16 width=16 align=middle border=0></a></td>
<td align=\"center\"><a href=\"$site_url/news_katz-".$id."-".dot($title).".html\" target=_blank><img src=\"$site_url/admin/images/view.png\" alt=\"View Page\" height=16 width=16 align=middle border=0></a></td>
<td align=\"center\"><a href=\"$site_url/news_phaze-".$id."-".dot($title).".html\" target=_blank><img src=\"$site_url/admin/images/view.png\" alt=\"View Page\" height=16 width=16 align=middle border=0></a></td>
<td align=\"center\"><a href=\"$site_url/admin/editnews.php?id=$id&action=edit\" target=_top><img src=\"$site_url/admin/images/edit.png\" alt=\"Edit Page\" height=16 width=16 align=middle border=0></a></td>
<td align=\"center\"><a href=\"$site_url/admin/deletenews.php?newsid=$id\" target=_top><img src=\"$site_url/admin/images/delete.png\" alt=\"Delete Page\" height=16 width=16 align=middle border=0></a></td>
<td align=\"right\">" . date($date_format, $theDate) . " </td></tr>";
if(is_int(($totalnews - $linecount)/10))
{
echo '<tr><td colspan=6 height=10></td></tr>';
}
}
echo '</table><P>';
$editThis->paginate('news.php?page=');
?>
</p>
</td>
</tr>
<!-- END RIGHT SIDE -->
<?php
require(ADMINDIR . 'adminfooter.php');
?>