Hi - my web host says there is an error in the index page of the admin side, and the developer (68 classifieds) says it’s not their fault, it’s a hosting issue. We’ve done nothing to the site for months and the admin page just disappeared one day last month: http://www.arabhorsemarket.com/administration/index.php
Here is the code:
<?php
/**
* @copyright 68 Classifieds
*
* @author 68 Classifieds
* @version $Revision: 453 $
* @package 68Classifieds
* @link http://www.68classifieds.com
*
* @Updated: $Date: 2010-01-05 10:19:17 -0500 (Tue, 05 Jan 2010) $
*/
require_once ('includes/init.php');
$Users = Library::loadLibrary('Users');
$Orders = Library::loadLibrary('Orders');
$error = '';
if (file_exists('../setup/index.php'))
{
$error = "Warning: Please remove the setup directory.
";
}
if ($Core->settings['mainTakeOffline'] == "Y")
{
$error .= "Warning: Your site is currently set to offline.";
}
$class_tpl->assign('error', $error);
//new orders
$sSQL = "SELECT oID, oOwnerID, oProduct, oDate FROM " . PREFIX . "orders ORDER BY oDate DESC LIMIT 10";
$result = $db->query($sSQL);
$neworders = "
";
while ($row = $result->fetch())
{
$user = $Users->getUserNameById($row['oOwnerID']);
$neworders .= '- ' . $user['username'] . ' - ' . Filter::no_html($row['oProduct']) . ' - ' . Filter::special_chars($row['oDate']) . '
';
}
$neworders .= '
';
$class_tpl->assign('neworders', $neworders);
//new listings
$sSQL = "SELECT id, title, dateadded FROM " . PREFIX . "listings ORDER BY dateadded DESC LIMIT 10";
$result = $db->query($sSQL);
$newlistings = "
';
$class_tpl->assign('newlistings', $newlistings);
//new users
$sSQL = "SELECT id, username, joindate FROM " . PREFIX . "users ORDER BY joindate DESC LIMIT 10";
$result = $db->query($sSQL);
$newusers = "
';
$class_tpl->assign('newusers', $newusers);
// get total//
$sSQL = "SELECT id FROM " . PREFIX . "listings";
$result = $db->query($sSQL);
$rs = $result->fetch();
$total_listings = $result->num_rows();
if ($total_listings == 0)
{
$class_tpl->assign('firsttime', TRUE);
}
// get users//
$sSQL = "SELECT id FROM " . PREFIX . "users";
$result = $db->query($sSQL);
$total_members = $result->num_rows();
// get subscribers//
$sSQL = "SELECT firstname, lastname, email FROM " . PREFIX . "users WHERE newsletter='Y'";
$result = $db->query($sSQL);
$subscribers = $result->size();
if ($total_members != "")
{
$percentage = number_format(($subscribers / $total_members) * 100);
}
else
{
$percentage = 0;
}
$class_tpl->assign('total_listings', $total_listings);
$class_tpl->assign('total_members', $total_members);
$class_tpl->assign('percentage', $percentage);
$class_tpl->assign('subscribers', $subscribers);
//monthly sales
$date = date("Y-m", mktime(0, 0, 0, date("m") - 1, 1, date("Y")));
$class_tpl->assign('lastmonth', $Orders->getMonthlyTotal($date));
$date = date("Y-m");
$class_tpl->assign('thismonth', $Orders->getMonthlyTotal($date));
//private messages
$sSQL = 'SELECT turnedon FROM ' . PREFIX . 'settings_pm WHERE id=1';
$result = $db->query($sSQL);
$row = $result->fetch();
if ($row['turnedon'] == 'Y')
{
$sSQL = 'SELECT COUNT(*) AS total FROM ' . PREFIX . 'pm WHERE isspam = "Y"';
$result = $db->query($sSQL);
$rs = $result->fetch();
$result->freeResult();
$totalspam = $rs['total'];
$class_tpl->assign('totalspam', $totalspam);
$class_tpl->assign('pmon', "Y");
}
$class_tpl->assign('body', 'home.tpl');
$class_tpl->displayTemplate();
/* End of file index.php */
/* Location: ./upload/administration/index.php */