Added the function to change the thumbnail URL when clinking on the image.
This commit is contained in:
75
page.php
Normal file
75
page.php
Normal file
@@ -0,0 +1,75 @@
|
||||
<?php
|
||||
include_once("class.php");
|
||||
|
||||
$ps4 = new ps4();
|
||||
|
||||
$sql = "SELECT * FROM game_time";
|
||||
$result = $ps4->mysql_conn($sql);
|
||||
?>
|
||||
|
||||
<strong>Last Updated : </strong> <?php echo date(DATE_RFC2822) ?><br/><br/>
|
||||
|
||||
<?php
|
||||
if ($result->num_rows > 0) {
|
||||
// output data of each row
|
||||
|
||||
while ($row = $result->fetch_assoc()) {
|
||||
|
||||
|
||||
$games[$row["game_id"]]["game_id"] = $row["game_id"];
|
||||
$games[$row["game_id"]]["game_name"] = $row["game_name"];
|
||||
isset($games[$row["game_id"]]["game_total_time"]) ?: $games[$row["game_id"]]["game_total_time"] = 0;
|
||||
|
||||
isset($games[$row["game_id"]]["game_played_first"]) ?: $games[$row["game_id"]]["game_played_first"] = $row["game_start"];
|
||||
isset($games[$row["game_id"]]["game_played_last"]) ?: $games[$row["game_id"]]["game_played_last"] = $row["game_end"];
|
||||
if ($row["game_start"] < $games[$row["game_id"]]["game_played_first"]) {
|
||||
$games[$row["game_id"]]["game_played_first"] = $row["game_start"];
|
||||
}
|
||||
|
||||
if ($row["game_end"] == "") {
|
||||
$games[$row["game_id"]]["game_time"][$row["id"]] = -1;
|
||||
$games[$row["game_id"]]["game_played_last"] = -1;
|
||||
$games[$row["game_id"]]["game_total_time"] += ((round(microtime(true) * 1000)-$row["game_start"])/1000);
|
||||
} else {
|
||||
$games[$row["game_id"]]["game_time"][$row["id"]] = (($row["game_end"]-$row["game_start"])/1000);
|
||||
$games[$row["game_id"]]["game_total_time"] += (($row["game_end"]-$row["game_start"])/1000);
|
||||
if (($row["game_end"] > $games[$row["game_id"]]["game_played_last"]) AND ($games[$row["game_id"]]["game_played_last"] != -1)) {
|
||||
$games[$row["game_id"]]["game_played_last"] = $row["game_end"];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$currentid = "";
|
||||
foreach ($games as $key => $value) {
|
||||
echo "<div class=\"game\">";
|
||||
echo "<div class=\"thumbnail\">";
|
||||
echo "<img src=\"".$ps4->thumbnailurl($key)."\" border=0 weight=\"80px\" height=\"80px\" onclick=\"thumbnailupdateurl('". $games[$key]["game_id"] ."', '". $games[$key]["game_name"] ."');\">";
|
||||
echo "</div>";
|
||||
echo "<div class=\"info\">";
|
||||
echo "<strong>". $games[$key]["game_name"] ."</strong> (". $games[$key]["game_id"] .")";
|
||||
echo "<br/>";
|
||||
echo "Total Time Played : <a href=\"".$_SERVER['PHP_SELF']."?details=".$games[$key]["game_id"]."\">". $ps4->playtime($games[$key]["game_total_time"],true) ."</a>";
|
||||
echo "<br/>First Played on : ". $ps4->secondsToDate($games[$key]["game_played_first"]);
|
||||
echo "<br/>Last Played on : ";
|
||||
|
||||
if ($games[$key]["game_played_last"] == -1) {
|
||||
echo "now playing";
|
||||
} else {
|
||||
echo $ps4->secondsToDate($games[$key]["game_played_last"]);
|
||||
}
|
||||
echo "</div>"; // info
|
||||
echo "</div>"; // game
|
||||
}
|
||||
|
||||
/*
|
||||
echo "<pre>";
|
||||
print_r($games);
|
||||
echo "</pre>";
|
||||
*/
|
||||
|
||||
} else {
|
||||
echo "0 results";
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user