]> git.mxchange.org Git - friendica.git/blobdiff - index.php
optimise imgs; add some comment editing knobs
[friendica.git] / index.php
index 69c224c1aadbb2446194b7d35b3a1464612d3cca..442173eeb84e1c5d5ee973668056e84bfb9bc302 100644 (file)
--- 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
@@ -96,6 +95,10 @@ if((x($_SESSION,'language')) && ($_SESSION['language'] !== $lang)) {
 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);
+       }
 }
 
 /**
@@ -262,6 +265,13 @@ if($a->module_loaded) {
                $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'))
@@ -353,13 +363,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;