Location: PHPKode > projects > SiteX > admin/hits.php
<?PHP
ob_start();
session_start();

include("../includes/globals.php.inc");
include("../includes/functions.php");
include("../lang/English.php");
if(strtolower($sxSetup['Language']) != 'english') include("../lang/".$sxSetup['Language'].".php");
include("../themes/$THEME_FOLDER/config.php.inc");
if((!userEditor())AND(!userAdmin()))  loginError($sxLang['LoginRequired']);
if((userEditor())AND(!$sxSetup['EditorRightsVisitorStats']))  loginError($sxLang['LoginRequired']);

$totalHits = 0;
$query = "SELECT * FROM $DB_Hit_Counters";
$result = mysql_query($query, $Link) or queryError("56", mysql_error());
while($ROW = mysql_fetch_object($result))
	$totalHits = $totalHits + $ROW->hits;

$query = "SELECT * FROM $DB_Hit_Counters";
$result = mysql_query($query, $Link) or queryError("55", mysql_error());
$totalElements = mysql_num_rows($result);

$elements_per_page = $sxThemeConfig['AdminElementsPerPage'];
if(!$page)
	$page = 1;
$start = ($page - 1)*$elements_per_page;

$sxTitleAddendum = $sxLang['AdminHeading'];
include("../themes/$THEME_FOLDER/header.php");
?>   
<div class="bodyWrapper">
   <h1 class="sxAdminHeading"><?PHP echo $sxLang['HitsHeadingStats']; ?></h1>
   <div class="sxAdminBreadcrumbs"><?PHP if(userAdmin()) { ?><a href="index.php"><?PHP echo $sxLang['AdminBreadcrumb']; ?><?PHP }?><?PHP if(userEditor()) { ?><a href="editor_index.php"><?PHP echo $sxLang['EditorBreadcrumb']; ?><?PHP }?></a> > <?PHP echo $sxLang['HitsHeadingStats']; ?></div>   
   <?PHP echoMessage($message); ?>
   <div style="padding-bottom:5px;"><strong><?PHP echo $sxLang['HitsTotalPageViews']; ?></strong> <?PHP echo number_format($totalHits); ?></div>  
	<div style="padding-top:8px;padding-bottom:8px;font-size:10px;"><?PHP pageTurns("$PHP_SELF?", $totalElements, $page, $elements_per_page); ?></div>
	<table border="0" cellspacing="2" cellpadding="5">
	  <tr>
		<td class="tableColumn"><?PHP echo $sxLang['GeneralItemPage']; ?></td>
		<td class="tableColumn"><?PHP echo $sxLang['GeneralItemHits']; ?></td>
	  </tr>
		<?PHP
		$query = "SELECT * FROM $DB_Hit_Counters ORDER BY hits DESC LIMIT $start, $elements_per_page";
		$result = mysql_query($query, $Link) or queryError("27", mysql_error());
		while($ROW = mysql_fetch_object($result)){
			echo '  <tr>';
			echo '     <td bgcolor="' . $sxTheme['ColorTableRow'] . '">' . limitStringForce(str_replace('Merged Hits ',$sxLang['HitsMergedHits'].' ',$ROW->page),100) . '</td>';
			echo '     <td bgcolor="' . $sxTheme['ColorTableRow'] . '">' . number_format($ROW->hits) . '</td>';
			echo '  </tr>';
		}
	
		?></table>
  <div style="padding-top:8px;padding-bottom:8px;font-size:10px;"><?PHP pageTurns("$PHP_SELF?", $totalElements, $page, $elements_per_page); ?></div>
</div>
<?PHP
include("../themes/$THEME_FOLDER/footer.php");
ob_end_flush();
?>
Return current item: SiteX