userid > 0 && sql_value("SELECT `email_problems` FROM `user` WHERE `user_id`='&1'", 0, $login->userid) != 0) { header("Location: verifyemail.php?page=" . basename($_SERVER['REQUEST_URI'])); exit; } // normalize important settings function normalize_settings() { global $opt; $opt['charset']['iconv'] = strtoupper($opt['charset']['iconv']); if (substr($opt['page']['absolute_url'], -1, 1) != '/') $opt['page']['absolute_url'] .= '/'; if (substr($opt['logic']['pictures']['url'], -1, 1) != '/') $opt['logic']['pictures']['url'] .= '/'; if (substr($opt['logic']['pictures']['dir'], -1, 1) != '/') $opt['logic']['pictures']['dir'] .= '/'; if (substr($opt['logic']['podcasts']['url'], -1, 1) != '/') $opt['logic']['podcasts']['url'] .= '/'; if (substr($opt['logic']['podcasts']['dir'], -1, 1) != '/') $opt['logic']['podcasts']['dir'] .= '/'; } function configure_php() { global $opt; if ($opt['php']['debug'] == PHP_DEBUG_SKIP) { } if ($opt['php']['debug'] == PHP_DEBUG_ON) { ini_set('display_errors', true); ini_set('error_reporting', E_ALL); ini_set('mysql.trace_mode', true); } else { ini_set('display_errors', false); ini_set('error_reporting', E_ALL & ~E_NOTICE); ini_set('mysql.trace_mode', false); } } function set_domain() { global $opt; if (!isset($opt['domain'])) return; $domain = isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : ''; if ($domain == '') return; if (isset($opt['domain'][$domain])) { if (isset($opt['domain'][$domain]['url'])) $opt['page']['absolute_url'] = $opt['domain'][$domain]['url']; if (isset($opt['domain'][$domain]['locale'])) $opt['template']['default']['locale'] = $opt['domain'][$domain]['locale']; if (isset($opt['domain'][$domain]['country'])) $opt['template']['default']['country'] = $opt['domain'][$domain]['country']; if (isset($opt['domain'][$domain]['style'])) $opt['template']['default']['style'] = $opt['domain'][$domain]['style']; if (isset($opt['domain'][$domain]['cookiedomain'])) $opt['session']['domain'] = $opt['domain'][$domain]['cookiedomain']; } } function set_language() { global $opt, $cookie; if (isset($_REQUEST['locale'])) $opt['template']['locale'] = strtoupper($_REQUEST['locale']); else $opt['template']['locale'] = strtoupper($cookie->get('locale', $opt['template']['default']['locale'])); if (isset($opt['template']['locale']) && $opt['template']['locale'] != '') { if (strpos($opt['template']['locale'], '.') !== false || strpos($opt['template']['locale'], '/') !== false) $opt['template']['locale'] = $opt['template']['default']['locale']; if (!isset($opt['locale'][$opt['template']['locale']])) $opt['template']['locale'] = $opt['template']['default']['locale']; } else $opt['template']['locale'] = $opt['template']['default']['locale']; $cookie->set('locale', $opt['template']['locale'], $opt['template']['default']['locale']); bindtextdomain('messages', $opt['rootpath'] . 'cache2/translate'); // setup the PHP locale setlocale(LC_MONETARY, $opt['locale'][$opt['template']['locale']]['locales']); setlocale(LC_TIME, $opt['locale'][$opt['template']['locale']]['locales']); if (defined('LC_MESSAGES')) setlocale(LC_MESSAGES, $opt['locale'][$opt['template']['locale']]['locales']); // no localisation! setlocale(LC_COLLATE, $opt['locale']['EN']['locales']); setlocale(LC_CTYPE, $opt['locale']['EN']['locales']); setlocale(LC_NUMERIC, $opt['locale']['EN']['locales']); // important for mysql-queries! textdomain('messages'); } function set_usercountry() { global $cookie; if (isset($_REQUEST['usercountry'])) $cookie->set('usercountry', $_REQUEST['usercountry']); } function set_timezone() { global $opt; date_default_timezone_set($opt['locale'][$opt['template']['locale']]['timezone']); } function fix_magic_quotes_gpc() { // Disable magic_quotes_runtime @set_magic_quotes_runtime(0); if (get_magic_quotes_gpc()) { if (is_array($_GET)) { while (list($k, $v) = each($_GET)) { if (is_array($_GET[$k])) { while (list($k2, $v2) = each($_GET[$k])) { $_GET[$k][$k2] = stripslashes($v2); } @reset($_GET[$k]); } else { $_GET[$k] = stripslashes($v); } } @reset($_GET); } if (is_array($_POST)) { while (list($k, $v) = each($_POST)) { if (is_array($_POST[$k])) { while (list($k2, $v2) = each($_POST[$k])) { $_POST[$k][$k2] = stripslashes($v2); } @reset($_POST[$k]); } else { $_POST[$k] = stripslashes($v); } } @reset($_POST); } if (is_array($_REQUEST)) { while (list($k, $v) = each($_REQUEST)) { if (is_array($_REQUEST[$k])) { while (list($k2, $v2) = each($_REQUEST[$k])) { $_REQUEST[$k][$k2] = stripslashes($v2); } @reset($_REQUEST[$k]); } else { $_REQUEST[$k] = stripslashes($v); } } @reset($_REQUEST); } if (is_array($_COOKIE)) { while (list($k, $v) = each($_COOKIE)) { if (is_array($_COOKIE[$k])) { while (list($k2, $v2) = each($_COOKIE[$k])) { $_COOKIE[$k][$k2] = stripslashes($v2); } @reset($_COOKIE[$k]); } else { $_COOKIE[$k] = stripslashes($v); } } @reset($_COOKIE); } } } // wiki help embedding // pay attention to use only ' quotes in $text (escape other ') // // see corresponding function in lib/common.inc.php function helppagelink($ocpage) { global $opt, $translate; $helppage = sql_value("SELECT `helppage` FROM `helppages` WHERE `ocpage`='&1' AND `language`='&2'", "", $ocpage, $opt['template']['locale']); if ($helppage == "") $helppage = sql_value("SELECT `helppage` FROM `helppages` WHERE `ocpage`='&1' AND `language`='*'", "", $ocpage); if ($helppage == "" && isset($opt['locale'][$opt['template']['locale']]['help'][$ocpage])) $helppage = $opt['locale'][$opt['template']['locale']]['help'][$ocpage]; $imgtitle = $translate->t('Instructions', '', basename(__FILE__), __LINE__); $imgtitle = "alt='" . $imgtitle . "' title='" . $imgtitle . "'"; if (substr($helppage,0,1) == "!") return ""; else if ($helppage != "" && isset($opt['locale'][$opt['template']['locale']]['helpwiki'])) return ""; return ""; } ?>