Boa!! vo usa ![]()
- Fórum
- OTServ
- Tutoriais
- Tutoriais de Websites
- Ferramenta De Busca.
info
Grupo: Herói
Registrado: 12/11/05
Posts: 715
Reputação: +1
Char no Tibia: Lord'Skyxt

Mustorze,
cuidado isso é flood, espero que não se repita.
Abraços.
info
Grupo: Visconde
Registrado: 10/06/06
Posts: 338
Reputação: +6
Char no Tibia: Setyte Berseker

@Kardec
Favor pôr os créditos e explícitar o conteúdo.
@A todos
Este script se trata de um sistema de busca para otservs em XML.
info
Grupo: Lenda
Registrado: 03/10/06
Posts: 2.6k
Reputação: +309
Gênero: Masculino
Char no Tibia: Knight Orion

Bom code Kardec
É bom sistema de busca, masi organizado
e esse é bm fácil de usar!
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
Retire do código o
action="<?=$PHP_SELF?>"
Ele busca o que? explica o que ele faz? néh! x]
Pelo que vi ele busca players.. mas avisa néh!
Vou da uma olhada no cade abraços..
Abraços HeNNET B)\\









info
Grupo: Barão
Registrado: 19/03/07
Posts: 245
Reputação: +3
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 Maio 18 por Kardec