Размер файла: 2.88Kb
<?php
require ("cfg.php");
if(isset($id)&&isset($in)){
$id=intval($id);
$in=coding_cool($in);
$ipss = getenv('REMOTE_ADDR');
$q=mysql_query("select * from `cool_pro` where id='$id' and locate(lower('$ipss'),lower(ip))>0;");
$rows=mysql_num_rows($q);
$q=mysql_query("select * from `cool_pro` where id='$id' and `in`='$in';");
$rowb=mysql_num_rows($q);
if($rows>1&&$rowb>1){
$q = @mysql_query("select * from `cool_site` where id='$id';");
$data = @mysql_fetch_array($q);
$counter = $data['counter']+1;
@mysql_query("update `cool_site` set counter='$counter' where id='$id';");
@mysql_query("update `cool_pro` set `in`='5' where `in`='$in';");
$coolip=$ipss.".555";
@mysql_query("delete from `cool_pro` where ip='$coolip';");}}
header ("Content-type:text/vnd.wap.wml; charset=utf-8");
$content = file("content.txt");
$contentrandom = rand(0, sizeof($content)-1);
$contentrandom2 = rand(0, sizeof($content)-1);
$contentrandom3 = rand(0, sizeof($content)-1);
while($contentrandom == $contentrandom2){$contentrandom2 = rand(0, sizeof($content)-1);}
while($contentrandom == $contentrandom3||$contentrandom2 == $contentrandom3){$contentrandom3 = rand(0, sizeof($content)-1);}
$contcool = "$content[$contentrandom]$content[$contentrandom2]$content[$contentrandom3]";
print "<?xml version=\"1.0\" encoding=\"utf-8\"?>
<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"
\"http://www.wapforum.org/DTD/wml_1.1.xml\">
<wml><head><meta http-equiv=\"Cache-Control\" content=\"no-cache\" forua=\"true\"/></head>
<card title=\"Каталог\"><p align=\"left\">
<small>Каталог<br/><b>http://42rus.org</b><br/>
$contcool---<br/>
»<a href=\"section.php\">Лучшие сайты</a><br/>---<br/>";
$countiz=0;
$countv=0;
$pri=mysql_query("select * from `cool_site` where activ='1'");
while($data=mysql_fetch_array($pri)){
$countiz=$countiz+$data['outcounter'];
$countv=$countv+$data['counter'];}
$q=mysql_query("select * from `cool_raz` where 1 order by por asc");
while($data = @mysql_fetch_array($q)){
$catid=$data['id'];
if($active_site==1){
$qs=@mysql_query("select count(*) from `cool_site` where category='$catid' and activ='1' and counter>'0';");}else{
$qs=@mysql_query("select count(*) from `cool_site` where category='$catid' and activ='1';");}
$i=@mysql_fetch_array($qs);
print "»<a href=\"section.php?c=$catid\">".$data['text']."(".$i['count(*)'].")</a><br/>";
unset($catid);unset($qs);unset($i);}
print "<br/>Сегодня переходов:<br/>
Из каталога: <b>$countiz</b><br/>
В каталог: <b>$countv</b><br/>
---<br/>";
print "»<a href=\"rules.php\">Регистрация</a><br/>
»<a href=\"auth.php\">Изменить сайт</a><br/>
»<a href=\"search.php\">Поиск по каталогу</a><br/>---<br/>
<a href=\"http://42rus.org/\">©</a> 42rus.org<br/>";
require ("online.php");
print "</small></p></card></wml>";
?>