if (isset($xxx['trailers'])) { $xxx['trailers'] = $x->insertSwf($xxx['classused'], $xxx['trailers']); } if ($xxx && isset($xxx['title'])) { $xxx['title'] = str_replace(array('/', '\\'), '', $xxx['title']); $xxx['actors'] = $x->makeFieldLinks($xxx, 'actors'); $xxx['genre'] = $x->makeFieldLinks($xxx, 'genre'); $xxx['director'] = $x->makeFieldLinks($xxx, 'director'); } else { $xxx = false; } } $game = ''; if ($data['gamesinfo_id'] != '') { $g = new Games(); $game = $g->getGamesInfo($data['gamesinfo_id']); } $mus = ''; if ($data['musicinfoid'] != '') { $music = new Musik(['Settings' => $page->settings]); $mus = $music->getMusicInfo($data['musicinfoid']); } $book = ''; if ($data['bookinfoid'] != '') { $b = new Book(); $book = $b->getBookInfo($data['bookinfoid']); } $con = ''; if ($data['consoleinfoid'] != '') { $c = new Console(); $con = $c->getConsoleInfo($data['consoleinfoid']);
<?php require_once "config.php"; $page = new AdminPage(); $games = new Games(['Settings' => $page->settings]); $gen = new Genres(['Settings' => $page->settings]); $id = 0; // Set the current action. $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : 'view'; if (isset($_REQUEST["id"])) { $id = $_REQUEST["id"]; $game = $games->getGamesInfo($id); if (!$game) { $page->show404(); } switch ($action) { case 'submit': $coverLoc = NN_COVERS . "games/" . $id . '.jpg'; if ($_FILES['cover']['size'] > 0) { $tmpName = $_FILES['cover']['tmp_name']; $file_info = getimagesize($tmpName); if (!empty($file_info)) { move_uploaded_file($_FILES['cover']['tmp_name'], $coverLoc); } } $_POST['cover'] = file_exists($coverLoc) ? 1 : 0; $_POST['releasedate'] = empty($_POST['releasedate']) || !strtotime($_POST['releasedate']) ? $game['releasedate'] : date("Y-m-d H:i:s", strtotime($_POST['releasedate'])); $games->update($id, $_POST["title"], $_POST['asin'], $_POST['url'], $_POST["publisher"], $_POST["releasedate"], $_POST["esrb"], $_POST["cover"], $_POST['trailerurl'], $_POST["genre"]); header("Location:" . WWW_TOP . "/game-list.php"); die; break;