aboutsummaryrefslogtreecommitdiffstats
path: root/index.php
diff options
context:
space:
mode:
authorMichael <icarus@dabo.de>2012-04-11 18:48:58 +0200
committerMichael <icarus@dabo.de>2012-04-11 18:48:58 +0200
commit39405c8056b4a1d55c97fb2963d8776695dbeb30 (patch)
treec9f89ba0e9aacee343cf50b6b8a64468bb8db694 /index.php
parentc3139fa0fd49b0b4de4568d46a6946c75ccb2a62 (diff)
parentcdb6510b9f3007d2afd3081313caa7d045af1e7c (diff)
downloadvolse-hubzilla-39405c8056b4a1d55c97fb2963d8776695dbeb30.tar.gz
volse-hubzilla-39405c8056b4a1d55c97fb2963d8776695dbeb30.tar.bz2
volse-hubzilla-39405c8056b4a1d55c97fb2963d8776695dbeb30.zip
Merge remote branch 'upstream/master'
Diffstat (limited to 'index.php')
-rw-r--r--index.php21
1 files changed, 16 insertions, 5 deletions
diff --git a/index.php b/index.php
index e7227962f..5dd93523e 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;