Example #1
0
 //$GamesData[$c]["map"]  = convEnt2(substr($row["map"], strripos($row["map"], '\\')+1));
 //$GamesData[$c]["map"] = reset( explode(".w", $GamesData[$c]["map"] ) );
 //$GamesData[$c]["map"] = substr($GamesData[$c]["map"],0,20);
 $GamesData[$c]["datetime"] = $row["datetime"];
 $GamesData[$c]["gamename"] = $row["gamename"];
 $GamesData[$c]["ownername"] = $row["ownername"];
 $GamesData[$c]["duration"] = $row["duration"];
 $GamesData[$c]["creatorname"] = $row["creatorname"];
 $GamesData[$c]["flag"] = $row["flag"];
 if (isset($_GET["h"]) and file_exists("img/heroes/" . $_GET["h"] . ".gif")) {
     $GamesData[$c]["hero_history"] = $_GET["h"] . "";
 } else {
     $GamesData[$c]["hero_history"] = "";
 }
 $GamesData[$c]["winner"] = $row["winner"];
 $GamesData[$c]["type"] = OS_GetGameState($row["type"], $lang["gamestate_pub"], $lang["gamestate_priv"]);
 $GamesData[$c]["gamestate"] = $row["type"];
 if (isset($row["server"])) {
     $GamesData[$c]["server"] = $row["server"];
 }
 if (isset($row["newcolour"])) {
     $GamesData[$c]["newcolour"] = $row["newcolour"];
     $GamesData[$c]["win"] = 0;
     if ($row["newcolour"] <= 5 and $row["winner"] == 1) {
         $GamesData[$c]["win"] = 1;
     } else {
         if ($row["newcolour"] > 5 and $row["winner"] == 1) {
             $GamesData[$c]["win"] = 2;
         } else {
             if ($row["newcolour"] > 5 and $row["winner"] == 2) {
                 $GamesData[$c]["win"] = 1;
Example #2
0
 $sth = $db->prepare("SELECT g.gamename, g.id, g.map, g.datetime, g.duration, g.gamestate, dg.winner\n\tFROM " . OSDB_GAMES . " as g\n\tLEFT JOIN " . OSDB_GP . " as gp ON gp.gameid = g.id AND gp.name=:user1 \n\tLEFT JOIN " . OSDB_GP . " as gp2 ON gp2.gameid = gp.gameid AND gp2.name=:user2\n\tLEFT JOIN " . OSDB_DG . " as dg ON dg.gameid = g.id\n\tWHERE gp.name =:user1  AND gp2.name =:user2\n\tORDER BY g.id DESC\n\tLIMIT {$offset}, {$rowsperpage}");
 $sth->bindValue(':user1', $User1, PDO::PARAM_STR);
 $sth->bindValue(':user2', $User2, PDO::PARAM_STR);
 $result = $sth->execute();
 $CommonGames = array();
 $c = 0;
 while ($row = $sth->fetch(PDO::FETCH_ASSOC)) {
     $CommonGames[$c]["gamename"] = $row["gamename"];
     $CommonGames[$c]["id"] = $row["id"];
     $CommonGames[$c]["map"] = $row["map"];
     $CommonGames[$c]["datetime"] = $row["datetime"];
     $CommonGames[$c]["duration"] = $row["duration"];
     $CommonGames[$c]["gamestate"] = $row["gamestate"];
     $CommonGames[$c]["player1"] = $User1;
     $CommonGames[$c]["player2"] = $User2;
     $CommonGames[$c]["type"] = OS_GetGameState($row["gamestate"], $lang["gamestate_pub"], $lang["gamestate_priv"]);
     $CommonGames[$c]["winner"] = $row["winner"];
     //REPLAY
     $duration = secondsToTime($row["duration"]);
     $replayDate = strtotime($row["datetime"]);
     //3*3600 = +3 HOURS,   +0 minutes.
     $replayDate = date("Y-m-d H:i", $replayDate);
     $gametimenew = substr(str_ireplace(":", "-", date("Y-m-d H:i", strtotime($replayDate))), 0, 16);
     $gid = (int) $row["id"];
     $gamename = $CommonGames[$c]["gamename"];
     include 'inc/get_replay.php';
     if (file_exists($replayloc)) {
         $CommonGames[$c]["replay"] = $replayloc;
     } else {
         $CommonGames[$c]["replay"] = "";
     }
Example #3
0
    } else {
        ?>
onclick="alert('You don\'t have permission to delete the game?')"<?php 
    }
    ?>
><img src="<?php 
    echo OS_HOME;
    ?>
adm/del.png" alt="img" /></a>
	 </td>
	<td width="80" class="font12"><?php 
    echo secondsToTime($row["duration"]);
    ?>
</td>
	<td width="40" class="font12"><?php 
    echo OS_GetGameState($row["type"]);
    ?>
</td>
	<td width="140" class="font12"><?php 
    echo date($DateFormat, strtotime($row["datetime"]));
    ?>
</td>
	<td width="150" class="font12"><?php 
    echo $row["creatorname"];
    ?>
</td>
	<td width="80" class="font12"> <?php 
    echo $row["views"];
    ?>
</td>
  </tr>