Размер файла: 917B
<?php
if ($mode=='zn_news') {
$p=@intval($_GET['p']);
$sql = mysql_query("SELECT *, DATE_FORMAT(date, '%d.%m.%y') AS sdate FROM zn_news ORDER BY date DESC LIMIT $p,$mesonpage");
if(mysql_affected_rows() == 0)
{
echo("Новостей нет.<br/>");
}
echo "<b>Новости</b><br/>";
echo "</div><div class=\"b\">";
while($news = mysql_fetch_array($sql))
{
echo "<b>".$news['sdate']."</b><br/>";
echo "".$news['text']."<br/>";
echo "</div><div class=\"b\">";
}
$next = $p+$mesonpage;
$prev = $p-$mesonpage;
if ($p>0) {
echo "<a href=\"$workdir/?mode=zn_news&p=$prev\">Назад</a>";
}
list($c)=mysql_fetch_row(mysql_query("SELECT COUNT(*) FROM zn_news WHERE id"));
if ($p+$mesonpage<$c) {
echo " <a href=\"$workdir/?mode=zn_news&p=$next\">Далее</a><br/>";
}
echo "</div><div class=\"b\">";
echo "» <a href=\"$workdir/?mode=menu\"><b>Меню</b></a>";
}
?>