示例#1
0
<?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>";
        }
示例#2
0
文件: game.php 项目: KDE/ocs-server
<?php

include "gfx3/lib.php";
$gameid = EHeaderDataParser::db_get("id");
EStructure::load("game");
$client = new OCSClient();
$data = $client->get("v1/content/data/{$gameid}/");
if (EUser::nick() == $data["ocs"]["data"]["content"]["personid"]) {
    EStructure::module("mod_game_menu", "mod_game");
}
EStructure::code();
echo stripslashes($data["ocs"]["data"]["content"]["name"]);
Estructure::insert("game_title");
EStructure::code();
echo stripslashes($data["ocs"]["data"]["content"]["summary"]);
Estructure::insert("game_summary");
//features
EStructure::code();
echo stripslashes($data["ocs"]["data"]["content"]["description"]);
Estructure::insert("game_description");
EStructure::code();
echo stripslashes($data["ocs"]["data"]["content"]["changelog"]);
Estructure::insert("game_changelog");
EStructure::code();
$person = $data["ocs"]["data"]["content"]["personid"];
echo "<a data-toggle=\"modal\" href=\"#viewSelfProfileModal\" class=\"modalButton bold\" target=\"/viewProfileModal.php?login={$person}\">{$person}</a>";
Estructure::insert("game_author");
EStructure::code();
echo stripslashes($data["ocs"]["data"]["content"]["version"]);
Estructure::insert("game_version");
EStructure::code();