Ir para conteúdo
Fórum Script Brasil

Mit

Membros
  • Total de itens

    3
  • Registro em

  • Última visita

Sobre Mit

Mit's Achievements

0

Reputação

  1. Mit

    Dicas Para Criacao De Ferramenta.

    Eu achei esse codigo, mas não consigo adicionar apenas uma pessoa... tem que ser um clã inteiro... :( <?php /*------------------------- Title: Tibia Guild Online List Author: Mike Haugland Date: January 06, 2005 URL: [url=http://haugland.ca]http://haugland.ca[/url] Description: This script is used to display a list of online and offline characters for a chosen guild in the game of Tibia. Copyright: All code written by Mike Haugland with the exception of some noted code below for parsing which was from [url=http://www.magicasoft.net/?id=18]http://www.magicasoft.net/?id=18[/url] -------------------------*/ ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Online List</title> </head> <body> <h1>Member List</h1> <?php //-------[Settings]----------- // These are the only things you really need to edit! $world = "Antica"; $guildname = "Last Chapter"; //---------------------------- //Get the online list for the world of your choice. $path = "http://www.tibia.com/statistics/?subtopic=whoisonline&world=".urlencode($world); if ($contents = file_get_contents($path)) { //Create arrays to store the names of online and offline characters. $onlineList = array(); $offlineList = array(); //Retrieve and parse the guildlist for up-to-date members. Some code used from BBMan at [url=http://www.magicasoft.net/?id=18]http://www.magicasoft.net/?id=18[/url] $members = file_get_contents('http://www.tibia.com/community/?subtopic=guilds&page=view&GuildName='.urlencode($guildname)); // get the members file $members = split("<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%>\s|\S*</TABLE>",$members); // get the big parts $members = strip_tags($members[8],'<tr>'); //take the members element $members = preg_replace('!<TR BGCOLOR=#w{6,6}|</TR>!','',$members); $members = str_replace(' ',' ',$members); //Replace HTML entity with normal space. $members = explode('>',$members); //End of BBMan code //Clear unnecessary array values. unset($members[0],$members[1],$members[2]); //Loop through and put characters in online or offline array. for($count=3;$count<count($members)+3;$count++){ $newmember = explode("\n",$members[$count]); //Split up user info. if (count($newmember) == 3) { $name = $newmember[2]; } else { $name = $newmember[1]; } $name = explode(" (",$name); $characterSearch = str_replace(' ',' ',$name[0]); //Recovert space to HTML entity for searching. //Apply ">" and "<" around name to eliminate chances of mistakenly reporting a name as online. //If you don't do this, searching for Thor would return as online if someone had the name Asthorm. $characterSearch = ">".$characterSearch."<"; //Get the numbers for the lists. $inOnline = count($onlineList); $inOffline = count($offlineList); //Check to see if character is in the source of the online list. Put into array accordingly. if (strpos($contents,$characterSearch)) { $onlineList[$inOnline] = $name[0]; } else { $offlineList[$inOffline] = $name[0]; } } //Sort names alphabetically and reset the array numbers. @reset(sort($onlineList)); @reset(sort($offlineList)); //Display number of online members versus total members. echo count($onlineList)." of ".count($members)." members online."; //Display online list. echo "<ul id=\"onlineList\">"; for ($count=0;$count<count($onlineList);$count++) { echo "<li><a href=\"http://www.tibia.com/community/?subtopic=character&name=".urlencode($onlineList[$count])."\">".$onlineList[$count]."</a> is <span class=\"online\">Online</span></li>"; } //Display offline list. echo "</ul><ul id=\"offlineList\">"; for ($count=0;$count<count($offlineList);$count++) { echo "<li><a href=\"http://www.tibia.com/community/?subtopic=character&name=".urlencode($offlineList[$count])."\">".$offlineList[$count]."</a> is <span class=\"offline\">Offline</span></li>"; } echo "</ul>"; } else { //In the event of failure, let the people know. echo "<p>Opening ".$path." failed.</p>"; } ?> </body> </html>
  2. Eu jogo um jogo chamado Tibia... (www.tibia.com) Eu queria saber como capiturar informacoes do site... como por exemplo as pessoas online.. Como por exemplo essa aqui: http://www.marknadsvagen.com/lastchapter/online.php que é retirada do site do tibia: http://www.tibia.com/statistics/?subtopic=...mp;world=Antica Mas eu queria poder escolher saber quem estar online e não todo mundo... fazer tipo uma 'VIP LIST'.. alguém tem alguma ideia de como fazer?
×
×
  • Criar Novo...