File indexing completed on 2024-04-28 17:10:15

0001 <?php
0002 
0003 include("gfx3/lib.php");
0004 
0005 EStructure::load("gamelist");
0006 
0007 $from = EHeaderDataParser::db_get("from");
0008 $label = EHeaderDataParser::db_get("label");
0009 $page = EHeaderDataParser::db_get("page");
0010 $user = EHeaderDataParser::db_get("user");
0011 
0012 if(!$from){
0013   $from = "new";
0014 }
0015 if(!$label){
0016   $label = "";
0017 }
0018 if(!$page){
0019   $page = 1;
0020 }
0021 if(!$user){
0022   $user = "";
0023 }
0024 
0025 $client = new OCSClient();
0026 $games = $client->get("v1/content/data?search=$label&page=$page&pagesize=50&sortmode=$from&user=$user");
0027 
0028 EStructure::code();
0029   if(isset($games["ocs"]["data"]["content"])){
0030     if(isset($games["ocs"]["data"]["content"]["id"])){
0031       $game = $games["ocs"]["data"]["content"];
0032         echo "
0033         <div class=\"span6\">
0034         <div class=\"row\">
0035          <div class=\"span2\"><img src=\"".$game["preview1"]."\"></div>
0036          <div class=\"span4\"><h3><a href=\"/game.php/id/".stripslashes($game["id"])."/title/".ERewriter::prettify(stripslashes($game["name"]))."\">".stripslashes($game["name"])."</a></h3>
0037          <div class=\"static-rating\" id=\"".$game["score"]."_".$game["id"]."\"></div>
0038          <p>".stripslashes($game["summary"])."</p>
0039          from <a data-toggle=\"modal\" href=\"#viewSelfProfileModal\" class=\"modalButton\" target=\"/viewProfileModal.php?login=".$game["personid"]."\">".$game["personid"]."</a>
0040          </div>
0041          </div>
0042          <hr>
0043          </div>";
0044     } else {
0045       foreach($games["ocs"]["data"]["content"] as $game){
0046         echo "
0047         <div class=\"span6\">
0048         <div class=\"row\">
0049          <div class=\"span2\"><img src=\"".$game["preview1"]."\"></div>
0050          <div class=\"span4\"><h3><a href=\"/game.php/id/".stripslashes($game["id"])."/title/".ERewriter::prettify(stripslashes($game["name"]))."\">".stripslashes($game["name"])."</a></h3>
0051          <div class=\"static-rating\" id=\"".$game["score"]."_".$game["id"]."\"></div>
0052          <p>".stripslashes($game["summary"])."</p>
0053          from <a data-toggle=\"modal\" href=\"#viewSelfProfileModal\" class=\"modalButton\" target=\"/viewProfileModal.php?login=".$game["personid"]."\">".$game["personid"]."</a>
0054          </div>
0055          </div>
0056          <hr>
0057          </div>";
0058       }
0059     }
0060   } else {
0061     echo "Nothing found :(";
0062   }
0063 EStructure::insert("game_list");
0064 
0065 EStructure::unload();
0066 
0067 ?>