* bug, get_random_tag_photo() now takes care of show_tags parameter, 81
* bug, get newer PDO style working with phpfspot, #109
* bug, avoid some notice messages, #179
- * devel, make calendar layer better readable
+ * devel, make calendar layer better readable, #78
+ * devel, add option to control photo path-substitution, #180
- -- Andreas Unterkircher <unki@netshadow.at> Fri, 23 May 2009 13:34:57 +0200
+ -- Andreas Unterkircher <unki@netshadow.at> Sat, 30 May 2009 09:53:57 +0200
phpfspot (1.6)
* @return string
*/
public function translate_path($path)
- {
- return str_replace($this->cfg->path_replace_from, $this->cfg->path_replace_to, $path);
+ {
+ if($this->cfg->enable_replace_path == true)
+ return str_replace(
+ $this->cfg->path_replace_from,
+ $this->cfg->path_replace_to, $path);
+
+ return $path;
} // translate_path
$missing = true;
}
+ if($this->cfg->db_access == "pdo") {
+ if(array_search("sqlite", PDO::getAvailableDrivers()) === false) {
+ print "PDO SQLite3 driver is missing<br />\n";
+ $missing = true;
+ }
+ }
+
/* Check for HTML_AJAX PEAR package, lent from Horde project */
ini_set('track_errors', 1);
@include_once 'HTML/AJAX/Server.php';
if(!isset($this->cfg->thumbs_per_page))
$this->_error("Please set \$thumbs_per_page in phpfspot_cfg");
- if(!isset($this->cfg->path_replace_from) || $this->cfg->path_replace_from == "")
- $this->_error("Please set \$path_replace_from in phpfspot_cfg");
+ if(!isset($this->cfg->enable_replace_path))
+ $this->_error("Please set \$enable_replace_path in phpfspot_cfg");
- if(!isset($this->cfg->path_replace_to) || $this->cfg->path_replace_to == "")
- $this->_error("Please set \$path_replace_to in phpfspot_cfg");
+ if($this->cfg->enable_replace_path == true) {
+ if(!isset($this->cfg->path_replace_from) || $this->cfg->path_replace_from == "")
+ $this->_error("Please set \$path_replace_from in phpfspot_cfg");
+
+ if(!isset($this->cfg->path_replace_to) || $this->cfg->path_replace_to == "")
+ $this->_error("Please set \$path_replace_to in phpfspot_cfg");
+ }
if(!isset($this->cfg->hide_tags))
$this->_error("Please set \$hide_tags in phpfspot_cfg");
/* Usually the photo directory differs between your local F-Spot installation
and your webserver. With this you can advice phpfspot to replace all paths
(they are stored in F-Spot's sqlite3 database).
+
+ disable this feature by setting the next variable to false;
*/
+ var $enable_replace_path = true;
+
+ // substitute all "from" matches with "to"
var $path_replace_from = "/home/unki";
var $path_replace_to = "/var/www/phpfspot/Photos";