Файл: new_fanland/second/main.php
Строк: 110
<?php
###########################
# Данная версия скрипта принадлежит #
# LiraS aka Артур Лукин Иванович #
# Вносить свои изменения крайне #
# запрещенно! #
###########################
function first_page()
{
echo "<div class="main"><div class="in">";
echo "<center><br/>Император: $_GET[usr]<br />n";
pochta();
$u = mysql_fetch_array(mysql_query("SELECT id FROM users WHERE usr = '".mysql_real_escape_string($_GET['usr'])."'"));
$id = $u['id'];
$now = date("Y.m.d");
$times = date("H:i");
echo"-=<b>$now</b>=-<br/>-=<b>$times</b>=-<br/></center>";
$asd = mysql_query("SELECT `time` FROM `news` ORDER BY `id` DESC LIMIT 1");
$news = mysql_fetch_array($asd);
echo '<div class="pt">Информация:</div>';
echo "<a href="news.php?usr=$_GET[usr]&pwd=$_GET[pwd]">Новости</a>[".vremya($news['time'])."]<br/>";
$player_count = mysql_num_rows(mysql_query("SELECT * FROM online WHERE laikas > '$timeout'"));
echo "<a href="main.php?usr=$_GET[usr]&pwd=$_GET[pwd]&id=online">Игроки онлайн</a>[$player_count]<br/>";
echo "<a href="info.php?usr=$_GET[usr]&pwd=$_GET[pwd]">Инфо о $_GET[usr]</a><br/>";
echo "<a href="help.php?usr=$_GET[usr]&pwd=$_GET[pwd]">Помощь</a><br/>";
echo "<a href="library.php?usr=$_GET[usr]&pwd=$_GET[pwd]">Библиотека</a><br/>";
echo "<a href="servis.php?usr=$_GET[usr]&pwd=$_GET[pwd]">Сервисы</a><br/>";
echo '<div class="pt">Меню:</div>';
echo "<a href="n.php?usr=$_GET[usr]&pwd=$_GET[pwd]">Население</a><br/>";
echo "<a href="land.php?usr=$_GET[usr]&pwd=$_GET[pwd]">Земля</a><br/>";
echo "<a href="res.php?usr=$_GET[usr]&pwd=$_GET[pwd]">Добыча ресурсов</a><br/>";
echo "<a href="zdanija.php?usr=$_GET[usr]&pwd=$_GET[pwd]">Постройка</a><br/>";
$v = mysql_result(mysql_query("SELECT COUNT(*) FROM `zdanija` WHERE `kazarma` > 0"),0);
if ($v > 0)
{
echo '<a href="kazarma.php?usr='.$_GET['usr'].'&pwd='.$_GET['pwd'].'">Казарма</a><br/>';
}
echo '<div class="pt">Общение:<br></div>';
require "counter.php";
echo "<a href="msg.php?usr=$_GET[usr]&pwd=$_GET[pwd]">Почта</a>[$p_n/$p_all]<br/>";
echo "<a href="chat.php?usr=$_GET[usr]&pwd=$_GET[pwd]">Чат</a>[$chat_c]<br/>";
echo "<a href="forum.php?usr=$_GET[usr]&pwd=$_GET[pwd]">Форум</a>[$f_r/$f_t/$f_p]<br/>";
#####################################################
$q=mysql_query("SELECT * FROM users WHERE `usr` = '".mysql_real_escape_string($_GET['usr'])."' && `pwd` = '".mysql_real_escape_string($_GET['pwd'])."';");
$war=mysql_fetch_array($q);
if ($war['adm'] >= 1)
{
echo '<div class="pt">Панель:</div>';
echo "<b><a href="mpan/index.php?usr=$_GET[usr]&pwd=$_GET[pwd]&ad=main">Модер Панель</a></b><br/> n";
}
if($war[adm] >= 2){
echo "<b><big><a href="cpan/index.php?usr=$_GET[usr]&pwd=$_GET[pwd]&ad=main">Админ Панель</a></big></b><br/>";
}
echo "-===-<br/>";
echo "<a href="exit.php?usr=$_GET[usr]&pwd=$_GET[pwd]">Выход</a>";
}
function online()
{
$all = mysql_num_rows(mysql_query("SELECT * FROM `online` WHERE `laikas` > '".intval($timeout)."'"));
if(isset($_GET['s'])){$s=intval($_GET['s']);}else{$s=0;}
if($s<0) $s=0;
if($s>$all) $s=0;
$c=$s+1;
$asd = mysql_query("SELECT laikas, usr FROM online WHERE laikas > '$timeout'");
echo "<div class="main"><div class="in">";
pochta();
echo "<div class="pt"><center>Императоры</center></div><br />n";
While($visi = mysql_fetch_array($asd))
{
$nikai = strip_tags($visi['usr']);
$t = mysql_fetch_array(mysql_query("SELECT * FROM users WHERE usr = '".mysql_real_escape_string($nikai)."' LIMIT ".$s.",10"));
$adm = strip_tags($t['adm']);
$id = strip_tags($t['id']);
if ($adm == 3 || $adm == 2)
{
echo '<img src="img/admin.gif" alt="s"></img>';
}
if ($adm == 1)
{
echo '<img src="img/moder.gif" alt="m"></img>';
}
echo "<b><a href="info_m.php?usr=$_GET[usr]&pwd=$_GET[pwd]&man=".$id."">".$nikai."</a></b><br/>";
}
if($all>0)
{
$ba=ceil($all/10);
$ba2=$ba*10-10;
echo "Страницы:";
$asd=$s-(10*3);
$asd2=$s+(10*4);
if($asd<$all && $asd>0){echo ' <a href="main.php?usr='.$_GET['usr'].'&pwd='.$_GET['pwd'].'&start=0&r='.$rand.'&id=s&id=online">1</a> .. ';}
for($i=$asd; $i<$asd2;)
{
if($i<$all && $i>=0)
{
$ii=floor(1+$i/10);
if($s==$i)
{
echo ' '.$ii;
}
else
{
echo ' <a href="servis.php?usr='.$_GET['usr'].'&pwd='.$_GET['pwd'].'&s='.$i.'&r='.$rand.'&id=s&id=online">'.$ii.'</a>';
}
}
$i=$i+10;
}
if($asd2<$all){echo ' .. <a href="servis.php?usr='.$_GET['usr'].'&pwd='.$_GET['pwd'].'&s='.$ba2.'&r='.$rand.'&id=s&id=online">'.$ba.'</a>';}
}
echo "<br /><a href="main.php?usr=$_GET[usr]&pwd=$_GET[pwd]">На главную</a><br/>";
}
$db_connection = mysql_connect($db_host, $db_user, $db_pass);
mysql_select_db($db_table, $db_connection);
mysql_query('SET NAMES cp1251');
$exist = mysql_num_rows(mysql_query("SELECT usr, pwd FROM users WHERE usr = '".mysql_real_escape_string($_GET['usr'])."' AND pwd = '".mysql_real_escape_string($_GET['pwd'])."'"));
$online = mysql_num_rows(mysql_query("SELECT * FROM online WHERE laikas > '$timeout'"));
$year = date("Y.m.d");
$times = date("H:i");
$vremechko = "$year $times";
$subt = file_get_contents("max_on.dat");
$max = explode("|", $subt);
$max_onl = $max[0];
$max_on_time = $max[1];
if ($online >= $max_onl)
{
$fp55 = fopen("max_on.dat", 'w');
fwrite($fp55, "$online|$vremechko|");
fclose($fp55);
}
if($exist == 1)
{
require "d_res.php";
require "stroim.php";
require "food.php";
if($_GET['id'] == "")
{
$set['title']='Век Империй - Главная';
head();
title ();
first_page();}
elseif($_GET['id'] == "online")
{
$set['title']='Онлайн';
head();
title ();
online();}
}
else
{
echo "<div class="main"><div class="in">";
echo "Вы не зарегистрированны!!!<br/>";
echo "<br/>";
}foot();
mysql_close($db_connection);
?>