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