Advertisement
DraKiNs

[COD] IniFiles Ranking

Jun 26th, 2011
607
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.83 KB | None | 0 0
  1. <?php
  2.     /*
  3.         Simples sistema de Rank e Ordenação a Partir de Ini Files
  4.             Criado por DraKiNs
  5.         www.ips-team.blogspot.com
  6.             Bom Uso
  7.     */
  8.  
  9.     $iLoopCurrent= -1;
  10.     $sPlayersData = array();
  11.     $sPasta = opendir("Contas");
  12.  
  13.     while(($sFileAtual  = readdir($sPasta)) !== false)
  14.     {
  15.         if(($sFileAtual !=".") && ($sFileAtual  !="..") && ($sFileAtual != "index.htm") && ($sFileAtual !="info"))
  16.         {
  17.  
  18.             $iLoopCurrent++;
  19.             $sFileParse= parse_ini_file("Contas/". $sFileAtual);
  20.             $sFileAtual  = substr($sFileAtual , 0,strlen($sFileAtual)-4);
  21.             $sPlayersData[$iLoopCurrent] =  array($sFileParse["Kills"] ,$sFileAtual ); //Tag KILLS
  22.         }
  23.     }
  24.  
  25.     array_multisort ( $sPlayersData, $sPlayersData);
  26.  
  27.     foreach ($sPlayersData as $sCurrentData)
  28.     {
  29.         echo "<b>Player</b>:  $sCurrentData[1]    |    <b>Kills</b>:  $sCurrentData[0]  <br>";
  30.     }
  31. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement