Asvarox..
Gość
|
Mały błąd w Accmakerze |
|
Tak więc w szukaniu postaci jest mały błąd-zamiast facet wyświetla dziewczyna i na odwrod... naprawiłem to i tu podaje kod którym trzeba zastąpić zawartość search.php
| |
<?php
$char = $_REQUEST['char'];
$format = '%d/%m/%Y %H:%M:%S';
$monster_folder = "$data_folder\\monsters\\";
$folderplayer = "$data_folder\\players\\";
$file= "$folderplayer$char.xml";
$f = @fopen($file, "r");
if(!$char)
{
}
else if(!$f)
{
echo "<font color='red'><center>Ta postać nie istnieje!</font></center><br><br>\n\n";
}
else
{
$contents = fread($f, filesize($file));
$tags = explode("<", $contents);
$name = "";
$exp = 0;
$level = 0;
$magic_level = 0;
$voc = 0;
$lastlogin = 0;
$skills = array(0, 0, 0, 0, 0, 0, 0);
foreach($tags as $tag)
{
if(substr($tag, 0, 6) == "player")
{
if($temppos = stristr($tag, "name=\""))
{
$temp = explode("\"", $temppos);
$name = $temp[1];
}
$housepath = $data_folder . '/houses/';
$housefolder = opendir($housepath);
$found_house = 0;
$owner_of_house = '';
while (($housename = readdir($housefolder)) && ($found_house !== 1))
{
if ($housename == "." || $housename == "..") continue;
$temp = explode(".", $housename);
if ($temp[1] == "xml")
{
$house_name = $temp[0];
$house_name2 = $housepath . $house_name . '.xml';
$open_file = fopen($house_name2, "r");
$house_contents = fread($open_file, filesize($house_name2));
$house_tags = explode("<", $house_contents);
foreach($house_tags as $house_tag)
{
if (substr($house_tag, 0, 5) == "owner")
{
if ($temppos = stristr($house_tag, "name=\""))
{
$temp = explode("\"", $temppos);
$owner_name = $temp[1];
if ($owner_name == ($_GET['char']))
{
$found_house = 1;
$owner_of_house = $house_name;
}
}
}
}
}
}
if ($owner_of_house == '')
{
$owner_of_house = 'Brak';
}
$guild_file = $data_folder . "/guilds.xml";
$g = fopen($guild_file, "r");
$guild_contents = fread($g, filesize($guild_file));
$guild_tags = explode("<", $guild_contents);
$found = 0;
foreach($guild_tags as $guild_tag)
{
if (substr($guild_tag, 0, 5) == "guild" && $found != 1)
{
if ($temppos = stristr($guild_tag, "name=\""))
{
$temp = explode("\"", $temppos);
$guild_name = $temp[1];
}
}
if (substr($guild_tag, 0, 6) == "member")
{
if ($temppos = stristr($guild_tag, "name=\"$char"))
{
$temp = explode("\"", $temppos);
$member_name = $temp[1];
$found = 1;
}
}
}
if ($found == 0)
{
$guild_name = 'Brak';
}
$guild_file = $data_folder . "/guilds.xml";
$g = fopen($guild_file, "r");
$guild_contents = fread($g, filesize($guild_file));
$guild_tags = explode("<", $guild_contents);
$found = 0;
foreach($guild_tags as $guild_tag)
{
if (substr($guild_tag, 0, 5) == "guild" && $found != 1)
{
if ($temppos = stristr($guild_tag, "name=\""))
{
$temp = explode("\"", $temppos);
$guild_name = "<a href='index.php?body=guild&guild=$temp[1]'>$temp[1]</a>";
}
}
if (substr($guild_tag, 0, 6) == "member")
{
if ($temppos = stristr($guild_tag, "name=\"$char"))
{
$temp = explode("\"", $temppos);
$member_name = $temp[1];
$found = 1;
}
}
}
if ($found == 0)
{
$guild_name = 'Brak';
}
if($temppos = stristr($tag, "level=\""))
{
$temp = explode("\"", $temppos);
$level = $temp[1];
}
if($temppos = stristr($tag, "exp=\""))
{
$temp = explode("\"", $temppos);
$exp = $temp[1];
}
if($temppos = stristr($tag, "account=\""))
{
$temp = explode("\"", $temppos);
$acc = $temp[1];
}
if($temppos = stristr($tag, "access=\""))
{
$temp = explode("\"", $temppos);
$access = $temp[1];
}
if($temppos = stristr($tag, "sex=\""))
{
$temp = explode("\"", $temppos);
$sexx = $temp[1];
}
if($temppos = stristr($tag, "promoted=\""))
{
$temp = explode("\"", $temppos);
$pacc = $temp[1];
}
if($temppos = stristr($tag, "maglevel=\""))
{
$temp = explode("\"", $temppos);
$magic_level = $temp[1];
}
if($temppos = stristr($tag, "banned=\""))
{
$temp = explode("\"", $temppos);
$ban = $temp[1];
}
if($temppos = stristr($tag, "voc=\""))
{
$temp = explode("\"", $temppos);
$voc = $temp[1];
}
if($temppos = stristr($tag, "promoted=\""))
{
$temp = explode("\"", $temppos);
$promoted = $temp[1];
}
if($temppos = stristr($tag, "lastlogin=\""))
{
$temp = explode("\"", $temppos);
$lastlogin = $temp[1];
}
}
if(substr($tag, 0, 6) == "skill ")
{
if($temppos = stristr($tag, "skillid=\""))
{
$temp = explode("\"", $temppos);
$tempid = $temp[1];
}
if($temppos = stristr($tag, "level=\""))
{
$temp = explode("\"", $temppos);
$templvl = $temp[1];
}
if($tempid && $templvl)
{
$skills[$tempid] = $templvl;
}
}
if(substr($tag, 0, 6) == "death ")
{
if($temppos = stristr($tag, "name=\""))
{
$temp = explode("\"", $temppos);
$tempname = $temp[1];
}
if($temppos = stristr($tag, "level=\""))
{
$temp = explode("\"", $temppos);
$templvl = $temp[1];
}
if($temppos = stristr($tag, "time=\""))
{
$temp = explode("\"", $temppos);
$temptime = $temp[1];
}
$deadtime = strftime($format, $temptime);
if($tempname && $templvl && $deadtime)
{
if(file_exists("$monster_folder$tempname.xml"))
{
$deathtext[] = " $deadtime - Na poziomie $templvl od a $tempname";
}
else if(file_exists("$folderplayer$tempname.xml"))
{
$deathtext[] = " $deadtime - Na poziomie $templvl od <a href=\"index.php?body=search&char=$tempname\">$tempname</a>";
}
else
{
$deathtext[] = " $deadtime - Na poziomie $templvl od $tempname";
}
}
}
}
if ($access > 1)
{
echo "<b>Nie możesz zobaczyć statystyk postaci GM'a</b><br />";
}
else
{
$login = strftime($format, $lastlogin);
echo "<table border='1' align='center' class='mon' bordercolor='black'>";
echo "<tr><td><b>Nick:</b></td><td>$name</td></tr>";
echo "<tr><td><b>Poziom:</b> </td><td>$level</td></tr>";
echo "<tr><td><b>Exp:</b></td><td>$exp</tr>";
echo "<tr><td><b>Poziom Magii:</b></td><td>$magic_level</td></tr>";
if($promoted == 0)
{
$vocations = array("No Vocation", "Sorcerer", "Druid", "Paladin", "Knight");
}
else
{
$vocations = array("No Vocation", "Master Sorcerer", "Elder Druid", "Royal Paladin", "Elite Knight");
}
echo "<tr><td><b>Profesja:</b></td><td>$vocations[$voc]</td></tr>";
$sex = array("Dziewczyna", "Chłopak");
echo "<tr><td><b>Płeć: </b></td><td>$sex[$sexx]</td></tr>";
$premium = array("FACC", "PACC");
echo "<tr><td><b>Account Status: </b></td><td>$premium[$pacc]</td></tr>";
echo "<tr><td><b>Gildia:</b></td><td><u>$guild_name</u></td></tr>";
echo "<tr><td><b>Domek: </b></td><td><u>$owner_of_house</u></td></tr>";
$accessname = array("Player", "Tutor", "Consuller", "Gamemaster");
echo "<tr><td><b>Pozycja: </b></td><td>$accessname[$access]</td></tr>";
$banned = array("Brak", "<font color=red>Zbanowany!</font>");
echo "<tr><td><b>Bany: </b></td><td>$banned[$ban]</td></tr>";
if ($lastlogin == '0')
{
$login = "Nigdy";
}
echo "<tr><td><b>Ostatnio zalogowany: </b></td><td>$login</td></tr>";
echo "<tr><td colspan=2><b>Skills:</b></td>";
$skillnames = array("Fist Fighting", "Club Fighting", "Sword Fighting", "Axe Fighting", "Distance Fighting", "Shielding", "Fishing");
foreach($skills as $k => $skill)
{
if(!$skill) continue;
echo "<tr><td><b>$skillnames[$k]:</b></td><td>$skill</td></tr>";
}
if($deathtext)
{
echo "<tr><td colspan=2><b>Zgony:</b><br>";
foreach($deathtext as $temp)
{
echo "$temp .<br>";
}
}
echo "</td></tr>";
echo "</table>";
if(!$f)
{
echo '';
}
else
{
echo "<table border='0' align='center' class='mon' bordercolor='black'>";
echo "<tr><th>Inne postacie na koncie:</th><tr>";
$dir = file_get_contents("$diraccount/$acc.xml");
$all = explode('"', $dir);
$allcount = count($all);
$total = $allcount - 1;
$i = 9;
$h = 0;
while($i<=$total)
{
$characters[$h] = $all[$i];
$i += 2;
echo "<tr><td><img src='img/punkt.gif'> <a href=\"index.php?body=search&char=$characters[$h]\">$characters[$h]</a></td></tr><br>";
$h++;
}
echo '</table>';
}
}
}
?>
<br />
<center><img src="img/linia.png" /><img src="img/linia.png" /><img src="img/linia.png" /></center>
<br />
Wpisz nick gracza, aby zobaczyć jego statystyki.
<form method="POST">
<input type="hidden" name="a" value="search">
<input type="text" name="char">
<input type="submit" value="Szukaj">
</form>
|
|
|