]> git.mxchange.org Git - friendica.git/blobdiff - index.php
theme name cleanup - rename default to loozah, provide sane fallbacks and change...
[friendica.git] / index.php
index 1c069678135f1dd82d420da5fd81b65f7b1950bd..5f128ebb1b4754a9615a97d244d3bcc1b7db2dce 100644 (file)
--- a/index.php
+++ b/index.php
@@ -71,7 +71,9 @@ if(! $install) {
 
 require_once("datetime.php");
 
-date_default_timezone_set(($default_timezone) ? $default_timezone : 'UTC');
+$a->timezone = (($default_timezone) ? $default_timezone : 'UTC');
+
+date_default_timezone_set($a->timezone);
 
 $a->init_pagehead();
 
@@ -138,7 +140,7 @@ if(strlen($a->module)) {
        }
        else {
                if((x($_SERVER,'QUERY_STRING')) && ($_SERVER['QUERY_STRING'] === 'q=internal_error.html') && isset($dreamhost_error_hack)) {
-                       logger('index.php: dreamhost_error_hack invoked');
+                       logger('index.php: dreamhost_error_hack invoked. Original URI =' . $_SERVER['REQUEST_URI']);
                        goaway($a->get_baseurl() . $_SERVER['REQUEST_URI']);
                }
 
@@ -236,21 +238,10 @@ if($a->module != 'install')
        require_once('nav.php');
 
 /**
- *
  * Build the page - now that we have all the components
- * Make sure the desired theme exists, though if the default theme doesn't exist we're stuffed.
- *
  */
 
-$default_theme = ((isset($a->config['system']['theme'])) ? $a->config['system']['theme'] : 'default');
-if((x($_SESSION,'theme')) && (! file_exists('view/theme/' . $_SESSION['theme'] . '/style.css')))
-       unset($_SESSION['theme']);
-
-$a->page['htmlhead'] = replace_macros($a->page['htmlhead'], array(
-       '$stylesheet' => $a->get_baseurl() . '/view/theme/'
-               . ((x($_SESSION,'theme')) ? $_SESSION['theme'] : $default_theme)
-               . '/style.css'
-       ));
+$a->page['htmlhead'] = replace_macros($a->page['htmlhead'], array('$stylesheet' => current_theme_url()));
 
 $page    = $a->page;
 $profile = $a->profile;