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

Размер файла: 2.05Kb
<?php
//   X-Thief ICQ: 917-353
//   [email protected]
//   wap.telon.ru - Бесплатные загрузки, каждый день!
require ("ini.php");
if($par==$parol){
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><div class="copyright">';
print "<a href=\"adminnewsadd.php?par=$parol\">Добавить новость</a><br/></div>";print '<div class="body">';
$zapros="SELECT * 
FROM `news_index` 
ORDER BY `time` DESC";
$result=mysql_query($zapros) or die(mysql_error());
$onl=mysql_num_rows($result);
$kolstr=ceil($onl/$newspage); 
if (!@$page)
$page=0;
$pg=$page+1;
####################################################################################################
$start=$page*$newspage;
$end=$start+$newspage;
@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);}
$news['news']=str_replace('<a href="', '[', $news['news']);
$news['news']=str_replace('">', '*', $news['news']);
$news['news']=str_replace('</a>', ']', $news['news']);
print "<b>$date</b><br/>
<form action=\"newsizm.php?par=$parol&amp;time=$news[time]\" method=\"post\">
<textarea name=news rows=5>$news[news]</textarea><br/>
<input type=\"submit\" value=\"Изменить\"></form>
<a href=\"admindelnews.php?par=$parol&amp;time=$news[time]\">DEL</a>|<a href=\"adminkomm.php?par=$parol&amp;time=$news[time]\">Коментарии</a><br/>";
$start++;
if ($start>=$end)
break;
}
if ($kolstr>$page+1){
print '<a href="adminnews.php?page='.$pg.'&amp;par='.$parol.'">Вперед</a><br/>';}
if ($page>0)
{$pp=$page-1;
print '<a href="adminnews.php?page='.$pp.'&amp;par='.$parol.'">Назад</a><br/>';}}
else{print "X-Thief<br/>
<a href=\"http://wap.telon.ru\">wap.telon.ru</a>";}
print $footer;
?>