Файл: sumerki.mobi/sumerki.mobi/news.php
Строк: 53
<?php
//////////////////////////////////////////////////////////////
//////////////////////Онлайн игра "Сумерки"///////////////////
//////////////////////Основатель: Mc Laren////////////////////
///////////////////Контакты: ICQ - 597687549//////////////////
/////////////////////Пример: Sumerki.Mobi/////////////////////
///////////Если ты это читаешь, значит скрипт слили :D////////
//////////////////////////////////////////////////////////////
define('PROTECTOR', 1);
$headmod = 'news';//фикс. места
$textl='Новости';
include('files/path.php');
include($path.'files/db.php');
include($path.'files/auth.php');
include($path.'files/func.php');
include($path.'files/core.php');
include($path.'files/head.php');
include($path.'files/zag.php');
switch($_GET[mod]){
default:
echo '<div class="zagolovok"><div class="zagolovok1"> <div class="zagolovok2"><div class="zagolovok_right"></div><div class="zagolovok_left"></div><div class="ch_name">';
echo 'Новости';
echo '</div><div class="clearFix"></div></div></div></div>';
if ($_GET[page] == "" || $_GET[page] < 0 || $_GET[page] == "0")
{
$_GET[page] = 0;
}
$next = $_GET[page] + 1;
$back = $_GET[page] - 1;
$num = $_GET[page] * 5;
if($_GET[page] == "0")
{$i = 1;}
else{$i = ($_GET[page]*5)+1;}
$viso = mysql_num_rows(mysql_query("SELECT text FROM news"));
$puslap = floor($viso/5);
if (is_double($num) || !is_integer($num))
{
echo "Ошибка!<br/>";
}
else {
$asd = mysql_query("SELECT id, nick, text, time FROM news ORDER BY id DESC LIMIT $num,5");
while($dsa = mysql_fetch_array($asd))
{
$i2 = $i++;
$nick = strip_tags($dsa['nick']);
$text = strip_tags($dsa['text']);
$time = strip_tags($dsa['time']);
$req = mysql_query("SELECT `storona`,`prava` FROM `users` WHERE `usr` = '$nick'");
$pic = mysql_fetch_array($req);
echo '<div class="fon bgray"><div class="bg1"><div class="bg2"><div class="bg3"><div class="bg4"><div class="bg5"><div class="bg6"><div class="bg7"><div class="bg8">';
echo'<img src="pic/main/'.$pic['storona'].'.png" alt="#"/>'; echo " <a href="search.php?nick=$nick&go=go">$nick</a>";
if($pic['prava']==5){
echo'<font color="lime">.GM</font>';
}
if($udata['prava']==5)
{
}
$req = mysql_query("SELECT `storona`,`prava` FROM `users` WHERE `usr` = 'log'");
echo " $id<b>[$time]</b><br/>$dsa[text]<br/><div class='buuut'><img src='pic/main/pero.gif' alt='*'/> <a href="news_comm.php?id=$dsa[id]">Обсудить</a> (".mysql_result(mysql_query("SELECT COUNT(*) FROM `news_komm` WHERE `id_news` = '$dsa[id]'"),0).")</div>";
echo '</div></div></div></div></div></div></div></div></div>';
}
if ($_GET[page] > 0)
{
echo "<h1><a href="news.php?page=$back"><img src='pic/ico/left_ico.png' alt='*'/></a>";
}
elseif ($_GET[page] == 0)
{
echo "<h1><img src='pic/ico/left_ico.png' alt='*'/>";
}
echo" ";
if($_GET[page] < $puslap || $_GET[page] == "" || $_GET[page] == 0)
{echo "<a href="news.php?page=$next&"><img src='pic/ico/right_ico.png' alt='*'/></a></h1>";}
else
{echo "<img src='pic/ico/right_ico.png' alt='*'/></h1>";}
}
break;
case 'trinti':
if($udata[prava] >= 2)
{
}
else
{
echo "Ошибка!Доступ закрыт!<br/>";
}
break;
}
include($path.'files/down.php');
include($path.'files/meny.php');
echo "</div>";
?>