if ($check->num_rows == 0) { $message = "Your GameQue on " . $setting['sitename'] . " is empty. To continue to have games installed on schedule, please add more games to your queue via the Admin game feeds' management pages."; $headers = 'From: ' . $setting['sitename'] . ' GameQueue<' . $setting['sitename'] . '>'; $subject = 'The GameQue on' . $setting['sitename'] . ' is empty'; @mail($setting['email'], $subject, $message, $headers); } else { include_once $setting['sitepath'] . "/admin/gamefeed_installs.php"; $success = false; while ($row = $check->fetch_array(MYSQLI_ASSOC)) { switch ($row['source']) { case 'mochi': $installed = yasDB_select("SELECT `id` FROM `games` WHERE `source` = 'MOCHI' AND `sourceid` = " . $row['sourceid']); if ($installed->num_rows > 0) { $success = true; } else { $success = install_mochigame($row['sourceid']); } break; case 'fgd': $installed = yasDB_select("SELECT `id` FROM `games` WHERE `source` = 'FGD' AND `sourceid` = " . $row['sourceid']); if ($installed->num_rows > 0) { $success = true; } else { $success = install_fgdgame($row['sourceid']); } break; case 'fog': $installed = yasDB_select("SELECT `id` FROM `games` WHERE `source` = 'FOG' AND `sourceid` = " . $row['sourceid']); if ($installed->num_rows > 0) { $success = true; } else {
echo ' <a href="index.php?act=managemochi&page=1&category=' . $category . '&rating=' . $rating . '&description=' . $description . '&keywords=' . $keywords . '&filter=Filter games">FIRST</a>'; $prevpage = $pageno - 1; echo ' <a href="index.php?act=managemochi&page=' . $prevpage . '&category=' . $category . '&rating=' . $rating . '&description=' . $description . '&keywords=' . $keywords . '&filter=Filter games">PREV</a>'; } echo ' ( Page ' . $pageno . ' of ' . $lastpage . ' ) '; if ($pageno == $lastpage) { echo ' NEXT LAST '; } else { $nextpage = $pageno + 1; echo ' <a href="index.php?act=managemochi&page=' . $nextpage . '&category=' . $category . '&rating=' . $rating . '&description=' . $description . '&keywords=' . $keywords . '&filter=Filter games">NEXT</a>'; echo ' <a href="index.php?act=managemochi&page=' . $lastpage . '&category=' . $category . '&rating=' . $rating . '&description=' . $description . '&keywords=' . $keywords . '&filter=Filter games">LAST</a>'; } echo '</div>'; if (isset($_GET['install'])) { if ($_GET['install'] == 'Install') { install_mochigame($_GET['gameid']) or die("Game did not install successfully"); echo '<script>alert("Game sucessfully installed.");</script>'; if (isset($_GET['page'])) { $pageno = $_GET['page']; } else { $pageno = 1; } if (isset($_GET['category'])) { $category = $_GET['category']; } else { $category = 'all'; } if (isset($_GET['rating'])) { $rating = $_GET['rating']; } else { $rating = 'all';
} while ($_SESSION['count'] < $GLOBALS['numgames']) { sleep(1); $row = $query->fetch_array(MYSQLI_ASSOC); $_SESSION['count']++; ?> <SCRIPT> d = document.getElementById("message"); d.innerHTML = "<?php echo 'Installing Game ' . $_SESSION['count'] . ' of ' . $GLOBALS['numgames']; ?> "; </SCRIPT> <?php flush2(); $success = install_mochigame($row['id']); if (!$success) { ?> <SCRIPT> d = document.getElementById("message"); d.innerHTML = "<?php echo 'Error installing ' . $row['name']; ?> "; </SCRIPT> <div ID="continue"> <?php echo '<p><center>| <a href="index.php?act=managemochi">Continue</a> |</p></center>'; ?> </div> </div>