X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=index.php;h=e7227962f479436a31cfff2054dc79bdcb995920;hb=355c42cb309eb1313097411067ca999b699aa620;hp=98733c4c8256c7ddbbbfcffac237889892af338d;hpb=939449602a58838f81045c9a0e9a205c8fa9e6bd;p=friendica.git diff --git a/index.php b/index.php index 98733c4c82..e7227962f4 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(); /** @@ -95,6 +93,10 @@ if((x($_SESSION,'language')) && ($_SESSION['language'] !== $lang)) { load_translation_table($lang); } +if(x($_GET,'zrl')) { + $_SESSION['my_url'] = $_GET['zrl']; + $a->query_string = preg_replace('/[\?&]zrl=(.*?)([\?&]|$)/is','',$a->query_string); +} /** * @@ -115,6 +117,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(); @@ -133,6 +145,7 @@ if($install) else check_config($a); +nav_set_selected('nothing'); $arr = array('app_menu' => $a->apps); @@ -140,7 +153,6 @@ call_hooks('app_menu', $arr); $a->apps = $arr['app_menu']; - /** * * We have already parsed the server path into $a->argc and $a->argv @@ -218,6 +230,13 @@ if(strlen($a->module)) { } } +/** + * 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 */ @@ -225,6 +244,8 @@ if(strlen($a->module)) { if(! x($a->page,'content')) $a->page['content'] = ''; +if(! $install) + call_hooks('page_content_top',$a->page['content']); /** * Call module functions @@ -327,13 +348,13 @@ $profile = $a->profile; header("Content-type: text/html; charset=utf-8"); -$template = 'view/' . $lang . '/' +$template = 'view/' . current_theme() . '/' . ((x($a->page,'template')) ? $a->page['template'] : 'default' ) . '.php'; if(file_exists($template)) require_once($template); else - require_once(str_replace($lang . '/', '', $template)); + require_once(str_replace(current_theme() . '/', '', $template)); session_write_close(); exit;