//$dbi = FALSE; ConnectDB(); // these lines are temp $config['site title'] = 'RhythmMarket'; if (!isset($config['iConomy']['use'])) { $config['iConomy']['use'] = 'auto'; } if (!isset($config['iConomy']['table'])) { $config['iConomy']['table'] = 'iConomy'; } if (!@date_default_timezone_get()) { @date_default_timezone_set('America/New_York'); } // includes require $lpaths['includes'] . 'inc.php'; $qtime = GetTimestamp(); $page = SanFilename($page); // php session $func = 'session_status'; if (function_exists($func)) { if ($func() == PHP_SESSION_DISABLED) { echo '<p>PHP Sessions are disabled. This is a requirement, please enable this.</p>'; exit; } } session_init(); // load settings require $lpaths['classes'] . 'settings.class.php'; SettingsClass::LoadSettings(); // default settings SettingsClass::setDefault('Version', 'unknown!', TRUE);
function GetRenderTime($roundnum = 3) { global $qtime; if ($qtime == 0) { return 0; } return round(GetTimestamp() - $qtime, $roundnum); }
<?php require_once "config.php"; error_reporting(-1); if (!isset($_POST["submit"])) { exit("Förfrågan måste skickas igenom knappen"); } $allowedTypes = array("image", "youtube", "website"); $allowedEffects = array("none", "blink", "horn"); $type = filter_input(INPUT_POST, "mediaType", FILTER_SANITIZE_FULL_SPECIAL_CHARS); $content = ""; $priority = filter_input(INPUT_POST, "priority", FILTER_SANITIZE_NUMBER_INT); $duration = filter_input(INPUT_POST, "duration", FILTER_SANITIZE_NUMBER_INT); $effect = filter_var_array($_POST["effect"], FILTER_SANITIZE_FULL_SPECIAL_CHARS); $startTime = GetTimestamp(true); $endTime = GetTimestamp(false); echo $startTime . "<br />"; echo $endTime . "<br />"; if (!in_array($type, $allowedTypes)) { exit("Not allowed type" . $type); } if ($effect[0] == $allowedEffects[0]) { $effect = NULL; } else { $tempEfftect = ""; foreach ($effect as $e) { if (!in_array($e, $allowedEffects)) { exit("Not allowed effect" . $e); } $tempEfftect .= $e . ','; }