]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
theme server support
authorEvan Prodromou <evan@prodromou.name>
Wed, 16 Jul 2008 20:59:47 +0000 (16:59 -0400)
committerEvan Prodromou <evan@prodromou.name>
Wed, 16 Jul 2008 20:59:47 +0000 (16:59 -0400)
darcs-hash:20080716205947-84dde-fa57c8fc140cc479e14b50479df13447abaef31b.gz

lib/common.php
lib/theme.php

index 14fb2093fae7f022a2032ce1ca76b2ddccb46a29..dca1ae94f641d1a7d059398b68f5c3e54cce85af 100644 (file)
@@ -62,6 +62,8 @@ $config =
                array('blacklist' => array()),
                'avatar' =>
                array('server' => NULL),
+               'theme' =>
+               array('server' => NULL),
                'xmpp' =>
                array('enabled' => false,
                          'server' => 'INVALID SERVER',
index d1e82596edc28fa6079c35109e7c5ca5a116345f..80982aa82b0d59f7742fd2d128dceccbbb60881b 100644 (file)
 if (!defined('LACONICA')) { exit(1); }
 
 function theme_file($relative) {
-       global $config;
-       return INSTALLDIR.'/theme/'.$config['site']['theme'].'/'.$relative;
+       $theme = common_config('site', 'theme');
+       return INSTALLDIR.'/theme/'.$theme.'/'.$relative;
 }
 
 function theme_path($relative) {
-       global $config;
-       return common_path('theme/'.$config['site']['theme'].'/'.$relative);
+       $theme = common_config('site', 'theme');
+       $server = common_config('theme', 'server');
+       if ($server) {
+               return 'http://'.$server.'/'.$theme.'/'.$relative;
+       } else {
+               return common_path('theme/'.$theme.'/'.$relative);
+       }
 }
\ No newline at end of file