define('BAYONET_CONFIG', BAYONET_ROOT . '/include/config.php'); require BAYONET_INCLUDE . '/debug.php'; require BAYONET_INCLUDE . '/sql.class.php'; require BAYONET_INCLUDE . '/functions.php'; Bayonet_Config::init(); $config = Bayonet_Config::$ini; $db = new Bayonet_SQL(); //Connect to the MySQL server $db->Connect($config['sql']['hostname'], $config['sql']['username'], $config['sql']['password']); $db->Select_db($config['sql']['database']); /*----------------------------- */ $action = $_POST['action']; $updateRecordsArray = $_POST['recordsArray']; if ($action == "updateReelOrder") { $listingCounter = 1; foreach ($updateRecordsArray as $recordIDValue) { $db->Query("UPDATE `bayonet_newsreel` SET `weight` = '{$listingCounter}' WHERE `slide_id` = '{$recordIDValue}'"); $listingCounter = $listingCounter + 1; } echo "<img src=\"images/accepted.png\" />"; /* echo '<pre>'; print_r($updateRecordsArray); echo '</pre>'; echo 'If you refresh the page, you will see that records will stay just as you modified.'; */ } else { echo "<img src=\"images/rejected.png\" />"; } date_default_timezone_set("America/New_York"); echo " Updated at " . date("g:i:s a", time());
//$config['logs']['dir'] = "../logs/"; include 'header.php'; if (!defined("MODULE_FILE")) { //die("Access denied."); } define("ADMIN_FILE", 'admin_file'); include 'admin_functions.php'; if (isset($_GET['op']) && $_GET['op'] == 'logout') { logout(); } if (login()) { //this is so dirty... sigh. if (is_loggedin()) { //GET ADMIN USER INFO - DEFINE IMPORTANT INFO $username = $_SESSION['username']; $result = $db->Query("SELECT user_id, level FROM bayonet_users WHERE username = '******' LIMIT 1"); $row = $db->FetchRow($result); define("ADMIN_USERNAME", $username); define("ADMIN_ID", $row['user_id']); define("ADMIN_LEVEL", $row['level']); if (isset($_GET['op'])) { ?> <script type="text/javascript"> window.location = window.location+"#operation"; </script> <?php } ?> <center> <div class="wrapper">
function GetBlocks($position = BLOCK_LEFT) { global $config; /** * I had to reconnect to the database for some f*****g reason at this point. * I have no idea why, but I was recieving errors telling me that $db was no longer * an object. This is/was bullshit. */ $db = new Bayonet_SQL(); $db->Connect($config['sql']['hostname'], $config['sql']['username'], $config['sql']['password']); $db->Select_db($config['sql']['database']); $result = $db->Query("SELECT * FROM `bayonet_blocks` ORDER BY weight, position"); $blocks = $db->Fetch($result); foreach ($blocks as $block) { if ($block['position'] == $position && $block['active'] == true) { $load = 'blocks/' . $block['dir_name'] . '/index.php'; if (file_exists($load)) { OpenBlock($block['title']); include $load; CloseBlock(); } else { ReportError("Failed to load block, '{$block['dir_name']}'. Check block config."); } if ($config['blocks']['spacer']) { echo "<br />"; } } } }