View file public_html/news/index.php

File size: 1.35Kb
<?php
include"config.inc.php";
$date = date("d.m.Y, H:i:s", time());

include"../header.php";
print'<div class=b1>Новости сайта MotoFan.pp.ru</div>';
include"../book/in.php";
print'<div class=b3><p align="center"><b>'.$date.'</b><br/></div><div class=b1><big>Новости:</big></p></div><div class=b2>
';

$xfile = @file("../data/news.txt");

$p = "$p";
if ($npage == ""){$npage = "1";}
$first = count($xfile) - ($p * ($npage - 1));
$second = count($xfile) - ($p * $npage) + 1;
if ($second < 1) {$second = 1;}
$npages = (int)(count($xfile) / $p);
if ($news_limiter>((int) ($npages*$p))) $npages = $npages+1;
if ($npage <= $npages and $npage>1)

$gline_rew = "<a href=\"index.php?npage=".($npage-1)."\">Назад</a>";
if ($npages > 1 and $npage<$npages)

$gline_next = "<a href=\"index.php?npage=".($npage+1)."\">Вперед</a>";
$line = " | ";

for ($p = 1; $p <= $npages; $p++) {
if ($p != $npage) { $line .= "<a href=\"index.php?npage=$p\"> $p </a>|";}
if ($p == $npage) { $line .= "$p |"; }
}

for ($i = $first-1; $i >= $second-1; $i--) {
$ii = $i;
$ii++;
$udata = explode(":ll:",$xfile[$i]);
print "<small><b>$udata[0]</b></small><br/><small>$udata[1]</small><br/><br/>";
}
print "<hr color=\"'.$tcolor.'\">";
print "<a href=\"../index.php\">На главную</a><br/>";
include"../footer.php";
print "</body></html>";
?>