define('DOWNLOAD_DIR', substr($options["download_dir"], 0, 6) == "ftp://" ? '' : $options["download_dir"]); define('TEMPLATE_DIR', 'tpl/' . $options['template_used'] . '/'); define('IMAGE_DIR', TEMPLATE_DIR . 'skin/' . $options["csstype"] . '/'); // Language initialisation require_once CLASS_DIR . "lang.class.php"; $L = new RxLang(); $charSet = $L->settings["charset"]; // Check DOWNLOAD_DIR and FILES_LST $czFlst = checkExistence(); // Strict check firbidden file in DOWNLOAD_DIR checkStrict(); define('THIS_SCRIPT', basename($PHP_SELF)); // check for forbidden page (audl, auul, lynx, mtn) $keyfn = str_replace("." . get_extension(THIS_SCRIPT), "", THIS_SCRIPT); if (isset($options['forbid'][$keyfn]) && $options['forbid'][$keyfn]) { get_tpl("404", ucwords(do_strtolower($keyfn)) . " " . $L->say["disabled"]); exit; } // Load server spec $server = getServerPlatf(); // Load visitor class, user ip defined in here require_once CLASS_DIR . 'visitors.class.php'; $visitors = new Visitor(); switch (THIS_SCRIPT) { case $options['index_file']: if ($options["no_cache"]) { header("Expires: Mon, 26 Jul 2010 05:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . "GMT"); header("Cache-Control: no-cache, must-revalidate"); header("Pragma: no-cache"); }
/** * Get the language variables for a section. * @return array The language variables. */ function get_languages() { $dir = @opendir($this->path); while ($lang = readdir($dir)) { $ext = do_strtolower(get_extension($lang)); if ($lang != "." && $lang != ".." && $ext == "php") { $lname = str_replace("." . $ext, "", $lang); require $this->path . PATH_SPLITTER . $lang; $languages[$lname] = $langinfo['name']; } } @ksort($languages); return $languages; }
function get_extension($file) { return do_strtolower(substr(strrchr($file, "."), 1)); }