Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Get entrys
- $result = $sql_mostactive->query("SELECT * FROM `mostactive` $sqlSearch LIMIT $firstItem, $usersPerPage");
- // Have any entrys?
- if ($sql_mostactive->foundData($result))
- {
- $index = ($currentSite - 1) * $usersPerPage + 1;
- $cur = 1;
- // Table Layout
- echo '
- <thead><th style="width: 2%; padding-left: 3px; ">#</th>
- <th style="width: 20%; padding-left: 3px; ">' .$nameTable. '</th>
- <th style="width: 20%; padding-left: 3px; ">' .$totalTable. '</th>
- <th style="width: 20%; padding-left: 3px; ">'. $CTTable. '</th>
- <th style="width: 20%; padding-left: 3px; ">' .$TTable. '</th>
- <th style="width: 16%; padding-left: 3px; ">' .$SpecTable. '</th>
- <th style="width: 2%; "></th></thead>';
- // Loop through query
- while ($row = $sql_mostactive->getArray($result))
- {
- // Get User Profile Data
- $xml = @simplexml_load_file("http://steamcommunity.com/profiles/$steam64/?xml=1");
- if(!empty($xml) && !isset($xml->error)) {
- if( isset($xml->steamID) && $xml->steamID == "" )
- $username = "Not Setup"; // Example: steamcommunity.com/profiles/76561198077095013/?xml=1
- else
- $username = $xml->steamID; // Example: steamcommunity.com/profiles/76561198077095031/?xml=1
- }
- else {
- $username = "Not Found"; // Example: steamcommunity.com/profiles/0/?xml=1
- }
- //echo "$username";
- //$name = str_replace("{", "", $row['playername']);
- $name = str_replace("{", "", $username);
- $name = str_replace("}", "", $name);
- $name = str_replace("<", "<", $name);
- $name = str_replace("&", "&", $name);
- $name = substr($name, 0, 22);
- $steamid = new SteamID($row['steamid']);
- $steam3 = $steamid->RenderSteam3().PHP_EOL;
- $steam64 = $steamid->ConvertToUInt64().PHP_EOL;
- $steam3 = preg_replace('/\s+/', '', $steam3);
- $steam64 = preg_replace('/\s+/', '', $steam64);
- if(($search == $steam3 || $search == $steam64 || $search == $row['steamid'] || $search == $name) && $search != "")
- {
- echo '<tr class="success">';
- }
- else
- {
- echo '<tr>';
- }
- echo '
- <td>' .$index. '</td>
- <td>';
- echo '
- <b><a href="http://steamcommunity.com/profiles/' .$steamid->ConvertToUInt64() . PHP_EOL. '" >' .$name. '</a></b></td>
- <td>' .secondsToTime($row['total'], $time_format). '</td>
- <td>' .secondsToTime($row['timeCT'], $time_format).'</td>
- <td>' .secondsToTime($row['timeTT'], $time_format).'</td>
- <td>' .secondsToTime($row['timeSPE'], $time_format). '</td>
- <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>
- </tr>';
- $index++;
- $cur++;
- }
- }
- else
- {
- echo '
- <div class="alert alert-danger" role="alert"><strong>Couldn\'t find any Results</strong></div>
- ';
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement