X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=index.php;h=5f6d74adb9be383a62e917542f1103f186273d81;hb=b7ccbfc702b013c6d7fcbd8c406af8ede21139c2;hp=3db8170ef4fe4d8cfd507e0f7e04bd11227a36c0;hpb=abd65e00aba5a2581665a689e01fe9330046f001;p=friendica.git diff --git a/index.php b/index.php index 3db8170ef4..5f6d74adb9 100644 --- a/index.php +++ b/index.php @@ -2,7 +2,7 @@ /** * - * Friendika + * Friendica * */ @@ -75,8 +75,6 @@ $a->timezone = (($default_timezone) ? $default_timezone : 'UTC'); date_default_timezone_set($a->timezone); -$a->init_pagehead(); - session_start(); /** @@ -84,8 +82,12 @@ session_start(); * We have to do it here because the session was just now opened. */ -if(x($_POST,'system_language')) - $_SESSION['language'] = $_POST['system_language']; +if(array_key_exists('system_language',$_POST)) { + if(strlen($_POST['system_language'])) + $_SESSION['language'] = $_POST['system_language']; + else + unset($_SESSION['language']); +} if((x($_SESSION,'language')) && ($_SESSION['language'] !== $lang)) { $lang = $_SESSION['language']; load_translation_table($lang); @@ -111,6 +113,16 @@ if((x($_SESSION,'authenticated')) || (x($_POST,'auth-params')) || ($a->module == if(! x($_SESSION,'authenticated')) header('X-Account-Management-Status: none'); + +/* + * Create the page head after setting the language + * and getting any auth credentials + */ + +$a->init_pagehead(); + + + if(! x($_SESSION,'sysmsg')) $_SESSION['sysmsg'] = array(); @@ -129,6 +141,7 @@ if($install) else check_config($a); +nav_set_selected('nothing'); $arr = array('app_menu' => $a->apps); @@ -136,7 +149,6 @@ call_hooks('app_menu', $arr); $a->apps = $arr['app_menu']; - /** * * We have already parsed the server path into $a->argc and $a->argv @@ -207,10 +219,20 @@ if(strlen($a->module)) { logger('index.php: page not found: ' . $_SERVER['REQUEST_URI'] . ' ADDRESS: ' . $_SERVER['REMOTE_ADDR'] . ' QUERY: ' . $_SERVER['QUERY_STRING'], LOGGER_DEBUG); header($_SERVER["SERVER_PROTOCOL"] . ' 404 ' . t('Not Found')); - notice( t('Page not found.' ) . EOL); + $tpl = get_markup_template("404.tpl"); + $a->page['content'] = replace_macros($tpl, array( + '$message' => t('Page not found.' ) + )); } } +/** + * load current theme info + */ +$theme_info_file = "view/theme/".current_theme()."/theme.php"; +if (file_exists($theme_info_file)){ + require_once($theme_info_file); +} /* initialise content region */