コード例 #1
0
ファイル: index.php プロジェクト: Belthazor2008/googulator
     mysql_close($con);
     $defaultTab = array_search("play", $tabs);
 } else {
     if (strpos($requestURI, "/play/") === 0) {
         $gameid = substr($requestURI, strlen("/play/"));
         echo "<link rel='image_src' href='http";
         echo $https;
         echo "://";
         echo $hostName;
         echo "/img/ROMPictures/";
         echo $gameid;
         echo ".jpg'>";
         $title .= " - ";
         $con = mysql_connect('localhost', $MYSQL_USERNAME, $MYSQL_PASSWORD);
         mysql_select_db($MYSQL_DATABASE, $con);
         $title .= getGameTitle(urldecode($gameid), $con);
         mysql_close($con);
         $defaultTab = array_search("play", $tabs);
     } else {
         if (strpos($requestURI, "/gameboy") === 0 || strpos($requestURI, "/nes") === 0 || strpos($requestURI, "/play") === 0) {
             $title .= " - Play";
             $defaultTab = array_search("play", $tabs);
         } else {
             if (strpos($requestURI, "/goPro") === 0) {
                 $title .= " - Go Pro";
                 $defaultTab = array_search("goPro", $tabs);
             } else {
                 if (strpos($requestURI, "/admin") === 0) {
                     $title .= " - Administrative Center";
                     $defaultTab = array_search("admin", $tabs);
                 } else {
コード例 #2
0
ファイル: listFree.php プロジェクト: Belthazor2008/googulator
<?php

header('Content-type: application/json');
require_once "../configuration.php";
require_once "../include.php";
$con = mysql_connect($MYSQL_HOSTNAME, $MYSQL_USERNAME, $MYSQL_PASSWORD);
if (!$con) {
    die("-1");
}
if (!mysql_select_db($MYSQL_DATABASE, $con)) {
    mysql_close($con);
    die("-2");
}
$query = mysql_query("select * from freeGames where 1;", $con);
$games = array();
while ($row = mysql_fetch_assoc($query)) {
    $element = array();
    if ($row["fileName"] === "" || $row["fileName"] == NULL) {
        $element["fileName"] = NULL;
        $element["path"] = NULL;
    } else {
        $element["fileName"] = $row["fileName"];
        $element["path"] = "/ROM/" . $row["fileName"];
    }
    $element["image"] = "/img/ROMPictures/" . $row["gameid"] . ".png";
    $element["id"] = $row["gameid"];
    $element["title"] = getGameTitle($row["gameid"], $con);
    array_push($games, $element);
}
mysql_close($con);
echo str_replace('\\/', '/', json_encode($games));
コード例 #3
0
    $google_token = stripslashes($_GET["googletoken"]);
} else {
    $google_token = $_GET["googletoken"];
}
$google_id = getGoogleId($google_token);
if ($google_id == null) {
    die("-1");
}
$con = mysql_connect($MYSQL_HOSTNAME, $MYSQL_USERNAME, $MYSQL_PASSWORD);
if (!$con) {
    die("-2");
}
if ($AUTO_ESCAPE) {
    $uid = $_GET["uid"];
} else {
    $uid = mysql_real_escape_string($_GET["uid"], $con);
}
if (!mysql_select_db($MYSQL_DATABASE, $con)) {
    mysql_close($con);
    die("-3");
}
mysql_query("update gameLibrary set usergivenname=NULL where googleid='{$google_id}' and uid={$uid} limit 1;", $con);
if (mysql_affected_rows($con) != 1) {
    mysql_close($con);
    die("-4");
}
$row = mysql_fetch_assoc(mysql_query("select * from gameLibrary where googleid='{$google_id}' and uid={$uid} limit 1;", $con));
echo "{\"title\":\"";
echo getGameTitle($row["gameid"], $con);
echo "\"}";
mysql_close($con);