<?php // Load the Savant3 class file and create an instance. require_once '../Savant3.php'; session_start(); // initialize template engine $tpl = new Savant3(); $id = $_SESSION['user_id']; $email = $_SESSION['email']; // set search path for templates $tpl->addPath('template', '../template'); // Create a title. $template_path = "../template/"; $resource_path = "../"; $title = "Site Status Update"; $meta_description = "Welcome to CoinCod - a unique auction system built to draw everyone closer to their dream products."; $admin_link = "<div id='admin_menu'>\n\t\t\t\t<a href='../user_profile/?id={$id}'>Profile</a>–\n \t\t<a href='../admin_site/product_form.php'>Add Product </a>–\n\t\t\t\t<a href='../admin_site/user_list.php'>User Listing</a>–\n\t\t\t\t<a href='../admin_site/sitestatus_updateform.php'>Site Status</a>\n\t\t\t</div></br>"; $status_update = '<form action="status_updatefunc.php" enctype="multipart/form-data" name="myForm" id="myForm" method="post"> <td> <select id="status" name="status" size="1"> <option value="Well as usual running like charm.">Well as usual running like charm.</option> <option value="Website Maintenance! Temporary Down!">Website Maintenance! Temporary Down!</option> </select> </td> <input type="submit" name="button" class="form_button" value="Update" /> </form>'; $contentContainer = array(array("title" => $title, "content" => $id == 1 ? $admin_link . $status_update : $status_update, "bottom_image" => '')); // Assign values to the Savant instance. $tpl->template_path = $template_path; $tpl->resource_path = $resource_path; $tpl->title = $title;
// comment this out for local debug copy require_once 'Savant3.php'; # taken from http://stackoverflow.com/a/12583387/788054 # TBS cannot use DEFINE(), so these are variables define('ABS_PATH', str_replace('\\', '/', dirname(__FILE__)) . '/'); define('BASE_PATH', '/' . substr(dirname(__FILE__), strlen($_SERVER['DOCUMENT_ROOT'])) . '/'); # to be deprecated - currently strongly discouraged in official documentation -gg #function __autoload($class) { # require_once('lib/' . str_replace('_', DIRECTORY_SEPARATOR, $class) . '.php'); #} # new style using spl_autoload_register: spl_autoload_register(function ($class) { require_once 'lib/' . str_replace('_', DIRECTORY_SEPARATOR, $class) . '.php'; }); Emdr::$regions = json_decode(file_get_contents(ABS_PATH . '/emdr/regions.json'), true); Prefs::getInstance(); $tpl = new Savant3(); $tpl->addPath('template', 'templates/bootstrap'); $tpl->addPath('resource', 'lib'); $tpl->siteTime = new Timer(); $tpl->emdrDown = false; # https://forums.eveonline.com/default.aspx?g=posts&m=2508255 $regions = json_decode(file_get_contents(dirname(__FILE__) . '/emdr/regions.json'), true); Emdr::setRegion(Prefs::get('region')); # If price of Tritanium is more than 12 hours old, then something has happened with EMDR consumer # Set template variable to display warning to user when this happens if (time() - (new Price(Emdr::get(34)))->generatedAt > 60 * 60 * 12) { $tpl->emdrDown = true; } $tpl->webkitFix = preg_match("#.+WebKit/(\\H+)+\\s.+?#s", $_SERVER['HTTP_USER_AGENT'], $matches) && $matches[1] < 535 ? true : false;