Advertisement
Guest User

Untitled

a guest
Jan 31st, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.58 KB | None | 0 0
  1.                                 <?php
  2.                                     // Get entrys
  3.                                     $result = $sql_mostactive->query("SELECT * FROM `mostactive` $sqlSearch LIMIT $firstItem, $usersPerPage");
  4.                                    
  5.  
  6.  
  7.                                    
  8.                                     // Have any entrys?
  9.                                     if ($sql_mostactive->foundData($result))
  10.                                     {
  11.                                         $index = ($currentSite - 1) * $usersPerPage + 1;
  12.                                         $cur = 1;
  13.                                    
  14.  
  15.  
  16.  
  17.  
  18.  
  19.                                    
  20.                                         // Table Layout
  21.                                         echo '
  22.                                         <thead><th style="width: 2%; padding-left: 3px; ">#</th>
  23.                                         <th style="width: 20%; padding-left: 3px; ">' .$nameTable. '</th>
  24.                                         <th style="width: 20%; padding-left: 3px; ">' .$totalTable. '</th>
  25.                                         <th style="width: 20%; padding-left: 3px; ">'. $CTTable. '</th>
  26.                                         <th style="width: 20%; padding-left: 3px; ">' .$TTable. '</th>
  27.                                         <th style="width: 16%; padding-left: 3px; ">' .$SpecTable. '</th>
  28.                                         <th style="width: 2%; "></th></thead>';
  29.                                        
  30.                                         // Loop through query
  31.                                         while ($row = $sql_mostactive->getArray($result))
  32.                                         {
  33.                                            
  34. // Get User Profile Data
  35. $xml = @simplexml_load_file("http://steamcommunity.com/profiles/$steam64/?xml=1");
  36.  
  37. if(!empty($xml) && !isset($xml->error)) {
  38.         if( isset($xml->steamID) && $xml->steamID == "" )
  39.                 $username = "Not Setup"; // Example: steamcommunity.com/profiles/76561198077095013/?xml=1
  40.         else
  41.                 $username = $xml->steamID; // Example: steamcommunity.com/profiles/76561198077095031/?xml=1
  42. }
  43.  else {
  44.         $username = "Not Found"; // Example: steamcommunity.com/profiles/0/?xml=1
  45. }
  46.  
  47. //echo "$username";        
  48.                                            
  49.                                             //$name = str_replace("{", "", $row['playername']);
  50.                                             $name = str_replace("{", "", $username);
  51.                                             $name = str_replace("}", "", $name);
  52.                                             $name = str_replace("<", "&lt;", $name);
  53.                                             $name = str_replace("&", "&amp;", $name);
  54.                                             $name = substr($name, 0, 22);
  55.                                            
  56.                                             $steamid = new SteamID($row['steamid']);
  57.                                             $steam3 = $steamid->RenderSteam3().PHP_EOL;
  58.                                             $steam64 = $steamid->ConvertToUInt64().PHP_EOL;
  59.                                             $steam3 = preg_replace('/\s+/', '', $steam3);
  60.                                             $steam64 = preg_replace('/\s+/', '', $steam64);
  61.                                            
  62.                                            
  63.  
  64.                                    
  65.                                            
  66.                                             if(($search == $steam3 || $search == $steam64 || $search == $row['steamid'] || $search == $name) && $search != "")
  67.                                             {
  68.                                                 echo '<tr class="success">';
  69.                                             }
  70.                                             else
  71.                                             {
  72.                                                 echo '<tr>';
  73.                                             }
  74.                                            
  75.                                             echo '
  76.                                             <td>' .$index. '</td>
  77.                                             <td>';
  78.                                            
  79.                                             echo '
  80.                                             <b><a href="http://steamcommunity.com/profiles/' .$steamid->ConvertToUInt64() . PHP_EOL. '" >' .$name. '</a></b></td>
  81.                                            
  82.                                             <td>' .secondsToTime($row['total'], $time_format). '</td>
  83.                                             <td>' .secondsToTime($row['timeCT'], $time_format).'</td>
  84.                                             <td>' .secondsToTime($row['timeTT'], $time_format).'</td>
  85.                                             <td>' .secondsToTime($row['timeSPE'], $time_format). '</td>
  86.                                            
  87.                                             <td><a href="http://steamcommunity.com/profiles/' .$steamid->ConvertToUInt64() . PHP_EOL. '" target="_blank"><img src="./img/steam_most_active.png"; style="width:auto; height:25px; padding-right: 4px;padding-top: 4px;"></a></td>
  88.                                             </tr>';
  89.                                            
  90.                                             $index++;
  91.                                             $cur++;
  92.                                         }
  93.                                     }
  94.                                     else
  95.                                     {
  96.                                         echo '
  97.                                         <div class="alert alert-danger" role="alert"><strong>Couldn\'t find any Results</strong></div>
  98.                                         ';
  99.                                     }
  100.                                 ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement