$page = EHeaderDataParser::db_get("page"); $user = EHeaderDataParser::db_get("user"); if (!$from) { $from = "new"; } if (!$label) { $label = ""; } if (!$page) { $page = 1; } if (!$user) { $user = ""; } $client = new OCSClient(); $games = $client->get("v1/content/data?search={$label}&page={$page}&pagesize=50&sortmode={$from}&user={$user}"); EStructure::code(); if (isset($games["ocs"]["data"]["content"])) { if (isset($games["ocs"]["data"]["content"]["id"])) { $game = $games["ocs"]["data"]["content"]; echo "\n\t\t\t\t<div class=\"span6\">\n\t\t\t\t<div class=\"row\">\n\t\t\t\t <div class=\"span2\"><img src=\"" . $game["preview1"] . "\"></div>\n\t\t\t\t <div class=\"span4\"><h3><a href=\"/game.php/id/" . stripslashes($game["id"]) . "/title/" . ERewriter::prettify(stripslashes($game["name"])) . "\">" . stripslashes($game["name"]) . "</a></h3>\n\t\t\t\t <div class=\"static-rating\" id=\"" . $game["score"] . "_" . $game["id"] . "\"></div>\n\t\t\t\t <p>" . stripslashes($game["summary"]) . "</p>\n\t\t\t\t from <a data-toggle=\"modal\" href=\"#viewSelfProfileModal\" class=\"modalButton\" target=\"/viewProfileModal.php?login="******"personid"] . "\">" . $game["personid"] . "</a>\n\t\t\t\t </div>\n\t\t\t\t </div>\n\t\t\t\t <hr>\n\t\t\t\t </div>"; } else { foreach ($games["ocs"]["data"]["content"] as $game) { echo "\n\t\t\t\t<div class=\"span6\">\n\t\t\t\t<div class=\"row\">\n\t\t\t\t <div class=\"span2\"><img src=\"" . $game["preview1"] . "\"></div>\n\t\t\t\t <div class=\"span4\"><h3><a href=\"/game.php/id/" . stripslashes($game["id"]) . "/title/" . ERewriter::prettify(stripslashes($game["name"])) . "\">" . stripslashes($game["name"]) . "</a></h3>\n\t\t\t\t <div class=\"static-rating\" id=\"" . $game["score"] . "_" . $game["id"] . "\"></div>\n\t\t\t\t <p>" . stripslashes($game["summary"]) . "</p>\n\t\t\t\t from <a data-toggle=\"modal\" href=\"#viewSelfProfileModal\" class=\"modalButton\" target=\"/viewProfileModal.php?login="******"personid"] . "\">" . $game["personid"] . "</a>\n\t\t\t\t </div>\n\t\t\t\t </div>\n\t\t\t\t <hr>\n\t\t\t\t </div>"; } } } else { echo "Nothing found :("; } EStructure::insert("game_list"); EStructure::unload();
<?php include_once "../gfx3/lib.php"; $main = new EMain(); $temp = new EStructure(); $temp->code(); echo "<p style=\"color:green;\">Working!</p>"; $temp->insert("corelibs"); $temp->code(); $db = new EDatabase(); if ($db->status() == 0) { echo "<p style=\"color:green;\">Working!</p>"; } elseif ($db->status() == 1) { echo "<p style=\"color:red;\">No database found!</p>"; } else { echo "<p style=\"color:red;\">Connection refused!</p>"; } $temp->insert("database"); $temp->code(); echo "<p style=\"color:green;\">Working!</p>"; $temp->insert("templates");
$client->set_auth_info(EUser::nick(), EUser::password()); $isfan = $client->get("v1/fan/status/{$gameid}"); if ($isfan["ocs"]["data"]["status"] == "notfan") { echo "<a class=\"btn btn-success\" href=\"/becomeFan.php?id={$gameid}\"><i class=\"icon-thumbs-up icon-white\"></i> Like this!</a>"; } else { echo "<a class=\"btn btn-success\" href=\"/removeFan.php?id={$gameid}\"><i class=\"icon-thumbs-down icon-white\"></i> Don't like \nthis!</a>"; } } else { echo "<a class=\"btn btn-success\" href=\"#\"><i class=\"icon-thumbs-up icon-white\"></i> Log in to vote!</a>"; } EStructure::insert("becomefan_button"); EStructure::code(); $score = $data["ocs"]["data"]["content"]["score"]; echo "<div class=\"dynamic-rating\" id=\"" . $score . "_" . $gameid . "\"></div>"; EStructure::insert("setscore_button"); EStructure::code(); $score = $data["ocs"]["data"]["content"]["score"]; echo "<div class=\"static-rating\" id=\"" . $score . "_" . $gameid . "\"></div>"; EStructure::insert("averagescore"); EStructure::code(); $comments = $client->get("v1/comments/data/1/{$gameid}/1&page=1&pagesize=10"); if (isset($comments["ocs"]["data"]["comment"])) { foreach ($comments["ocs"]["data"]["comment"] as $comment) { echo "<div class=\"span6 columns\">\n\t\t\t\t<h4>" . EUtility::stripslashes($comment["subject"]) . "</h4>\n\t\t\t\t<div class=\"span6\">" . EUtility::stripslashes($comment["text"]) . "</div>\n\t\t\t\twritten by <a data-toggle=\"modal\" href=\"#viewSelfProfileModal\" class=\"modalButton bold\" target=\"/viewProfileModal.php?login="******"user"] . "\">" . $comment["user"] . "</a>\n\t\t\t\t<hr>\n\t\t\t\t</div>"; } } else { echo "No comments found :(."; } echo "<div class=\"span6 columns\">\n\t<form class=\"form-vertical\" action=\"/addComment.php\" target=\"_self\" method=\"post\">\n\t<table style=\"width:100%\">\n <tr><td><input type=\"hidden\" name=\"type\" value=\"1\">\n <input type=\"hidden\" name=\"content\" value=\"{$gameid}\">\n <input type=\"hidden\" name=\"content2\" value=\"1\">\n <input type=\"hidden\" name=\"parent\" value=\"0\">\n <input type=\"text\" name=\"subject\" placeholder=\"Subject\" style=\"width:100%\"></td></tr>\n <br>\n <tr><td><textarea name=\"message\" class=\"input-xlarge\" style=\"width:100%\"></textarea><br></td></tr>\n <tr><td><input type=\"submit\" class=\"btn btn-warning\" value=\"Write\"></td></tr>\n </table>\n </form>\n\t</div>"; EStructure::insert("game_comments"); EStructure::unload();