3 /***************************************************************************
5 * Copyright (c) by Andreas Unterkircher, unki@netshadow.at
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 ***************************************************************************/
26 var $page_title = "phpfspot - dynamic PHP gallery for F-Spot";
28 var $product = "phpfspot";
31 var $base_path = "/var/www/htdocs";
33 var $web_path = "/phpfspot";
35 var $theme_name = "default";
37 /* it's enough if this database is readonly for the webserver */
38 var $fspot_db = "/var/www/f-spot-dbs/photos.db";
40 /* this database MUST be writeable for the webserver. Set the directory
41 permissions correctly so phpfspot can create this database for you!!
43 var $phpfspot_db = "/var/www/f-spot-dbs/phpfspot.db";
45 /* don't touch if you haven't changed the base templates */
46 var $thumb_width = "150";
47 var $photo_width = "640";
48 var $mini_width = "100";
50 /* how many columns in the photo index view */
51 var $thumbs_per_row = 4;
53 /* how many rows should be displayed on the photo index view */
54 /* use 0 to display all matching photos on one page */
55 var $rows_per_page = 4;
57 /* Usually the photo directory differs between your local F-Spot installation
58 and your webserver. With this you can advice phpfspot to replace all paths
59 (they are stored in F-Spot's sqlite3 database
61 var $path_replace_from = "/home/unki";
62 var $path_replace_to = "/var/www/images.netshadow.at";
64 /* This is not really a security option - it only hides some present F-Spot
65 tags from the available-tags-list
67 var $hide_tags = Array("Favorites", "Hidden", "People", "Places", "Events");
69 /* no need to modified anything below this line */
72 public function __construct()
74 if(!isset($this->page_title) || $this->page_title == "")
75 $this->showError("Please set \$page_title in phpfspot_cfg");
77 if(!isset($this->product) || $this->product == "")
78 $this->showError("Please set \$product in phpfspot_cfg");
80 if(!isset($this->version) || $this->version == "")
81 $this->showError("Please set \$version in phpfspot_cfg");
83 if(!isset($this->base_path) || $this->base_path == "")
84 $this->this->showError("Please set \$base_path in phpfspot_cfg");
86 if(!isset($this->web_path) || $this->web_path == "")
87 $this->showError("Please set \$web_path in phpfspot_cfg");
89 if(!isset($this->fspot_db) || $this->fspot_db == "")
90 $this->showError("Please set \$fspot_db in phpfspot_cfg");
92 if(!isset($this->phpfspot_db) || $this->phpfspot_db == "")
93 $this->showError("Please set \$phpfspot_db in phpfspot_cfg");
95 if(!isset($this->thumb_width) || $this->thumb_width == "")
96 $this->showError("Please set \$thumb_width in phpfspot_cfg");
98 if(!isset($this->photo_width) || $this->photo_width == "")
99 $this->showError("Please set \$photo_width in phpfspot_cfg");
101 if(!isset($this->mini_width) || $this->mini_width == "")
102 $this->showError("Please set \$mini_width in phpfspot_cfg");
104 if(!isset($this->thumbs_per_row) || $this->thumbs_per_row == "")
105 $this->showError("Please set \$thumbs_per_row in phpfspot_cfg");
107 if(!isset($this->rows_per_page) || $this->rows_per_page == "")
108 $this->showError("Please set \$rows_per_page in phpfspot_cfg");
110 if(!isset($this->path_replace_from) || $this->path_replace_from == "")
111 $this->showError("Please set \$path_replace_from in phpfspot_cfg");
113 if(!isset($this->path_replace_to) || $this->path_replace_to == "")
114 $this->showError("Please set \$path_replace_to in phpfspot_cfg");
116 if(!isset($this->hide_tags))
117 $this->showError("Please set \$hide_tags in phpfspot_cfg");
119 if(!isset($this->theme_name))
120 $this->showError("Please set \$theme_name in phpfspot_cfg");
122 if(isset($this->error_found) && $this->error_found)
125 /* check for pending slash on web_path */
126 if(!preg_match("/\/$/", $this->web_path))
127 $this->web_path.= "/";
131 private function showError($text)
133 print $text ."<br />\n";
134 $this->error_found = 1;