From 7cf0a4c6472ab05a0963c003d8c3ecb59237ee67 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 22 Jun 2009 09:31:55 -0700 Subject: [PATCH 1/2] theme dir, path configurable --- README | 13 ++++++++++--- lib/common.php | 4 +++- lib/theme.php | 38 ++++++++++++++++++++++++++++++-------- 3 files changed, 43 insertions(+), 12 deletions(-) diff --git a/README b/README index 0c500acb86..cd663d931b 100644 --- a/README +++ b/README @@ -1039,9 +1039,16 @@ theme ----- server: Like avatars, you can speed up page loading by pointing the - theme file lookup to another server (virtual or real). The - theme server's root path should map to the Laconica "theme" - subdirectory. Defaults to NULL. + theme file lookup to another server (virtual or real). + Defaults to NULL, meaning to use the site server. +dir: Directory where theme files are stored. Used to determine + whether to show parts of a theme file. Defaults to the theme + subdirectory of the install directory. +path: Path part of theme URLs, before the theme name. Relative to the + theme server. It may make sense to change this path when upgrading, + (using version numbers as the path) to make sure that all files are + reloaded by caching clients or proxies. Defaults to null, + which means to use the site path + '/theme'. xmpp ---- diff --git a/lib/common.php b/lib/common.php index 14f5c7a7f1..0333030e1d 100644 --- a/lib/common.php +++ b/lib/common.php @@ -140,7 +140,9 @@ $config = 'blacklist' => array(), 'autosource' => array()), 'theme' => - array('server' => null), + array('server' => null, + 'dir' => null, + 'path'=> null), 'throttle' => array('enabled' => false, // whether to throttle edits; false by default 'count' => 20, // number of allowed messages in timespan diff --git a/lib/theme.php b/lib/theme.php index 0d88248227..2fe6ab69b7 100644 --- a/lib/theme.php +++ b/lib/theme.php @@ -43,10 +43,14 @@ if (!defined('LACONICA')) { function theme_file($relative, $theme=null) { - if (!$theme) { + if (empty($theme)) { $theme = common_config('site', 'theme'); } - return INSTALLDIR.'/theme/'.$theme.'/'.$relative; + $dir = common_config('theme', 'dir'); + if (empty($dir)) { + $dir = INSTALLDIR.'/theme'; + } + return $dir.'/'.$theme.'/'.$relative; } /** @@ -60,13 +64,31 @@ function theme_file($relative, $theme=null) function theme_path($relative, $theme=null) { - if (!$theme) { + if (empty($theme)) { $theme = common_config('site', 'theme'); } - $server = common_config('theme', 'server'); - if ($server) { - return 'http://'.$server.'/'.$theme.'/'.$relative; - } else { - return common_path('theme/'.$theme.'/'.$relative); + + $path = common_config('theme', 'path'); + + if (empty($path)) { + $path = common_config('site', 'path') . '/theme/'; } + + if ($path[strlen($path)-1] != '/') { + $path .= '/'; + } + + if ($path[0] != '/') { + $path = '/'.$path; + } + + $server = common_config('theme', 'server'); + + if (empty($server)) { + $server = common_config('site', 'server'); + } + + // XXX: protocol + + return 'http://'.$server.$path.$theme.'/'.$relative; } From 7b269a6712ac740c961634b0c165e6f74f420236 Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Mon, 22 Jun 2009 17:18:09 +0000 Subject: [PATCH 2/2] Layout fix for IE6 --- theme/base/css/ie6.css | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/theme/base/css/ie6.css b/theme/base/css/ie6.css index 76a82c0042..dde4d6fc77 100644 --- a/theme/base/css/ie6.css +++ b/theme/base/css/ie6.css @@ -5,6 +5,12 @@ margin-left:7px; address .fn { display:none; } + +#wrap { +width:1003px; +margin:0 auto; +} + #content { width:70%; } @@ -26,5 +32,6 @@ margin-bottom:123px; width:20%; } .notice div.entry-content { -width:63%; +width:50%; +margin-left:30px; }