View file newsub/index.php

File size: 1.49Kb
<?php
//   X-Thief ICQ: 4644864
//   [email protected]
//   wap.telon.ru - Бесплатные загрузки, каждый день!
require ("ini.php");
header("Cache-Control: no-cache");
header("Content-type:text/html; charset=utf-8");
print '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Новости</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body>';
$news=mysql_fetch_row(mysql_query("SELECT count(*) from `news_index"));
if($news[0])
print '<div class="copyright">Новостей: '.$news[0].'</div><div class="upban">
<a href="mail.php">Подписаться на рассылку</a><br/><div class="body">';
$kolchel=$newspage;
$zapros="select * from news_index";
$zapros=$zapros." ORDER BY `time` DESC";

$result=mysql_query($zapros);
$kolstr=ceil(mysql_num_rows($result)/$kolchel); 
if (!@$page)
$page=0;
$pg=$page+1;
$start=$page*$kolchel;
$end=$start+$kolchel;
@mysql_data_seek($result,$start);
while($news=mysql_fetch_array($result))
{$date=date("d.m H:i",$news['time']);

print "<br/><b>$date</b><br/>
$news[news]<br/>";
$start++;
if ($start>=$end)
break;
}
print '<div class="downban">';
if ($kolstr>$page+1){
print '<a href="index.php?page='.$pg.'&amp;cl='.$ses.'&amp;str='.$str.'">Далее</a><br/>';}
if ($page>0)
{$pp=$page-1;
print '<a href="index.php?page='.$pp.'&amp;sid='.$ses.'&amp;str='.$str.'">Назад</a><br/>';}
print '</div>';
print $footer;
?>