Advertisement
Guest User

Untitled

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