File size: 1.68Kb
<?
session_start();
$title="Новости\n";
include ("header.php");
//include ("aut.php");
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))
{
if ($_SESSION['wap']=="xml")print '<div class="contur"><div class="header">';
echo "<b>".$row['date']."</b><br/>".$row['msg']."<br/>";
$d=$row['id'];
if ($_SESSION['wap']=="xml")print '</div></div>';
}
}
$i = @mysql_num_rows($arr);
if($startan!=0)
echo "<a href=\"news.php?".session_name()."=".session_id()."&startan=".($startan-$num_msgs_an)."\">".htmlspecialchars("<<-- Предыдущая")."</a><br/>";
if($i>$startan+$num_msgs_an)
echo "<a href=\"news.php?".session_name()."=".session_id()."&startan=".($startan+$num_msgs_an)."\">".htmlspecialchars("Следующая -->>")."</a><br/>";;
if ($autorize) {
if ($_SESSION['wap']=="xml")print '<div class="contur"><div class="header">';
echo "<img src=\"pics/st.gif\" alt=\"*\"/>";
echo "<a href=\"enter.php?".session_name()."=".session_id()."\">Панель</a><br/>";
if ($_SESSION['wap']=="xml")print '</div></div>';
}
else {
if ($_SESSION['wap']=="xml")print '<div class="contur"><div class="header">';
echo "<img src=\"pics/st.gif\" alt=\"*\"/>";
echo "<a href=\"index.php?".session_name()."=".session_id()."\">Назад</a><br/>";
if ($_SESSION['wap']=="xml")print '</div></div>';
}
include ("footer.php");
?>