issue46, added a nice slideshow icon
[phpfspot.git] / phpfspot_cfg.php.dist
1 <?php
2
3 /***************************************************************************
4  *
5  * Copyright (c) by Andreas Unterkircher, unki@netshadow.at
6  * All rights reserved
7  *
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
11  *  any later version.
12  *
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.
17  *
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.
21  *
22  ***************************************************************************/
23
24 class PHPFSPOT_CFG {
25
26    var $page_title = "phpfspot - dynamic PHP gallery for F-Spot";
27
28    var $product = "phpfspot";
29    var $version = "0.1";
30
31    var $base_path = "/var/www/htdocs";
32
33    var $web_path = "/phpfspot";
34
35    /* it's enough if this database is readonly for the webserver */
36    var $fspot_db = "/var/www/f-spot-dbs/photos.db";
37
38    /* this database MUST be writeable for the webserver. Set the directory
39       permissions correctly so phpfspot can create this database for you!!
40    */
41    var $phpfspot_db = "/var/www/f-spot-dbs/phpfspot.db";
42
43    /* don't touch if you haven't changed the base templates */
44    var $thumb_width = "150";
45    var $photo_width = "640";
46    var $mini_width = "100";
47
48    /* how many columns in the photo index view */
49    var $thumbs_per_row = 4;
50
51    /* how many rows should be displayed on the photo index view */
52    /* use 0 to display all matching photos on one page */
53    var $rows_per_page = 4;
54
55    /* Usually the photo directory differs between your local F-Spot installation
56       and your webserver. With this you can advice phpfspot to replace all paths
57       (they are stored in F-Spot's sqlite3 database
58    */
59    var $path_replace_from = "/home/unki";
60    var $path_replace_to = "/var/www/images.netshadow.at";
61
62    /* This is not really a security option - it only hides some present F-Spot
63       tags from the available-tags-list
64    */
65    var $hide_tags = Array("Favorites", "Hidden", "People", "Places", "Events");
66
67    /* no need to modified anything below this line */
68    var $error_found = 0;
69
70    public function __construct()
71    {
72       if(!isset($this->page_title) || $this->page_title == "")
73          $this->showError("Please set \$page_title in phpfspot_cfg");
74    
75       if(!isset($this->product) || $this->product == "")
76          $this->showError("Please set \$product in phpfspot_cfg");
77
78       if(!isset($this->version) || $this->version == "")
79          $this->showError("Please set \$version in phpfspot_cfg");
80
81       if(!isset($this->base_path) || $this->base_path == "")
82          $this->this->showError("Please set \$base_path in phpfspot_cfg");
83
84       if(!isset($this->web_path) || $this->web_path == "")
85          $this->showError("Please set \$web_path in phpfspot_cfg");
86
87       if(!isset($this->fspot_db) || $this->fspot_db == "")
88          $this->showError("Please set \$fspot_db in phpfspot_cfg");
89
90       if(!isset($this->phpfspot_db) || $this->phpfspot_db == "")
91          $this->showError("Please set \$phpfspot_db in phpfspot_cfg");
92
93       if(!isset($this->thumb_width) || $this->thumb_width == "")
94          $this->showError("Please set \$thumb_width in phpfspot_cfg");
95
96       if(!isset($this->photo_width) || $this->photo_width == "")
97          $this->showError("Please set \$photo_width in phpfspot_cfg");
98
99       if(!isset($this->mini_width) || $this->mini_width == "")
100          $this->showError("Please set \$mini_width in phpfspot_cfg");
101
102       if(!isset($this->thumbs_per_row) || $this->thumbs_per_row == "")
103          $this->showError("Please set \$thumbs_per_row in phpfspot_cfg");
104
105       if(!isset($this->rows_per_page) || $this->rows_per_page == "")
106          $this->showError("Please set \$rows_per_page in phpfspot_cfg");
107
108       if(!isset($this->path_replace_from) || $this->path_replace_from == "")
109          $this->showError("Please set \$path_replace_from in phpfspot_cfg");
110
111       if(!isset($this->path_replace_to) || $this->path_replace_to == "")
112          $this->showError("Please set \$path_replace_to in phpfspot_cfg");
113
114       if(!isset($this->hide_tags))
115          $this->showError("Please set \$hide_tags in phpfspot_cfg");
116
117       if(isset($this->error_found) && $this->error_found)
118          exit(1);
119
120    } // __construct()
121
122    private function showError($text)
123    {
124       print $text ."<br />\n";
125       $this->error_found = 1;
126
127    } // showError()
128
129 }
130
131 ?>