$ddate

\n\n$title

\n\n $news\n

\n"; echo $print; echo "



Предыдущие новости:

    "; if (empty($offset)) { $offset=1; } $result = mysql_query("select count(id) from $table where approved = 'Y'"); $numrows = mysql_result($result, 0, 0); $result = mysql_query("select * from $table where approved = 'Y' order by date DESC limit $offset,20"); while (list($id,$title,$date,$poster,$mail,$news) = mysql_fetch_row($result)) { $d = explode("-",$date); $day = $d[2]; $month = $d[1]; $year = $d[0]; $hour = $d[3]; $min = $d[4]; $thedate = "$day.$month.$year - $hour:$min"; $ddate = "$day.$month.$year"; $print = "
  • $ddate
    $title

    \n"; echo $print; } echo "

"; mysql_close(); /* pages echo"

"; $pages=intval($numrows/$limit); if ($numrows%$limit) { $pages++; if($pages > $limit){ echo""; } } if ($offset != 0) { $prevoffset=$offset-$limit; echo "\n"; } if ( $pages != 1 ) { for ($i=1;$i<=$pages;$i++) { $newoffset=$limit*($i-1); if ( ((($offset)/$limit)==($i-1)) ) { echo "\n"; } else { echo "\n"; } } } if (!((($offset)/$limit)+1==$pages) && $pages!=1) { $newoffset=$offset+$limit; echo "\n"; } echo"
Более ранние  $i   $i Более свежие
"; */ } else { $result = mysql_query("select count(date) from $table order by date DESC"); $numrows = mysql_result($result, 0, 0); $result = mysql_query("select * from $table where id = '$id'"); while (list($idd,$title,$date,$poster,$mail,$news,$featured,$appr) = mysql_fetch_row($result)) { if ($appr != "Y") {die("Permission denied.");} $d = explode("-",$date); $day = $d[2]; $month = $d[1]; $year = $d[0]; $hour = $d[3]; $min = $d[4]; $thedate = "$day.$month.$year - $hour:$min"; $ddate = "$day.$month.$year"; $news = nl2br($news); $print = "$ddate

$title

\n\n $news\n
\n"; echo $print; echo "


\n\n <<  Вернуться к оглавлению"; } } ?>