Example #1
0
              <tr>
                <th>Teleports</th>
                <td><?php 
echo getPlayerStat($mysqli, $mysql_table_prefix, $player_id, "teleport");
?>
 Teleports</td>
                <td><?php 
echo round(getServerAverage($mysqli, $mysql_table_prefix, "teleport", $required_global_stats_time), 2);
?>
                  Teleports
                </td>
              </tr>
              <tr>
                <th>Money</th>
                <td><?php 
echo getPlayerStat($mysqli, $mysql_table_prefix, $player_id, "money");
?>
</td>
                <td><?php 
echo round(getServerAverage($mysqli, $mysql_table_prefix, "money", $required_global_stats_time), 2);
?>
</td>
              </tr>
              </tbody>
            </table>
          </div>
        </div>
      </div>
    </div>
    <!-- /Main Content -->
Example #2
0
if (empty($players)) {
    ?>
                <tr>
                  <th colspan='2'><p class="make-center">No players found having '<?php 
    echo $playerName;
    ?>
' in their
                                                         name</p></th>
                </tr>
              <?php 
} else {
    foreach ($players as $player) {
        echo "<tr>";
        echo "<td><img src='" . $avatar_service_uri . $player['name'] . "/16' class='img-circle avatar-list-icon'> <a href='" . LINKBASE . "players/" . $player['player_id'] . "' title='" . $player['name'] . "&apos;s Stats'>" . $player['name'] . "</a></td>";
        $lastjoin = getPlayerStat($mysqli, $mysql_table_prefix, $player['player_id'], "lastjoin");
        $lastleave = getPlayerStat($mysqli, $mysql_table_prefix, $player['player_id'], "lastleave");
        if ($lastjoin > $lastleave) {
            echo "<td>Online now!</td>";
        } else {
            if ($lastleave == 0) {
                echo "<td>Not recorded</td>";
            } else {
                echo "<td><abbr class='timeago' title='" . date("c", $lastleave) . "'>" . $lastleave . "</abbr></td>";
            }
        }
        echo "</tr>";
    }
}
?>
              </tbody>
            </table>
Example #3
0
<?php

/**
 * Copyright (c) AccountProductions and Sybren Gjaltema, 2014. All rights reserved.
 */
header('Content-Type: application/json');
include '../../config.php';
include '../db.php';
include '../util.php';
include '../pages/player-list-getter.php';
include '../queries.php';
$players = getPlayerList($mysqli, $mysql_table_prefix, "online", "desc", 1);
if (!$players || empty($players)) {
    die(json_encode("Query failed, or no players are found"));
}
$arr = array();
while ($player = $players->fetch_array()) {
    $newPlayer = array();
    $newPlayer['player_id'] = $player['player_id'];
    $newPlayer['name'] = getPlayerName($mysqli, $mysql_table_prefix, $player['player_id']);
    $newPlayer['lastjoin'] = $player['lastjoin'];
    $newPlayer['lastleave'] = $player['lastleave'];
    $newPlayer['traveled'] = getPlayerStat($mysqli, $mysql_table_prefix, $player['player_id'], 'move');
    $newPlayer['broke'] = getPlayerStat($mysqli, $mysql_table_prefix, $player['player_id'], 'broken');
    $newPlayer['placed'] = getPlayerStat($mysqli, $mysql_table_prefix, $player['player_id'], 'placed');
    $newPlayer['playtime'] = getPlaytime($mysqli, $mysql_table_prefix, $player['player_id']);
    $arr[] = $newPlayer;
}
echo json_encode($arr);