X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=index.php;h=442173eeb84e1c5d5ee973668056e84bfb9bc302;hb=dddf3307af24de71a8b6e52a984ba2f2e310c3b7;hp=e43d7332de65c1eba55eb66e0fc5a193eaab4a19;hpb=cb05e677a96e1312263c0a1c63ee10cea62268b1;p=friendica.git diff --git a/index.php b/index.php index e43d7332de..442173eeb8 100644 --- a/index.php +++ b/index.php @@ -38,11 +38,10 @@ load_translation_table($lang); */ require_once("dba.php"); -$db = new dba($db_host, $db_user, $db_pass, $db_data, $install); - unset($db_host, $db_user, $db_pass, $db_data); - if(! $install) { + $db = new dba($db_host, $db_user, $db_pass, $db_data, $install); + unset($db_host, $db_user, $db_pass, $db_data); /** * Load configs from db. Overwrite configs from .htconfig.php @@ -93,12 +92,14 @@ if((x($_SESSION,'language')) && ($_SESSION['language'] !== $lang)) { load_translation_table($lang); } -/* - * Create the page head after setting the language - * - */ - -$a->init_pagehead(); +if(x($_GET,'zrl')) { + $_SESSION['my_url'] = $_GET['zrl']; + $a->query_string = preg_replace('/[\?&]zrl=(.*?)([\?&]|$)/is','',$a->query_string); + if(! $install) { + $arr = array('zrl' => $_SESSION['my_url'], 'url' => $a->cmd); + call_hooks('zrl_init',$arr); + } +} /** * @@ -119,6 +120,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(); @@ -236,6 +247,8 @@ if (file_exists($theme_info_file)){ if(! x($a->page,'content')) $a->page['content'] = ''; +if(! $install) + call_hooks('page_content_top',$a->page['content']); /** * Call module functions @@ -248,6 +261,18 @@ if($a->module_loaded) { $func($a); } + if(function_exists(str_replace('-','_',current_theme()) . '_init')) { + $func = str_replace('-','_',current_theme()) . '_init'; + $func($a); + } +// elseif (x($a->theme_info,"extends") && file_exists("view/theme/".$a->theme_info["extends"]."/theme.php")) { +// require_once("view/theme/".$a->theme_info["extends"]."/theme.php"); +// if(function_exists(str_replace('-','_',$a->theme_info["extends"]) . '_init')) { +// $func = str_replace('-','_',$a->theme_info["extends"]) . '_init'; +// $func($a); +// } +// } + if(($_SERVER['REQUEST_METHOD'] === 'POST') && (! $a->error) && (function_exists($a->module . '_post')) && (! x($_POST,'auth-params'))) { @@ -338,13 +363,13 @@ $profile = $a->profile; header("Content-type: text/html; charset=utf-8"); -$template = 'view/' . $lang . '/' +$template = 'view/theme/' . 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('theme/' . current_theme() . '/', '', $template)); session_write_close(); exit;