Вход Регистрация
Файл: top20.php
Строк: 67
<?php
##########################################################
#               За дополнениями обращайтесь:             #
#                     icq 449-424-588                    #
#                 email: Dimonnet@inbox.ru               #
##########################################################
#          coding by ___хакер___ (MaZaFaKa)              #
##########################################################
# запрещено распространять каталог без согласия автора!!!#
##########################################################
include "inc.php";
include 
"head.php";
print 
"<div align="center"><div class=a>";
$today date("d-m-Y");
$rs = @mysql_query("select `cid` from `logs` where `day`='$today' and `ci`='$ci';");
    if (@
mysql_num_rows($rs) == 0)
{
@
mysql_query("truncate table `logs`;");
    @
mysql_query("update `users` set `from`='0', `in`='0';");
    }
if (!empty(
$id))
{
$ip getenv(REMOTE_ADDR);
    
$rf = @mysql_query("select `cid` from `logs` where `ip`='$ip' and `type`='in' and `day`='$today' and `cid`='$id' and `ci`='$ci';");
    if (@
mysql_num_rows($rf) == 0)
    {
        
$count = @mysql_query("select `in` from `users` where `id`='$id' and `activ`='yes' and `ci`='$ci';");
        
$its = @mysql_fetch_array($count);
        
//Если сайт неактивен то не захламляем логи
        
if (@mysql_num_rows($count) !== 0)
        @
mysql_query("insert into `logs` values(0,'$ip','in','$today','$id','$ci');");
        
$new $its['in']+1;
        @
mysql_query("update `users` set `in`='$new' where `id`='$id' and `activ`='yes' and `ci`='$ci';");
    }
}

print 
"<div class=b>";
print 
"<div style="text-aligncenter">
<div class="
contur_rek"><div class="header_rek"><b>Топ 20</b></div></div></div>";
print 
"</div>";
$sites = @mysql_query("select `url`, `sname`, `about`, `from`, `in` from `users` where `activ`='yes' and `ci`='$ci' order by `from` desc limit 20;");
print 
"<div align="left">";
if(
mysql_affected_rows()==0)
print 
"<font color="#FF0000">Категория пуста!<br/></font>";
while($sp = @mysql_fetch_array($sites))
{
    
$num $num+1;     print "<div class="contur"><div class="header"><b><a href="go.php?ci=$ci&amp;st=$st&amp;url=".$sp['url']."">&#9679; $num. ".$sp['sname']."</a></b><br/>";
    print 
"<small>&#8594; ".$sp['about']."</small><br/>";
    print 
"Ушло: ".$sp['from'].", Пришло: ".$sp['in']."</div></div>";
}

print 
"<a href="registration.php?ci=$ci&amp;st=$st">&#8594; Регистрация</a><br/>";
print 
"<a href="index.php?ci=$ci&amp;st=$st">&#8594; К категориям</a>";
include 
"foot.php";
print 
"</div>";
echo 
"</body></html>";
?>
Онлайн: 2
Реклама