<?php
error_reporting(0);
$tmp=explode(':',$_SERVER['QUERY_STRING']);
$catalog=$tmp[0];
$page=$tmp[1]+0;
if ($page<1) $page=0;
include($rootpath."function.inc");
define("DBName","kmx");
define("HostName","localhost");
define("UserName","kmx");
define("Password","kmx-hosting");
$connectserv=@mysql_connect(HostName, UserName, Password);
$selectDB=@mysql_select_db(DBName);
$connect_bd=(($connectserv!=0)&&($selectDB!=0));
if (!$connect_bd) include($rootpath."mysqlerror.php");
Header("Content-type:text/vnd.wap.wml; charset=Utf-8");
Header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
Header("Cache-Control: no-cache, must-relative");
$head='<?xml version="1.0" encoding="Utf-8"?><!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.2//EN" "http://www.wapforum.org/DTD/wml_1.2.xml"><wml>';
print $head.cyr2utf('<card id="main" title="Каталог-KMX.Ru"><p align="center"><b>Каталог');
switch ($catalog)
{
case 'rekommend':$catalog2=$catalog; $title='KMX.Ru рекоммендует'; break;
case 'all': $catalog2=$catalog; $title='Разное'; break;
case 'person': $catalog2=$catalog; $title='Персональные'; break;
case 'music': $catalog2=$catalog; $title='Музыка'; break;
case 'sport': $catalog2=$catalog; $title='Спорт'; break;
case 'polit': $catalog2=$catalog; $title='Политика'; break;
case 'kommerce':$catalog2=$catalog; $title='Коммерция'; break;
case 'download':$catalog2=$catalog; $title='Загрузки'; break;
case 'happy': $catalog2=$catalog; $title='Развлечения'; break;
case 'iskust': $catalog2=$catalog; $title='Искуство'; break;
case 'erotic': $catalog2=$catalog; $title='Эротика'; break;
case 'video': $catalog2=$catalog; $title='Видео'; break;
case 'biznes': $catalog2=$catalog; $title='Бизнес'; break;
case 'gorod': $catalog2=$catalog; $title='Города'; break;
case 'dosug': $catalog2=$catalog; $title='Досуг'; break;
case 'master': $catalog2=$catalog; $title='WAP-мастеру'; break;
case 'links': $catalog2=$catalog; $title='Ссылки'; break;
case 'comun': $catalog2=$catalog; $title='Общение'; break;
case 'news': $catalog2=$catalog; $title='Новости'; break;
case 'service': $catalog2=$catalog; $title='Сервисы'; break;
case 'info': $catalog2=$catalog; $title='Информация и обзоры'; break;
case '684': $catalog2=$catalog; $title='684-BeeOnLine'; break;
case 'tovar': $catalog2=$catalog; $title='Товары и услуги'; break;
case 'program': $catalog2=$catalog; $title='Програмирование'; break;
case 'religia': $catalog2=$catalog; $title='Религия'; break;
default:
print '</b></p><p>';
$tmp=@mysql_num_rows(@mysql(DBName,"SELECT `login` FROM `sites` WHERE `show` = '1' AND `rekommend` = '1'")); if ($tmp>0) print cyr2utf('<b><a href="?rekommend">KMX.Ru рекомендует('.$tmp.')</a></b><br/>');
$tmp=@mysql_num_rows(@mysql(DBName,"SELECT `login` FROM `sites` WHERE `show` = '1' AND `catalog` = 'person'")); if ($tmp>0) print cyr2utf('<a href="?person">Персональные('.$tmp.')</a><br/>');
$tmp=@mysql_num_rows(@mysql(DBName,"SELECT `login` FROM `sites` WHERE `show` = '1' AND `catalog` = 'music'")); if ($tmp>0) print cyr2utf('<a href="?music">Музыка('.$tmp.')</a><br/>');
$tmp=@mysql_num_rows(@mysql(DBName,"SELECT `login` FROM `sites` WHERE `show` = '1' AND `catalog` = 'sport'")); if ($tmp>0) print cyr2utf('<a href="?sport">Спорт('.$tmp.')</a><br/>');
$tmp=@mysql_num_rows(@mysql(DBName,"SELECT `login` FROM `sites` WHERE `show` = '1' AND `catalog` = 'polit'")); if ($tmp>0) print cyr2utf('<a href="?polit">Политика('.$tmp.')</a><br/>');
$tmp=@mysql_num_rows(@mysql(DBName,"SELECT `login` FROM `sites` WHERE `show` = '1' AND `catalog` = 'kommerce'")); if ($tmp>0) print cyr2utf('<a href="?kommerce">Коммерция('.$tmp.')</a><br/>');
$tmp=@mysql_num_rows(@mysql(DBName,"SELECT `login` FROM `sites` WHERE `show` = '1' AND `catalog` = 'download'")); if ($tmp>0) print cyr2utf('<a href="?download">Загрузки('.$tmp.')</a><br/>');
$tmp=@mysql_num_rows(@mysql(DBName,"SELECT `login` FROM `sites` WHERE `show` = '1' AND `catalog` = 'happy'")); if ($tmp>0) print cyr2utf('<a href="?happy">Развлечения('.$tmp.')</a><br/>');
$tmp=@mysql_num_rows(@mysql(DBName,"SELECT `login` FROM `sites` WHERE `show` = '1' AND `catalog` = 'iskust'")); if ($tmp>0) print cyr2utf('<a href="?iskust">Искуство('.$tmp.')</a><br/>');
$tmp=@mysql_num_rows(@mysql(DBName,"SELECT `login` FROM `sites` WHERE `show` = '1' AND `catalog` = 'erotic'")); if ($tmp>0) print cyr2utf('<a href="?erotic">Эротика('.$tmp.')</a><br/>');
$tmp=@mysql_num_rows(@mysql(DBName,"SELECT `login` FROM `sites` WHERE `show` = '1' AND `catalog` = 'video'")); if ($tmp>0) print cyr2utf('<a href="?video">Видео('.$tmp.')</a><br/>');
$tmp=@mysql_num_rows(@mysql(DBName,"SELECT `login` FROM `sites` WHERE `show` = '1' AND `catalog` = 'biznes'")); if ($tmp>0) print cyr2utf('<a href="?biznes">Бизнес('.$tmp.')</a><br/>');
$tmp=@mysql_num_rows(@mysql(DBName,"SELECT `login` FROM `sites` WHERE `show` = '1' AND `catalog` = 'gorod'")); if ($tmp>0) print cyr2utf('<a href="?gorod">Города('.$tmp.')</a><br/>');
$tmp=@mysql_num_rows(@mysql(DBName,"SELECT `login` FROM `sites` WHERE `show` = '1' AND `catalog` = 'dosug'")); if ($tmp>0) print cyr2utf('<a href="?dosug">Досуг('.$tmp.')</a><br/>');
$tmp=@mysql_num_rows(@mysql(DBName,"SELECT `login` FROM `sites` WHERE `show` = '1' AND `catalog` = 'master'")); if ($tmp>0) print cyr2utf('<a href="?master">WAP-мастеру('.$tmp.')</a><br/>');
$tmp=@mysql_num_rows(@mysql(DBName,"SELECT `login` FROM `sites` WHERE `show` = '1' AND `catalog` = 'links'")); if ($tmp>0) print cyr2utf('<a href="?links">Ссылки('.$tmp.')</a><br/>');
$tmp=@mysql_num_rows(@mysql(DBName,"SELECT `login` FROM `sites` WHERE `show` = '1' AND `catalog` = 'comun'")); if ($tmp>0) print cyr2utf('<a href="?comun">Общение('.$tmp.')</a><br/>');
$tmp=@mysql_num_rows(@mysql(DBName,"SELECT `login` FROM `sites` WHERE `show` = '1' AND `catalog` = 'news'")); if ($tmp>0) print cyr2utf('<a href="?news">Новости('.$tmp.')</a><br/>');
$tmp=@mysql_num_rows(@mysql(DBName,"SELECT `login` FROM `sites` WHERE `show` = '1' AND `catalog` = 'service'")); if ($tmp>0) print cyr2utf('<a href="?service">Сервисы('.$tmp.')</a><br/>');
$tmp=@mysql_num_rows(@mysql(DBName,"SELECT `login` FROM `sites` WHERE `show` = '1' AND `catalog` = 'info'")); if ($tmp>0) print cyr2utf('<a href="?info">Информация и обзоры('.$tmp.')</a><br/>');
$tmp=@mysql_num_rows(@mysql(DBName,"SELECT `login` FROM `sites` WHERE `show` = '1' AND `catalog` = '684'")); if ($tmp>0) print cyr2utf('<a href="?684">684-BeeOnLine('.$tmp.')</a><br/>');
$tmp=@mysql_num_rows(@mysql(DBName,"SELECT `login` FROM `sites` WHERE `show` = '1' AND `catalog` = 'tovar'")); if ($tmp>0) print cyr2utf('<a href="?tovar">Товары и услуги('.$tmp.')</a><br/>');
$tmp=@mysql_num_rows(@mysql(DBName,"SELECT `login` FROM `sites` WHERE `show` = '1' AND `catalog` = 'program'")); if ($tmp>0) print cyr2utf('<a href="?program">Програмирование('.$tmp.')</a><br/>');
$tmp=@mysql_num_rows(@mysql(DBName,"SELECT `login` FROM `sites` WHERE `show` = '1' AND `catalog` = 'religia'")); if ($tmp>0) print cyr2utf('<a href="?religia">Религия('.$tmp.')</a><br/>');
$tmp=@mysql_num_rows(@mysql(DBName,"SELECT `login` FROM `sites` WHERE `show` = '1' AND `catalog` = 'all'")); if ($tmp>0) print cyr2utf('<a href="?all">Разное('.$tmp.')</a><br/>');
die('<br/><a href="http://top.kmx.ru/catalog"><img src="http://cnt.kmx.ru/catalog" alt="TOP-KMX.Ru"/></a></p></card></wml>');
}
print cyr2utf('-'.$title.'</b></p><p><small>');
if ($catalog2!='rekommend') $q=@mysql(DBName,"SELECT * FROM `sites` WHERE `show` = '1' AND `catalog` = '$catalog2' ORDER BY `da` DESC LIMIT ".$page.", 11");
else $q=@mysql(DBName,"SELECT * FROM `sites` WHERE `show` = '1' AND `rekommend` = '1' ORDER BY `da` DESC LIMIT ".$page.", 11");
$s=mysql_num_rows($q);
if ($s>10) {$s=10; $npage=true;}
for ($i=0;$i<$s;$i++)
{
$data=@mysql_fetch_array($q);
if (($data['rekommend']==1)&&($catalog2!='rekommend')) $rekom='(!)'; else $rekom='';
print cyr2utf('<br/><b>'.($page+$i+1).'.'.$rekom.' <a href="http://'.$data['login'].'.kmx.ru">'.htmlspecialchars($data['name']).'</a></b><br/>'.htmlspecialchars($data['descr']).'<br/>');
}
print '<br/>';
if ($page>0)
if ($page>10) print cyr2utf('<a href="http://catalog.kmx.ru/?'.$catalog2.':'.($page-10).'">Назад</a>');
else print cyr2utf('<a href="http://catalog.kmx.ru/?'.$catalog2.'">Назад</a>');
if (($page>0)&&$npage) print ' | ';
if ($npage) print cyr2utf('<a href="http://catalog.kmx.ru/?'.$catalog2.':'.($page+10).'">Далее</a><br/>');
else print '<br/>';
if ($catalog2=='rekommend') print cyr2utf('<b><a href="#like">Как они сюда попали...</a></b><br/>');
print cyr2utf('<b><a href="http://catalog.kmx.ru">Все категории</a></b><br/>');
print '<b><a href="http://top.kmx.ru">TOP-KMX.Ru</a></b><br/>';
print '</small>';
if ($catalog=='') print '<a href="http://top.kmx.ru/catalog"><img src="http://cnt.kmx.ru/catalog" alt="TOP-KMX.Ru"/></a>';
print '</p></card>';
if ($catalog2=='rekommend') print cyr2utf('<card id="like" title="Рекомендуются!"><p align="center">'.
'В этот раздел попадают сайты, которые понравились лично нам - администрации '.
'KMX.Ru.<br/>Критерии по которым мы их выбирали очень субъективны, это отнюдь не '.
'количество посетителей и не количество картинок и мелодий на их страницах, '.
'просто НАМ НРАВИТСЯ!<br/>:-)<br/>'.
'<small>(Просьбы, вроде "добавьте нас", успеха не имеют.)</small><br/>'.
'<anchor>назад<prev/></anchor>'.
'</p></card>');
print '</wml>';
exit;
?>