View file o5on.ru/xhtml/category.php

File size: 1.94Kb
<?php
include '../inc/config.inc.php';
include '../inc/wap_tags.inc.php';
include '../inc/functions.inc.php';
connect_to_db();
	include "config.php";
    include './inc/head.php';



			// ------------------------------ Категории каталога -------------------------------
			$today  = date("Ymd");

echo "<div class=\"rh\">Категории</div>\n";

$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." AND `cat_id` != '3' AND `cat_id` != '4';");  // TEST
//            $cntData666 = mysql_fetch_row($result666);  // TEST
//            $count_users666 = $cntData666[0];  // TEST

//echo "<div class=\"rb\"><a href=\"/xhtml".$categorii[0]."/\">TOP-100</a> (".$count_users666.") <br/>\n";  // TEST
echo "<div class=\"rb\"><a href=\"/xhtml".$categorii[0]."/\">TOP-100</a><br/>\n";  // TEST
$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="&#187; <a href=\"/xhtml".$categorii[$idurl]."/\">".$name."</a> (".$count.")<br />";
echo $txt;
}
echo "</div>";

echo "<div class=\"rh\">
<a href=\"/xhtml/stat/1/\">Статистика рейтинга</a><br />
<a href=\"/xhtml/reg.xhtml\">Регистрация</a><br />
</div>\n";


include "./inc/foot.php";

ob_end_flush();
?>