diff options
-rw-r--r-- | phpfspot.class.php | 1 | ||||
-rw-r--r-- | phpfspot_cfg.php.dist | 5 | ||||
-rw-r--r-- | phpfspot_tmpl.php | 7 | ||||
-rw-r--r-- | themes/default/stylesheet.css (renamed from stylesheet.css) | 0 | ||||
-rw-r--r-- | themes/default/templates/calendar.tpl (renamed from templates/calendar.tpl) | 0 | ||||
-rw-r--r-- | themes/default/templates/credits.tpl (renamed from templates/credits.tpl) | 0 | ||||
-rw-r--r-- | themes/default/templates/export.tpl (renamed from templates/export.tpl) | 0 | ||||
-rw-r--r-- | themes/default/templates/footer.tpl (renamed from templates/footer.tpl) | 0 | ||||
-rw-r--r-- | themes/default/templates/header.tpl (renamed from templates/header.tpl) | 2 | ||||
-rw-r--r-- | themes/default/templates/index.tpl (renamed from templates/index.tpl) | 0 | ||||
-rw-r--r-- | themes/default/templates/photo_index.tpl (renamed from templates/photo_index.tpl) | 0 | ||||
-rw-r--r-- | themes/default/templates/search.tpl (renamed from templates/search.tpl) | 0 | ||||
-rw-r--r-- | themes/default/templates/single_photo.tpl (renamed from templates/single_photo.tpl) | 0 | ||||
-rw-r--r-- | themes/default/templates/slideshow.tpl (renamed from templates/slideshow.tpl) | 0 | ||||
-rw-r--r-- | themes/default/templates/tags.tpl (renamed from templates/tags.tpl) | 0 | ||||
-rw-r--r-- | themes/default/templates/welcome.tpl (renamed from templates/welcome.tpl) | 0 |
16 files changed, 13 insertions, 2 deletions
diff --git a/phpfspot.class.php b/phpfspot.class.php index 23eb541..825f92d 100644 --- a/phpfspot.class.php +++ b/phpfspot.class.php @@ -150,6 +150,7 @@ class PHPFSPOT { $this->tmpl->assign('to_date', $this->get_calendar('to')); $this->tmpl->assign('sort_field', $this->get_sort_field()); $this->tmpl->assign('content_page', 'welcome.tpl'); + $this->tmpl->assign('template_path', 'themes/'. $this->cfg->theme_name); $this->tmpl->show("index.tpl"); diff --git a/phpfspot_cfg.php.dist b/phpfspot_cfg.php.dist index adbe0da..07795c6 100644 --- a/phpfspot_cfg.php.dist +++ b/phpfspot_cfg.php.dist @@ -32,6 +32,8 @@ class PHPFSPOT_CFG { var $web_path = "/phpfspot"; + var $theme_name = "default"; + /* it's enough if this database is readonly for the webserver */ var $fspot_db = "/var/www/f-spot-dbs/photos.db"; @@ -114,6 +116,9 @@ class PHPFSPOT_CFG { if(!isset($this->hide_tags)) $this->showError("Please set \$hide_tags in phpfspot_cfg"); + if(!isset($this->theme_name)) + $this->showError("Please set \$theme_name in phpfspot_cfg"); + if(isset($this->error_found) && $this->error_found) exit(1); diff --git a/phpfspot_tmpl.php b/phpfspot_tmpl.php index 9609477..996ff44 100644 --- a/phpfspot_tmpl.php +++ b/phpfspot_tmpl.php @@ -29,8 +29,13 @@ class PHPFSPOT_TMPL extends Smarty { public function __construct($parent) { + if(!file_exists($parent->cfg->base_path .'/themes/'. $parent->cfg->theme_name .'/templates')) { + print "No templates found in ". $parent->cfg->base_path .'/themes/'. $parent->cfg->theme_name .'/templates'; + exit(1); + } + $this->Smarty(); - $this->template_dir = $parent->cfg->base_path .'/templates'; + $this->template_dir = $parent->cfg->base_path .'/themes/'. $parent->cfg->theme_name .'/templates'; $this->compile_dir = $parent->cfg->base_path .'/templates_c'; $this->config_dir = $parent->cfg->base_path .'/smarty_config'; $this->cache_dir = $parent->cfg->base_path .'/smarty_cache'; diff --git a/stylesheet.css b/themes/default/stylesheet.css index 33ef1bf..33ef1bf 100644 --- a/stylesheet.css +++ b/themes/default/stylesheet.css diff --git a/templates/calendar.tpl b/themes/default/templates/calendar.tpl index 1f52732..1f52732 100644 --- a/templates/calendar.tpl +++ b/themes/default/templates/calendar.tpl diff --git a/templates/credits.tpl b/themes/default/templates/credits.tpl index 44c4800..44c4800 100644 --- a/templates/credits.tpl +++ b/themes/default/templates/credits.tpl diff --git a/templates/export.tpl b/themes/default/templates/export.tpl index a3e5641..a3e5641 100644 --- a/templates/export.tpl +++ b/themes/default/templates/export.tpl diff --git a/templates/footer.tpl b/themes/default/templates/footer.tpl index 5f85cab..5f85cab 100644 --- a/templates/footer.tpl +++ b/themes/default/templates/footer.tpl diff --git a/templates/header.tpl b/themes/default/templates/header.tpl index acef8eb..5d66f2d 100644 --- a/templates/header.tpl +++ b/themes/default/templates/header.tpl @@ -3,7 +3,7 @@ <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>{$page_title}</title> - <link href="stylesheet.css" type="text/css" rel="stylesheet" /> + <link href="{$template_path}/stylesheet.css" type="text/css" rel="stylesheet" /> <script type="text/javascript" src="rpc.php?mode=init&client=all"></script> <script type="text/javascript" src="phpfspot.js"></script> <link rel="shortcut icon" href="resources/gpl_16.png" type="image/png" /> diff --git a/templates/index.tpl b/themes/default/templates/index.tpl index f42a124..f42a124 100644 --- a/templates/index.tpl +++ b/themes/default/templates/index.tpl diff --git a/templates/photo_index.tpl b/themes/default/templates/photo_index.tpl index 08c8999..08c8999 100644 --- a/templates/photo_index.tpl +++ b/themes/default/templates/photo_index.tpl diff --git a/templates/search.tpl b/themes/default/templates/search.tpl index 1498e70..1498e70 100644 --- a/templates/search.tpl +++ b/themes/default/templates/search.tpl diff --git a/templates/single_photo.tpl b/themes/default/templates/single_photo.tpl index bb8c917..bb8c917 100644 --- a/templates/single_photo.tpl +++ b/themes/default/templates/single_photo.tpl diff --git a/templates/slideshow.tpl b/themes/default/templates/slideshow.tpl index bba5cd2..bba5cd2 100644 --- a/templates/slideshow.tpl +++ b/themes/default/templates/slideshow.tpl diff --git a/templates/tags.tpl b/themes/default/templates/tags.tpl index 4f32ad0..4f32ad0 100644 --- a/templates/tags.tpl +++ b/themes/default/templates/tags.tpl diff --git a/templates/welcome.tpl b/themes/default/templates/welcome.tpl index 9845755..9845755 100644 --- a/templates/welcome.tpl +++ b/themes/default/templates/welcome.tpl |