예제 #1
0
<?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    ";
예제 #2
0
파일: game.php 프로젝트: KDE/ocs-server
    $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();