Размер файла: 1.65Kb
<?php
if (!defined('_SAPE_USER')){
define('_SAPE_USER', '40e09a759bfada62896caa2b0b7aa652');
}
require_once($_SERVER['DOCUMENT_ROOT'].'/'._SAPE_USER.'/sape.php');
$sape = new SAPE_client();
?>
<?php
if (eregi("category.php",$PHP_SELF)){
header("Location: index.php?");
exit;
}
$today = date("Ymd");
$result = mysql_query("SELECT * FROM `weeks` WHERE `host` > 0 and `date`=".$today.""); // TEST
$count = mysql_num_rows($result);
$result666 = mysql_query("SELECT count(`uid`) FROM `weeks` WHERE `host` > 0 and `date`=$today"); // TEST
$cntData666 = mysql_fetch_row($result666); // TEST
$count_users666 = $cntData666[0]; // TEST
echo "<tr><td><a class=\"icolink\" href=\"/html".$categorii[0]."/\"><b>TOP-100</b></a></td></tr>\n";
$zend=20;
$query = "SELECT * FROM `cat` ORDER BY `id`";
$result = mysql_query($query) or die("Query failed");
for ($i=0; $i <= mysql_num_rows($result) - 1; $i++) {
if (!mysql_data_seek($result, $i)) {
echo "Cannot seek to row $i\n";
continue;
}
if(!($row = mysql_fetch_object($result)))
continue;
$zend--;
if($zend==0) break;
$idurl = $row->id;
$name = $row->name;
//$rez=mysql_query ("select * from users where cat_id='".$idurl."'"); // TEST
$rez = mysql_query("SELECT * FROM `weeks` WHERE `host` > 0 and cat_id=".$idurl." and `date`=".$today."");
$count = mysql_num_rows($rez);
$txt="<tr><td> <span style=\"color:#724a91\">»</span> <a href=\"/html".$categorii[$idurl]."/\">".$name."</a> <span style=\"color:#724a91\">(".$count.")</span></td></tr>\n";
echo $txt;
}
// вывод буфера
ob_end_flush();
echo $sape->return_links(5);
?>