public function register() { $mail = EHeaderDataParser::db_get("mail"); $nick = EHeaderDataParser::db_get("nick"); $res = $this->find("verified", "where mail=\"" . $mail . "\" LIMIT 1"); if (isset($res[0])) { if ($res[0]["verified"] == "yes") { return 101; } } $res = $this->find("verified", "where nick=\"" . $nick . "\" LIMIT 1"); if (isset($res[0])) { if ($res[0]["verified"] == "yes") { return 102; } } $this->delete("mail=\"" . $mail . "\""); $this->insert(array("nick", "pass", "mail", "verified")); return 100; }
<?php include "gfx3/lib.php"; $gameid = EHeaderDataParser::db_get("id"); $client = new OCSClient(); $data = $client->get("v1/content/data/{$gameid}/"); if (EUser::nick() != $data["ocs"]["data"]["content"]["personid"]) { ELog::error("You are not authorized to view this page!"); } echo "<div class=\"modal-header\">\n <button type=\"button\" class=\"close\" data-dismiss=\"modal\">×</button>\n <h3>Modify your game</h3>\n </div>\n \n <form class=\"form-horizontal\" action=\"/editGameAction.php\" target=\"_self\" method=\"post\">\n <div class=\"modal-body\">\n <fieldset>\n \n <div class=\"control-group\">\n <label class=\"control-label\" for=\"name\">Title</label>\n <div class=\"controls\">\n <input type=\"text\" name=\"name\" class=\"input-xlarge\" id=\"name\" value=\"" . EUtility::stripslashes($data["ocs"]["data"]["content"]["name"]) . "\">\n <input type=\"hidden\" name=\"idcontent\" class=\"input-xlarge\" id=\"idcontent\" value=\"{$gameid}\">\n </div>\n </div>\n \n <div class=\"control-group\">\n <label class=\"control-label\" for=\"downloadname1\">Download name</label>\n <div class=\"controls\">\n <input type=\"text\" name=\"downloadname1\" class=\"input-xlarge\" id=\"downloadname1\" \nvalue=\"" . EUtility::stripslashes($data["ocs"]["data"]["content"]["downloadname1"]) . "\">\n <p class=\"help-block\">- this is the label that will be shown to download your game</p>\n </div>\n </div>\n \n <div class=\"control-group\">\n <label class=\"control-label\" for=\"downloadlink1\">Download link</label>\n <div class=\"controls\">\n <input type=\"text\" name=\"downloadlink1\" class=\"input-xlarge\" id=\"downloadlink1\" \nvalue=\"" . EUtility::stripslashes($data["ocs"]["data"]["content"]["downloadlink1"]) . "\">\n <p class=\"help-block\">- this is the direct link to your game. If you want to host it on gamingfreedom server, you can do it uploading\n it after having created this skeleton</p>\n </div>\n </div>\n \n <div class=\"control-group\">\n <label class=\"control-label\" for=\"description\">Summary</label>\n <div class=\"controls\">\n <textarea cols=\"60\" rows=\"3\" name=\"summary\" class=\"input-xlarge\" \nid=\"summary\">" . EUtility::br2nl(EUtility::stripslashes($data["ocs"]["data"]["content"]["summary"])) . "</textarea>\n <p class=\"help-block\">- A short description to your game</p>\n </div>\n </div>\n \n <div class=\"control-group\">\n <label class=\"control-label\" for=\"description\">Features</label>\n <div class=\"controls\">\n <textarea cols=\"60\" rows=\"3\" name=\"description\" class=\"input-xlarge\" \nid=\"description\">" . EUtility::br2nl(EUtility::stripslashes($data["ocs"]["data"]["content"]["description"])) . "</textarea>\n <p class=\"help-block\">- A more in depth description and a list of features.</p>\n </div>\n </div>\n \n <div class=\"control-group\">\n <label class=\"control-label\" for=\"version\">Version</label>\n <div class=\"controls\">\n <input type=\"text\" name=\"version\" class=\"input-xlarge\" id=\"version\" \nvalue=\"" . EUtility::stripslashes($data["ocs"]["data"]["content"]["version"]) . "\">\n <p class=\"help-block\">- set here the version of your application</p>\n </div>\n </div>\n \n <div class=\"control-group\">\n <label class=\"control-label\" for=\"changelog\">Changelog</label>\n <div class=\"controls\">\n <textarea cols=\"60\" rows=\"3\" name=\"changelog\" class=\"input-xlarge\" \nid=\"changelog\">" . EUtility::stripslashes(EUtility::br2nl($data["ocs"]["data"]["content"]["changelog"])) . "</textarea>\n <p class=\"help-block\">- putting changelog helps your fans to know what is changed and what improvements\n have you put</p>\n </div>\n </div>\n \n </fieldset>\n \n </div>\n <div class=\"modal-footer\" style=\"background-color:#FFFFFF;\">\n <input type=\"submit\" class=\"btn btn-primary\" value=\"Next\">\n </div>\n \n </form>\n ";
public static function secure_get($key) { return EHeaderDataParser::db_get($key); }
<?php include "gfx3/lib.php"; $idcontent = EHeaderDataParser::db_get("id"); $postdata = array("contentid" => $idcontent); $client = new OCSClient(); $client->set_auth_info(EUser::nick(), EUser::password()); $client->set_post_data($postdata); $result = $client->post("v1/content/delete/{$idcontent}"); header("Location: /gamelist.php/user/" . EUser::nick());
<?php include "gfx3/lib.php"; EStructure::load("gamelist"); $from = EHeaderDataParser::db_get("from"); $label = EHeaderDataParser::db_get("label"); $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>"; }
<?php include "gfx3/lib.php"; $prevpage = EPageProperties::get_previous_page(); $contentid = EHeaderDataParser::db_get("id"); $client = new OCSClient(); $client->set_auth_info(EUser::nick(), EUser::password()); $addfan = $client->post("v1/fan/remove/{$contentid}"); ELog::pd($client->get_last_raw_result()); if ($addfan["ocs"]["meta"]["statuscode"] == "100") { header("Location: {$prevpage}"); } else { ELog::pd($addfan); }
<?php include "gfx3/lib.php"; if (EHeaderDataParser::exists_get("id")) { $id = EHeaderDataParser::db_get("id"); $users = new EData("ocs_person"); $user_info = $users->find("firstname,lastname,email,login", "where id={$id} limit 1"); $user_info = $user_info[0]; //taking first element } elseif (EHeaderDataParser::exists_get("login")) { $login = EHeaderDataParser::db_get("login"); $users = new EData("ocs_person"); $user_info = $users->find("firstname,lastname,email,login", "where login='******' limit 1"); $user_info = $user_info[0]; //taking first element } echo "\n<div class=\"modal-header\">\n <button type=\"button\" class=\"close\" data-dismiss=\"modal\">×</button>\n <h3>Personal info of " . $user_info["firstname"] . " " . $user_info["lastname"] . "</h3>\n</div>\n\n <div class=\"modal-body\">\n <table class=\"mytable\">\n\t\t<tr><td>First Name:</td><td><span class=\"right\">" . $user_info["firstname"] . "</span></td></tr>\n\t\t<tr><td>Last Name:</td><td><span class=\"right\">" . $user_info["lastname"] . "</span></td></tr>\n\t\t<tr><td>User Name:</td><td><span class=\"right\">" . $user_info["login"] . "</span></td></tr>\n\t\t<tr><td>E-mail:</td><td><span class=\"right\">" . $user_info["email"] . "</span></td></tr>\n </table>\n <br>\n <a href=\"#\">Find all games from this user</a><br>\n\t<a href=\"#\">Find all games liked by this user</a>\n </div>\n \n <div class=\"modal-footer\" style=\"background-color:#F5F5F5;\">\n <a href=\"#\" class=\"btn\" data-dismiss=\"modal\">Close</a>\n </div>\n\n ";
<?php include "gfx3/lib.php"; $idcontent = EHeaderDataParser::db_get("id"); $n = EHeaderDataParser::db_get("n"); echo "<div class=\"modal-header\">\n <button type=\"button\" class=\"close\" data-dismiss=\"modal\">×</button>\n <h3>Upload a screenshot</h3>\n </div>\n \n <form class=\"form-horizontal\" action=\"/addScreenShotGameAction.php\" enctype=\"multipart/form-data\" target=\"_self\" method=\"post\">\n <div class=\"modal-body\">\n <fieldset>\n \n <div class=\"control-group\">\n <label class=\"control-label\" for=\"name\">Image</label>\n <div class=\"controls\">\n <input type=\"file\" name=\"localfile\" class=\"input-xlarge\" id=\"localfile\">\n <input type=\"hidden\" name=\"idcontent\" class=\"input-xlarge\" id=\"idcontent\" value=\"{$idcontent}\">\n <input type=\"hidden\" name=\"number\" class=\"input-xlarge\" id=\"number\" value=\"{$n}\">\n <input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"10000000\" /> \n </div>\n </div>\n \n </fieldset>\n \n </div>\n <div class=\"modal-footer\" style=\"background-color:#FFFFFF;\">\n <input type=\"submit\" class=\"btn btn-primary\" value=\"Next\">\n </div>\n \n </form>";