Файл: gamele.ru/logs.php
Строк: 68
<?php
session_start();
include($_SERVER["DOCUMENT_ROOT"]."/includes/config.inc.php");
include( DROOT . "/includes/functions.php");
$sql = mysql_query("SELECT `arena`.`id_battle`, `arena`.`vis`, `fight_users`.`side`, `fight_users`.`uid`, `user`.`sklon`, `user`.`clan_gif`, `user`.`level`, `user`.`login`, `fight_users`.`hp`, `user`.`hp_all`, `fight_users`.`dmg`, `user`.`type`, `user`.`clan_id`,`user`.`invisible` FROM `user`,`arena` LEFT JOIN `fight_users` ON `arena`.`id_battle` = `fight_users`.`battle` WHERE `fight_users`.`id` = `user`.`id` and `arena`.`id_battle` = '".intval($_GET['fid'])."'");
while ($pl = mysql_fetch_assoc($sql)) {
if($pl['side']==1){
if(isset($livg1)){
$z=",";
}
if($pl['type']==1){
if($pl['invisible']<time()){
$livg1.=$z.'['.$pl['type'].',"'.$pl['login'].'",'.$pl['level'].','.$pl['sklon'].',"'.(($pl['clan_id']=='chaos')?'':$pl['clan_gif']).'",'.$pl['hp'].','.$pl['hp_all'].','.$pl['hp'].']';
}else{
$livg1.=$z.'[4]';
}
}else{
$livg1.=$z.'['.$pl['type'].',"'.$pl['login'].'",'.$pl['hp'].','.$pl['hp_all'].','.$pl['uid'].']';
}
}else if($pl['side']==2){
if(isset($livg2)){
$z2=",";
}
if($pl['type']==1){
if($pl['invisible']<time()){
$livg2.=$z2.'['.$pl['type'].',"'.$pl['login'].'",'.$pl['level'].','.$pl['sklon'].',"'.(($pl['clan_id']=='chaos')?'':$pl['clan_gif']).'",'.$pl['hp'].','.$pl['hp_all'].','.$pl['hp'].']';
}else{
$livg2.=$z2.'[4]';
}
}else{
$livg2.=$z2.'['.$pl['type'].',"'.$pl['login'].'",'.$pl['hp'].','.$pl['hp_all'].','.$pl['uid'].','.$pl['hp'].']';
}
}
}
if(is_file("/var/www/gamale/data/battles/logs/".intval($_GET['fid']).".txt")){
$lines = file("/var/www/gamale/data/battles/logs/".intval($_GET['fid']).".txt");
}
$num = ceil(count($lines)/10);
if(!isset($_GET['p']) or $_GET['p']==1){$p1=0;$_GET['p']=1;}else{$p1=$_GET['p']*10-11;}
echo'<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Last Era - Лог боя</title>
<link rel="stylesheet" type="text/css" href="/css/NewDesign.css">
<meta http-equiv="content-type" content="text/html; charset=windows-1251">
<META Http-Equiv="Cache-Control" Content="No-Cache">
<META Http-Equiv="Pragma" Content="No-Cache">
<META Http-Equiv="Expires" Content="0">
<SCRIPT src="/js/signs.js"></SCRIPT>
<SCRIPT src="/js/vlogs.js"></SCRIPT>
<SCRIPT src="/js/png.js"></SCRIPT>
<SCRIPT src="/js/top.js"></SCRIPT>
</head>
</head>
<body>
<SCRIPT language="JavaScript">
var d = document;
';
if(!isset($_GET['stat'])){
echo'var logs = [';
if(is_file("/var/www/gamale/data/battles/logs/".intval($_GET['fid']).".txt")){
echo show_log(intval($_GET['fid']),$p1,10);
}
echo'];';
}else{
if(is_file("/var/www/gamale/data/battles/stats/".intval($_GET['fid']).".txt")){
echo'var list = [[],'.Show_Stat(intval($_GET['fid'])).'];';
}
}
echo'var params = ['.$num.','.($_GET['stat']+1).','.intval($_GET['fid']).','.$p.',1];
var show = '.($_GET['stat']+1).';
var off = '.((is_file("/var/www/gamale/data/battles/stats/".intval($_GET['fid']).".txt"))?'1':'0').';
';
if(!is_file("/var/www/gamale/data/battles/stats/".intval($_GET['fid']).".txt")){
echo'var lives_g1 = ['.$livg1.'];
var lives_g2 = ['.$livg2.'];';
}
echo'
viewlog();
</SCRIPT>
</body>
</html>
';
?>