added beta version of time details.
This commit is contained in:
18
class.php
18
class.php
@@ -32,6 +32,24 @@ class ps4 {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function gameTimeDetails($gameid) {
|
||||||
|
$result = $this->mysql_conn("SELECT * FROM game_time WHERE game_id = '". $gameid ."';");
|
||||||
|
if ($result->num_rows > 0) {
|
||||||
|
$i=0;
|
||||||
|
while ($row = $result->fetch_assoc()) {
|
||||||
|
$i++;
|
||||||
|
echo "<br/>";
|
||||||
|
echo $row["id"] ." : ";
|
||||||
|
echo $this->secondsToDate($row["game_start"]);
|
||||||
|
echo " / ";
|
||||||
|
echo $this->secondsToDate($row["game_end"]);
|
||||||
|
echo " = ";
|
||||||
|
echo $this->playtime((($row["game_end"]-$row["game_start"])/1000),true);
|
||||||
|
echo "<br/>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function playtime($seconds, $text=false) {
|
function playtime($seconds, $text=false) {
|
||||||
$playtime = null;
|
$playtime = null;
|
||||||
$label = null;
|
$label = null;
|
||||||
|
|||||||
2
page.php
2
page.php
@@ -93,7 +93,7 @@ foreach ($games as $key => $value) {
|
|||||||
echo "</div></div>";
|
echo "</div></div>";
|
||||||
|
|
||||||
if ($details == $games[$key]["game_id"]) {
|
if ($details == $games[$key]["game_id"]) {
|
||||||
echo "<br/><br/>Soon, we show details.";
|
$ps4->gameTimeDetails($games[$key]["game_id"]);
|
||||||
}
|
}
|
||||||
echo "</div>"; // info
|
echo "</div>"; // info
|
||||||
echo "</div>"; // game
|
echo "</div>"; // game
|
||||||
|
|||||||
Reference in New Issue
Block a user