Вход Регистрация
Файл: nwspp.php
Строк: 88
<?
header
('Cache-Control: no-store, no-cache, must-revalidate');
if (
$ver=="wml")header ("Content-type:text/vnd.wap.wml; charset=utf-8");
else 
header("Content-Type:text/html; charset=UTF-8");

require(
"inc.php"); 
$link connect_db();
list(
$row$id$ps$fsize1$fsize2) = check_login($link); 
require(
"version.php");

$mid intval($mid);

switch(
$mod) {

case 
'gaz':
$q=@mysql_query("select title,content,organizatory,login,date from gaz where id='$mid';");
$arr=@mysql_fetch_array($q);
if (
$ver=="wml"){
echo 
$xml;
echo 
$dtd;
echo 
"<wml>n";
echo 
"<card title="".$arr['date']."">n";
echo 
"<p align="center">n";
}else{
echo 
"<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">";
echo "<html xmlns="http://www.w3.org/1999/xhtml">";
echo "<head><link rel="stylesheet" type="text/css" href="css/css.css"/>";
echo 
"<title>".$arr['date']."</title>";
echo 
"<meta http-equiv="Content-Type" content="text/htmlcharset=utf-8"/></head><body>";
echo 
"<div align="center">";
}
        echo 
$fsize1;
        echo 
"<b>".$arr['title'];
        echo 
"</b><br/><b>Дата</b> ".$arr['date']."<br/>".$arr['content'];
        echo 
"";
        if (
$arr['organizatory']!='') echo "<br/><b>Автор(ы):</b> ".$arr['organizatory']."";
        echo 
"<br/><b>Разместил(a):</b> ".$arr['login'];
        echo 
"<br/>$divide";
        echo 
$fsize2;
break;


default:
$userm mysql_query ("select count(id) as num from gaz;");
$usm mysql_fetch_array($userm);
$num $usm["num"]; 
if(!isset(
$s))$s=0;
$mx=round(($num/10)+0.45);
if(
$s>$mx)$s=$mx;
if(
$s==0)$s=1;
$ot=(($s-1)*10)+1;
$do=$s*10;
if(
$do>$num)$do=$num;
$o=$ot-1;
$n=$ot;
if(
$do==0)$n=$o;
if (
$ver=="wml"){
echo 
$xml;
echo 
$dtd;
echo 
"<wml>n";
echo 
"<card title="Газета($n-$do)">n";
echo 
"<p align="center">n";
}else{
echo 
"<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">";
echo "<html xmlns="http://www.w3.org/1999/xhtml">";
echo "<head><link rel="stylesheet" type="text/css" href="css/css.css"/>";
echo 
"<title>Газета($n-$do)</title>";
echo 
"<meta http-equiv="Content-Type" content="text/htmlcharset=utf-8"/></head><body>";
echo 
"<div align="center">";
}
echo 
$fsize1;
$q=mysql_query("select id,title,date from gaz order by id desc limit $o,$do;");
if (
mysql_affected_rows() == 0) {
echo 
"<b>Газета пуста...</b><br/>";
}
for (
$i=$ot;$i<=$do;$i++){
while(
$arr=mysql_fetch_array($q)) {
echo 
"<a href="nwspp.php?$ses&amp;mid=".$arr['id']."&amp;mod=gaz&amp;ref=$ref">(".$arr['date'].") ".$arr['title']."</a><br/>"
}
}
echo 
$divide;
$next=$s+1;
$prev=$s-1;
if (
$num>$do) {
$ot=(($next-1)*10)+1;
$do=$next*10;
if(
$do>$num)$do=$num;
echo 
"<a href="nwspp.php?$ses&amp;s=$next&amp;ref=$ref">($ot-$do) &#8594;</a><br/>n";
}
if(
$s>1) {
$ot=(($prev-1)*10)+1;
$do=$prev*10;
echo 
"<a href="nwspp.php?$ses&amp;s=$prev&amp;ref=$ref">&#8592; ($ot-$do)</a><br/>n";
}
echo 
$fsize2;
break;
}
echo 
$fsize1;
if(
$mod) {
echo 
"<a href="nwspp.php?$ses&amp;ref=$ref">&#8592; Газета</a><br/>";
}
echo 
"<a href="cabinet.php?$ses&amp;ref=$ref">&#8592; Личное</a><br/>";
echo 
"<a href="enter.php?$ses&amp;ref=$ref">&#8592; На улицу</a>";
echo 
$fsize2;
if (
$ver=="wml")echo "</p></card></wml>";
else echo 
"</div></body></html>";
mysql_close($link);
?>
Онлайн: 0
Реклама