<?php //loading EUser if (!EUser::logged()) { $output = "\n\t<li class=\"dropdown\">\n <a href=\"#\"\n class=\"dropdown-toggle\"\n data-toggle=\"dropdown\">\n Account\n <b class=\"caret\"></b>\n </a>\n <ul class=\"dropdown-menu\">\n <li><a data-toggle=\"modal\" href=\"#loginModal\" id=\"loginButton\" class=\"modalButton\" target=\"/loginModal.php\">Login</a></li>\n <li class=\"divider\"></li>\n <li><a data-toggle=\"modal\" href=\"#registerModal\" id=\"registerButton\" class=\"modalButton\" target=\"/registerModal.php\">Register</a></li>\n <li><a href=\"#\">Forgot password</a></li>\n </ul>\n </li>\n \n <div class=\"modal hide\" id=\"loginModal\">\n </div>\n \n <div class=\"modal hide\" id=\"registerModal\">\n </div>\n "; } else { $output = "\n\t<li class=\"dropdown\">\n <a href=\"#\"\n class=\"dropdown-toggle\"\n data-toggle=\"dropdown\">\n Welcome " . EUser::nick() . "!\n <b class=\"caret\"></b>\n </a>\n <ul class=\"dropdown-menu\">\n <li><a href=\"/gamelist.php/user/" . EUser::nick() . "\">My games</a></li>\n <li><a data-toggle=\"modal\" href=\"#addGameModal\" class=\"modalButton\" target=\"/addGameModal.php\">Add game</a></li>\n <li class=\"divider\"></li>\n <li><a data-toggle=\"modal\" href=\"#viewSelfProfileModal\" class=\"modalButton\" target=\"/viewProfileModal.php?id=" . EUser::id() . "\">View profile</a></li>\n <li class=\"divider\"></li>\n <li><a href=\"/logout.php\">Logout</a></li>\n </ul>\n </li>\n \n <div class=\"modal hide\" id=\"viewSelfProfileModal\"></div>\n <div class=\"modal hide\" id=\"addGameModal\"></div>\n \n\t"; } echo "<div class=\"modal hide\" id=\"genericModal\"></div>"; echo $output;
public static function refresh() { $r = EDatabase::q("SELECT * FROM ocs_person WHERE login='******' AND password='******' LIMIT 1"); while ($row = mysql_fetch_array($r)) { EUser::$nick = $_SESSION['nick'] = $row['login']; EUser::$id = $_SESSION['id'] = $row['id']; EUser::$group = $_SESSION['group'] = $row['tgroup']; EUser::$logged = true; EUser::$mail = $_SESSION['mail'] = $row['email']; } return EUser::$logged(); }
$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(); echo "<div class=\"active item\"><img src=\"" . $data["ocs"]["data"]["content"]["preview1"] . "\" class=\"myradius\">\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"item\"><img src=\"" . $data["ocs"]["data"]["content"]["preview2"] . "\" class=\"myradius\">\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"item\"><img src=\"" . $data["ocs"]["data"]["content"]["preview3"] . "\" class=\"myradius\">\n\t\t\t\t\t</div>"; EStructure::insert("carousel_images"); EStructure::code(); if (!empty($data["ocs"]["data"]["content"]["downloadlink1"])) { echo "<a class=\"btn btn-primary\" href=\"" . $data["ocs"]["data"]["content"]["downloadlink1"] . "\"><i class=\"icon-download icon-white\"></i> " . $data["ocs"]["data"]["content"]["downloadname1"] . "</a>"; } EStructure::insert("download_button"); EStructure::code(); if (EUser::logged()) { $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");