Просмотр файла darkworld/sclan.php

Размер файла: 3.68Kb
<?
Error_Reporting(E_ALL & ~E_NOTICE);
include_once("files/antixak.php");
header("Content-type:text/vnd.wap.wml");
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.2//EN\" \"http://www.wapforum.org/DTD/wml12.dtd\">";
echo "<wml>\n";
echo "<head><meta http-equiv=\"Cache-Control\" content=\"no-cache\" forua=\"true\"/></head>";
echo "<card id=\"index\" title=\"&#x421;&#x43A;&#x43B;&#x430;&#x434;\">";
echo "<p align=\"left\">";

$log = htmlspecialchars(stripslashes($log));
$pas = htmlspecialchars(stripslashes($pas));
/////////////////////////////////////////////////////
$text = @file("data/reg/$log.dat"); 
if ($text!=""){
$udata = explode(":||:",$text[0]);
$login=trim($udata[0]);
$password=trim($udata[1]);}
////////////////////////////////////////////////////////
if (md5($pas)==$password && $log==$login && $log!=="" && md5($pas)!=="") {
include_once"files/up.php";

switch($go) {

default:

if(empty($udata[23])){echo"<small>&#x412;&#x44B; &#x43D;&#x435; &#x432; &#x43A;&#x43B;&#x430;&#x43D;&#x435;!</small>";}else{

echo"<small>&#x41D;&#x430;&#x436;&#x43C;&#x438;&#x442;&#x435; &#x43D;&#x430; &#x435;&#x449;&#x44C; &#x447;&#x442;&#x43E;&#x431;&#x44B; &#x435;&#x451; &#x432;&#x437;&#x44F;&#x442;&#x44C;.</small><br/>";


if(@file("data/clan/sklad/$udata[23].dat")){

$file = @file("data/clan/sklad/$udata[23].dat");
$total = count($file);  

if (empty($_GET['start'])) $start = 0;
else $start = $_GET['start'];
if ($total < $start + 5){ $end = $total; }
else {$end = $start + 5; }
for ($i = $start; $i < $end; $i++){

$file = @file("data/clan/sklad/$udata[23].dat");
$file = array_reverse($file);
$data = explode(":||:",$file[$i]);

echo"<b><small><a href=\"sclan.php?log=$log&amp;pas=$pas&amp;id=$i&amp;name=$data[4]&amp;go=me\">$data[4]</a></small></b> <small>- ($data[2]) [+$data[0]]</small><br/>";
}}else{echo"<small>&#x41D;&#x430; &#x441;&#x43A;&#x43B;&#x430;&#x434;&#x435; &#x43D;&#x435;&#x442; &#x432;&#x435;&#x449;&#x435;&#x439;.</small>";}

    
    
if ($start != 0) {echo '<a href="sclan.php?start='.($start - 5).'&amp;log='.$log.'&amp;pas='.$pas.'">&#x41D;&#x430;&#x437;&#x430;&#x434;</a> ';}

if ($total > $start + 5) {echo ' <a href="sclan.php?start='.($start + 5).'&amp;log='.$log.'&amp;pas='.$pas.'">&#x414;&#x430;&#x43B;&#x435;&#x435;</a>';}
}
break;

case 'me':

$id=$_GET['id'];
$name=$_GET['name'];

$file = @file("data/clan/sklad/$udata[23].dat");
$file = array_reverse($file);
$data = explode(":||:",$file[$id]);

if($name!==$data[4]){echo"<small>&#x41D;&#x430; &#x441;&#x43A;&#x43B;&#x430;&#x434;&#x435; &#x43D;&#x435;&#x442; &#x442;&#x430;&#x43A;&#x43E;&#x439; &#x432;&#x435;&#x449;&#x438;!</small>"; include_once"files/down.php"; exit;}

//////////////////////////////////////////

$text=''.$data[0].':||:'.$data[1].':||:'.$data[2].':||:'.$data[3].':||:'.$data[4].':||:';

$fp=fopen("data/clan/sklad/$udata[23].dat","w");
flock ($fp,LOCK_EX);
unset($file[$id]);
fputs($fp, implode("",$file));
flock ($fp,LOCK_UN);
fclose($fp);



$fp=fopen("data/item/$log.dat","a+");    
flock($fp,LOCK_EX);                                                                        
fputs($fp,"$text\r\n");
fflush($fp);
flock($fp,LOCK_UN);
fclose($fp);  

echo"<small>&#x412;&#x44B; &#x443;&#x441;&#x43F;&#x435;&#x448;&#x43D;&#x43E; &#x437;&#x430;&#x431;&#x440;&#x430;&#x434;&#x438; &#x432;&#x435;&#x449;&#x44C; &#x441;&#x43E; &#x441;&#x43A;&#x43B;&#x430;&#x434;&#x430;.</small>";

break;
}
}else{echo"<small>&#x41F;&#x430;&#x440;&#x43E;&#x43B;&#x44C; &#x438;&#x43B;&#x438; &#x43B;&#x43E;&#x433;&#x438;&#x43D; &#x43D;&#x435;&#x432;&#x435;&#x440;&#x435;&#x43D;!</small>";}

include_once"files/down.php";
?>