Файл: index.php
Строк: 94
<?php
session_start();
define('NTOP', 1);
$title = 'Главная';
require_once ('system/connect.php');
require_once ('system/core.php');
require_once ('system/function.php');
require_once ('m/head.php');
$posl_news = mysql_query("SELECT * FROM `".$prefix."news` ORDER BY `time` DESC LIMIT ".$set['news_index']."");
if(mysql_num_rows($posl_news) > 0)
{
while($row = mysql_fetch_array($posl_news))
{
$rat_plus = mysql_num_rows(mysql_query("SELECT * FROM `".$prefix."news_rep` WHERE `id_news` = '".$row['id']."'"));
$proverka = mysql_num_rows(mysql_query("SELECT * FROM `".$prefix."news_rep` WHERE `ip` = '".$ip."' AND `id_news` = '".$row['id']."'"));
$page = ceil(mysql_result(mysql_query("SELECT COUNT(*) FROM `".$prefix."news` WHERE `id` = '".$row['id']."'"), 0) / $page_news);
$comm_count = mysql_num_rows(mysql_query("SELECT * FROM `".$prefix."news_comments` WHERE `id_news`='".$row['id']."'"));
echo '<div class="topni">';
echo '<a href="http://'.$set['home'].'/m/news/'.$page.'"><font color="#696969"><b><span class="o">'.$row['name'].'</span></b></font></a> ['.data($row['time']).']<br/>';
echo '</div>';
echo '<div class="main">';
if(mb_strlen($row['text']) > 100)
{
$text = mb_substr($row['text'],0,100);
echo ''.$text.'.... <a href="http://'.$set['home'].'/m/news/'.$page.'">подробнее</a><hr>';
}
else
{
echo ''.$row['text'].'<hr>';
}
echo '<span class = "gray" style="float:right"><a style="margin-right: 9px"><a href="http://'.$set['home'].'/m/news/comments/'.$row['id'].'">Комментарии</a> ['.$comm_count.']</span>';
if($proverka == 0){
echo ' <a class="nr" href="http://'.$set['home'].'/m/news/like1/'.$row['id'].'">Мне нравится: +<b>'.$rat_plus.'</b></a></div>';
} else {
echo ' <a class="nr" href="http://'.$set['home'].'/m/news/like0/'.$row['id'].'">Мне нравится: +<b>'.$rat_plus.'</b></a></div>';}
echo '</div>';
echo '</div>';
}
}
$vse_sait = mysql_num_rows(mysql_query("SELECT * FROM `".$prefix."sait` WHERE `status` = '1' AND `hosts` > '0'"));
echo '<div id="categories"><b>Топ: '.$vse_sait.'</b></div>';
echo '<div class="topni"><center>[<a href="http://'.$set['home'].'/m/search"><b>Поиск сайтов</b></a> | <a href="http://'.$set['home'].'/servise"><b>Сервисы</b></a>]</center></div>';
$all = mysql_num_rows(mysql_query("SELECT * FROM `".$prefix."sait` WHERE `status` = '1' AND `ban` = '0' AND `hosts` > '0'"));
if($all != 0)
{
$total=intval(($all-1)/$page_top)+1;
$page=abs(intval($_GET['page']));
if(empty($page) OR $page < 0)
{
$page = 1;
}
if($page > $total)
{
$page = $total;
}
$past=intval($all/$page_top);
$start=$page*$page_top-$page_top;
$top = mysql_query("SELECT * FROM `".$prefix."sait` WHERE `status` = '1' AND `ban` = '0' AND `hosts` > '0' ORDER BY `hosts` DESC LIMIT ".$start.",".$page_top."");
while($row = mysql_fetch_array($top))
{
$start++;
echo '<div class="topni"><span class="o">'.$start.'</span> <img src="http://www.google.com/s2/favicons?domain='.$row['url'].'"/> <a href="http://'.$set['home'].'/out/'.$row['id'].'"> '.$row['name'].'</a> ['.$row['hosts'].'/'.$row['hits'].'] <a href="http://'.$set['home'].'/stats/'.$row['id'].'"><img src="/img/index/s.gif" alt="?"></a><br/>';
if(mb_strlen($row['about']) > 100)
{
$text = substr($row['about'],0,100);
echo ''.$text.'...<br/>';
}
else
{
echo ''.$row['about'].'<br/></font></b></u>';
}
echo '</div>';
echo '<div class="topni">[В топ: <b>'.$row['in'].'</b> | Из топа: <b>'.$row['out'].'</b>]</div>';
}
///////////////////////////////
$new_sait = mysql_query("SELECT * FROM `".$prefix."sait` WHERE `status` = '1' AND `ban` = '0' ORDER BY `id` DESC LIMIT 1");
$new_sait_check = mysql_num_rows($new_sait);
$nsait = mysql_fetch_array($new_sait);
$new = ($new_sait_check > 0) ? '<a href = "http://'.$set['home'].'/stats/'.$nsait['id'].'">'.$nsait['name'].'</a>' : 'Нет';
echo '<div class="topni">Последний сайт: '.$new.'</div>'; echo '<div class="topni">'; require_once ('m/includ/izmir.php'); echo '</div>';
/////////////////////////////////////////////////////////////
navigation($all,$page_top,$page,'/',$total);
}
else
{
echo '<div class="topni">';
echo 'Сайтов учавствующих в Топ-100 не обнаружено!';
echo '</div>';
}
unset($_SESSION['id']);
require_once ('m/foot.php');
?>