X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=index.php;h=5dd93523e3a78dd86e99a7df6ba1165f44aedebd;hb=eb27c32065f64611013cb988ffe28514e14559ac;hp=e7227962f479436a31cfff2054dc79bdcb995920;hpb=355c42cb309eb1313097411067ca999b699aa620;p=friendica.git diff --git a/index.php b/index.php index e7227962f4..5dd93523e3 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 @@ -258,6 +257,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'))) { @@ -348,13 +359,13 @@ $profile = $a->profile; header("Content-type: text/html; charset=utf-8"); -$template = 'view/' . current_theme() . '/' +$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(current_theme() . '/', '', $template)); + require_once(str_replace('theme/' . current_theme() . '/', '', $template)); session_write_close(); exit;