issue77, make Smarty path configureable
authorAndreas Unterkircher <unki@netshadow.at>
Sat, 3 Nov 2007 12:33:50 +0000 (12:33 +0000)
committerAndreas Unterkircher <unki@netshadow.at>
Sat, 3 Nov 2007 12:33:50 +0000 (12:33 +0000)
git-svn-id: file:///var/lib/svn/phpfspot/trunk@288 fa6a889d-dae6-447d-9e79-4ba9a3039384

phpfspot.class.php
phpfspot_cfg.php.dist
phpfspot_tmpl.php

index f88ddf815b9cd1a66fa3045ca8ba3bc2c561eeb2..ca8542b6df1174a871a9f091c17e42edc271f15f 100644 (file)
@@ -23,7 +23,6 @@
 
 require_once "phpfspot_cfg.php";
 require_once "phpfspot_db.php";
 
 require_once "phpfspot_cfg.php";
 require_once "phpfspot_db.php";
-require_once "phpfspot_tmpl.php";
 
 class PHPFSPOT {
 
 
 class PHPFSPOT {
 
@@ -64,7 +63,10 @@ class PHPFSPOT {
       }
       $this->check_config_table();
 
       }
       $this->check_config_table();
 
-
+      /* include Smarty template engine */
+      require $this->cfg->smarty_path .'/libs/Smarty.class.php';
+      /* overload Smarty class if our own template handler */
+      require_once "phpfspot_tmpl.php";
       $this->tmpl = new PHPFSPOT_TMPL($this);
 
       $this->get_tags();
       $this->tmpl = new PHPFSPOT_TMPL($this);
 
       $this->get_tags();
index 75b874f1f73c1d3030102760456b9c4ecd17498d..93d1d00a6974003b43a1ead8997a6b9d6f1432a9 100644 (file)
@@ -37,6 +37,14 @@ class PHPFSPOT_CFG {
    /* database access via "native" sqlite3 support or via "pdo" */
    var $db_access = "native";
 
    /* database access via "native" sqlite3 support or via "pdo" */
    var $db_access = "native";
 
+   /* path to Smarty (http://smarty.php.net) installation. this option
+      should directly point to the Smarty main directory containing the
+      sub directories 'libs', 'misc', 'unit_test', ...
+      the default value 'smarty' is enough for Debian-systems where
+      Smarty is installed through as dpkg.
+   */
+   var $smarty_path = "smarty";
+
    /* it's enough if this database is readonly for the webserver */
    var $fspot_db = "/var/www/f-spot-dbs/photos.db";
 
    /* it's enough if this database is readonly for the webserver */
    var $fspot_db = "/var/www/f-spot-dbs/photos.db";
 
index 996ff443d0a17076d8cb8251e933d6e9b282be30..5eff54476b2a21627fe93cc803ce5ef6eb02da3a 100644 (file)
@@ -21,8 +21,6 @@
  *
  ***************************************************************************/
 
  *
  ***************************************************************************/
 
-require 'smarty/libs/Smarty.class.php';
-
 class PHPFSPOT_TMPL extends Smarty {
 
    var $parent;
 class PHPFSPOT_TMPL extends Smarty {
 
    var $parent;