View file news.php

File size: 1.59Kb
<?
session_start();
$title="Новости\n";
include ("header.php");
//include ("aut.php");
echo $div["ten"];
if(empty($startan)) $startan = 0;
$startan=intval($startan);
if($startan<0) $startan=0; $num_msgs_an=10;
$arr = mysql_query("select * from `news`");
$qi = mysql_query("select * from `news` order by `id` desc limit $startan,$num_msgs_an;;");
           if (mysql_affected_rows()==0)
           {
           echo "Новостей пока нет...<br/>";
           }
           else
           {
while($row=mysql_fetch_array($qi))
{
echo "<b>".$row['date']."</b><br/>".$row['msg']."<br/>";
$d=$row['id'];
$q=mysql_query("select * from `news_com` where `nid`='$d'");
$xx=mysql_num_rows($q);
echo '<a href="mnenie.php?ide='.$row['id'].'&amp;'.session_name()."=".session_id().'">Комментарии</a> [';
echo $xx;
echo "]<br/>";
}
           }
$i = @mysql_num_rows($arr);
if($startan!=0)
echo "<a href=\"news.php?".session_name()."=".session_id()."&amp;startan=".($startan-$num_msgs_an)."\">".htmlspecialchars("<<-- Предыдущая")."</a><br/>";
if($i>$startan+$num_msgs_an)
echo "<a href=\"news.php?".session_name()."=".session_id()."&amp;startan=".($startan+$num_msgs_an)."\">".htmlspecialchars("Следующая -->>")."</a><br/>";;
if ($autorize) {echo "<img src=\"pics/st.gif\" alt=\"*\"/>";echo "<a href=\"enter.php?".session_name()."=".session_id()."\">Панель</a><br/>";}
else {echo "<img src=\"pics/st.gif\" alt=\"*\"/>";echo "<a href=\"index.php?".session_name()."=".session_id()."\">Назад</a><br/>";}
echo $div["end"];
include ("footer.php");
?>