$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 Books(); $book = $b->getBookInfo($data['bookinfoid']); } $con = ''; if ($data['consoleinfoid'] != '') { $c = new Konsole(); $con = $c->getConsoleInfo($data['consoleinfoid']); } $AniDBAPIArray = ''; if ($data["anidbid"] > 0) { $AniDB = new AniDB(['Settings' => $releases->pdo]); $AniDBAPIArray = $AniDB->getAnimeInfo($data["anidbid"]); } $predbQuery = ''; if ($data["preid"] > 0) { $PreDB = new PreDB(); $predbQuery = $PreDB->getByID($data["preid"]); } $prehash = new PreHash(); $pre = $prehash->getForRelease($data["prehashid"]); $rf = new ReleaseFiles();
<?php if (!$page->users->isLoggedIn()) { $page->show403(); } $console = new Konsole(['Settings' => $page->settings]); $cat = new Category(['Settings' => $page->settings]); $gen = new Genres(['Settings' => $page->settings]); $concats = $cat->getChildren(Category::CAT_PARENT_GAME); $ctmp = []; foreach ($concats as $ccat) { $ctmp[$ccat['id']] = $ccat; } $category = Category::CAT_PARENT_GAME; if (isset($_REQUEST["t"]) && array_key_exists($_REQUEST['t'], $ctmp)) { $category = $_REQUEST["t"] + 0; } $catarray = []; $catarray[] = $category; $page->smarty->assign('catlist', $ctmp); $page->smarty->assign('category', $category); $browsecount = $console->getConsoleCount($catarray, -1, $page->userdata["categoryexclusions"]); $offset = isset($_REQUEST["offset"]) && ctype_digit($_REQUEST['offset']) ? $_REQUEST["offset"] : 0; $ordering = $console->getConsoleOrdering(); $orderby = isset($_REQUEST["ob"]) && in_array($_REQUEST['ob'], $ordering) ? $_REQUEST["ob"] : ''; $results = $consoles = []; $results = $console->getConsoleRange($catarray, $offset, ITEMS_PER_COVER_PAGE, $orderby, $page->userdata["categoryexclusions"]); $maxwords = 50; foreach ($results as $result) { if (!empty($result['review'])) { $words = explode(' ', $result['review']);
<?php //This script will update all records in the consoleinfo table require_once dirname(__FILE__) . '/../../../www/config.php'; use newznab\db\Settings; $pdo = new Settings(); $console = new \Konsole(['Echo' => true, 'Settings' => $pdo]); $res = $pdo->queryDirect(sprintf("SELECT searchname, id FROM releases WHERE consoleinfoid IS NULL AND categoryid BETWEEN 1000 AND 1999 ORDER BY id DESC")); if ($res instanceof \Traversable) { echo $pdo->log->header("Updating console info for " . number_format($res->rowCount()) . " releases."); foreach ($res as $arr) { $starttime = microtime(true); $gameInfo = $console->parseTitle($arr['searchname']); if ($gameInfo !== false) { $game = $console->updateConsoleInfo($gameInfo); if ($game === false) { echo $pdo->log->primary($gameInfo['release'] . ' not found'); } } // amazon limits are 1 per 1 sec $diff = floor((microtime(true) - $starttime) * 1000000); if (1000000 - $diff > 0) { echo $pdo->log->alternate("Sleeping"); usleep(1000000 - $diff); } } }