Ir para conteúdo

Ferramenta De Busca.


Posts Recomendados

Ferramenta de Busca para seu Site

fica ainda mais divertido de navegar.

 

 

<?php
$char = $_REQUEST['char'];
$monster_folder = "folder/monsters";
$folderplayer = "folder/players";
$file= "$folderplayer$char.xml";
$f = @fopen($file, "r");
if(!$char) {
} else if(!$f) {
print("<font color=\"red\">Esse player não existe!</font><br><br>\n\n");
} else {
$contents = fread($f, filesize($file));
$tags = explode("<", $contents);
$name = "";
$level = 0;
$magic_level = 0;
$voc = 0;
$lastlogin = 0;
$skills = array(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];
}
if($temppos = stristr($tag, "level=\"")) {
$temp = explode("\"", $temppos);
$level = $temp[1];
}
if($temppos = stristr($tag, "maglevel=\"")) {
$temp = explode("\"", $temppos);
$magic_level = $temp[1];
}
if($temppos = stristr($tag, "voc=\"")) {
$temp = explode("\"", $temppos);
$voc = $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($tempname && $templvl) {
if(file_exists("$monster_folder$tempname.xml")) {
$deathtext[] = " $templvl by a $tempname";
} else if(file_exists("$folderplayer$tempname.xml")) {
$deathtext[] = " $templvl by <a href=\"search.php?where=search&char=$tempname\">$tempname</a>";
} else {
$deathtext[] = " $templvl by $tempname";
}
}
}
}
print("<b>Name:</b> $name<br>\n");
print("<b>Level:</b> $level<br>\n");
print("<b>Magic Level:</b> $magic_level<br>\n");
$vocations = array("None", "Sorcerer", "Druid", "Paladin", "Knight");
print("<b>Vocation:</b> $vocations[$voc]<br>\n");
//print("<b>Last Login:</b> $lastlogin<br>\n");
print("<br>");
$skillnames = array("", "Club Fighting", "Sword Fighting", "Axe Fighting", "Distance Fighting", "Shielding", "Fishing");
foreach($skills as $k => $skill) {
if(!$skill) continue;
print("<b>$skillnames[$k]:</b> $skill<br>\n");
}
if($deathtext) {
print("<br><br><b>Deaths:</b><br>");
foreach($deathtext as $temp) {
print("Killed at level $temp.<br>\n");
}
}
}
?>
<form method="GET" action="<?=$PHP_SELF?>">
<input type="hidden" name="where" value="search">
<input type="text" name="char">
<input type="submit" value="Search">
</form>
<br>
<body>
<input type="button" value="Back" onclick="history.back()">
</body>

 

Creditos: Cadis

 

Abraços,

Kardec.

Editado por Kardec
Link para o comentário
Compartilhar em outros sites

  • 5 weeks later...

Fiz td como ta ae.Qdo eu coloco o nick do char e cliko em procurar aparece isso :

 

 

Forbidden

You don't have permission to access /<br /><b>Notice</b>: Undefined variable: PHP_SELF in <b>c:\arquivos de programas\easyphp1-7\www\procurar.php</b> on line <b>405</b><br /> on this server.

 

Alguem sabe como arruma?

Vlwz

Link para o comentário
Compartilhar em outros sites

  • 1 month later...
  • 3 weeks later...
  • 10 months later...
  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...