Просмотр файла newsub/index.php

Размер файла: 1.73Kb
<?php
//   X-Thief ICQ: 917-353
//   [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"));
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))
{
if($sdvig==""){
$date=date("d.m H:i",$news['time']);}else{
$date=date("d.m H:i",$news['time']+3600*$sdvig);}
$komm=mysql_fetch_row(mysql_query("SELECT count(*) from `news_komm` WHERE `time`='$news[time]'"));
if(!$komm)
$komm=0;
print "<b>$date</b><br/>
$news[news]<br/>
<a href=\"komm.php?time=$news[time]\">Коментарии ($komm[0])</a><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;
?>