Файл: system/news.php
Строк: 21
<?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)){
$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='title2'>";
echo "Новости";
echo "</div>";
echo "<div class='main'>";
echo "<a href='http://".$set['home']."/modules/news/".$page."'>".$row['name']."</a>";
echo "<br/>";
echo "</div>";
echo "<div class='main'>";
if(mb_strlen($row['text']) > 100){
$text = mb_substr($row['text'],0,100);
echo " ".$text." ";
echo "<a href='http://".$set['home']."/modules/news/".$page."'>";
echo "подробнее";
echo "</a>";
}else{
echo " ".$row['text']." ";
}
echo "</div>";
}
}
?>