]> git.mxchange.org Git - friendica.git/blobdiff - boot.php
multi-user, do not cache open mbox
[friendica.git] / boot.php
index bffd4ae2b1b13a941c3f2b5d8dc78ec5001fe4bf..b738125c8995c1eaf78cc8fdf19b992b9ae86497 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -2,9 +2,9 @@
 
 set_time_limit(0);
 
-define ( 'FRIENDIKA_VERSION',      '2.1.947' );
+define ( 'FRIENDIKA_VERSION',      '2.1.953' );
 define ( 'DFRN_PROTOCOL_VERSION',  '2.21'    );
-define ( 'DB_UPDATE_VERSION',      1051      );
+define ( 'DB_UPDATE_VERSION',      1053      );
 
 define ( 'EOL',                    "<br />\r\n"     );
 define ( 'ATOM_TIME',              'Y-m-d\TH:i:s\Z' );
@@ -290,7 +290,7 @@ class App {
 
                if($this->cmd === '.well-known/host-meta') {
                        require_once('include/hostxrd.php');
-                       hostxrd($this->hostname);
+                       hostxrd($this->get_baseurl());
                        // NOTREACHED
                }
 
@@ -608,19 +608,14 @@ function reload_plugins() {
 // For instance if 'test' => "foo" and 'testing' => "bar", testing could become either bar or fooing, 
 // depending on the order in which they were declared in the array.   
 
+require_once("include/template_processor.php");
+
 if(! function_exists('replace_macros')) {  
 function replace_macros($s,$r) {
+       global $t;
+       
+       return $t->replace($s,$r);
 
-       $search = array();
-       $replace = array();
-
-       if(is_array($r) && count($r)) {
-               foreach ($r as $k => $v ) {
-                       $search[] =  $k;
-                       $replace[] = $v;
-               }
-       }
-       return str_replace($search,$replace,$s);
 }}
 
 
@@ -1854,13 +1849,19 @@ function allowed_email($email) {
 
 if(! function_exists('load_view_file')) {
 function load_view_file($s) {
-       global $lang;
+       global $lang, $a;
        if(! isset($lang))
                $lang = 'en';
        $b = basename($s);
        $d = dirname($s);
        if(file_exists("$d/$lang/$b"))
                return file_get_contents("$d/$lang/$b");
+       
+       $theme = current_theme();
+       
+       if(file_exists("$d/theme/$theme/$b"))
+               return file_get_contents("$d/theme/$theme/$b");
+                       
        return file_get_contents($s);
 }}
 
@@ -2498,34 +2499,38 @@ function proc_run($cmd){
        proc_close(proc_open($cmdline." &",array(),$foo));
 }}
 
-/*
- * Return full URL to theme which is currently in effect.
- * Provide a sane default if nothing is chosen or the specified theme does not exist.
- */
-
-if(! function_exists('current_theme_url')) {
-function current_theme_url() {
-
+if(! function_exists('current_theme')) {
+function current_theme(){
        $app_base_themes = array('duepuntozero', 'loozah');
-
+       
        $a = get_app();
-
+       
        $system_theme = ((isset($a->config['system']['theme'])) ? $a->config['system']['theme'] : '');
        $theme_name = ((x($_SESSION,'theme')) ? $_SESSION['theme'] : $system_theme);
-
+       
        if($theme_name && file_exists('view/theme/' . $theme_name . '/style.css'))
-               return($a->get_baseurl() . '/view/theme/' . $theme_name . '/style.css'); 
-
+               return($theme_name);
+       
        foreach($app_base_themes as $t) {
                if(file_exists('view/theme/' . $t . '/style.css'))
-                       return($a->get_baseurl() . '/view/theme/' . $t . '/style.css'); 
-       }       
-
+                       return($t);
+       }
+       
        $fallback = glob('view/theme/*/style.css');
        if(count($fallback))
-               return($a->get_baseurl() . $fallback[0]);
+               return (str_replace('view/theme/','', str_replace("/style.css","",$fallback[0])));
 
-       
+}}
+
+/*
+* Return full URL to theme which is currently in effect.
+* Provide a sane default if nothing is chosen or the specified theme does not exist.
+*/
+if(! function_exists('current_theme_url')) {
+function current_theme_url() {
+       global $a;
+       $t = current_theme();
+       return($a->get_baseurl() . '/view/theme/' . $t . '/style.css');
 }}
 
 if(! function_exists('feed_birthday')) {