explain the writeable-necessarity in the error messages.
[phpfspot.git] / phpfspot.class.php
index b3455f014cc5450eee2b5de64975343597b6c724..df984cb9bc076ecdbe686a48d19ad87eebae32c5 100644 (file)
@@ -142,7 +142,9 @@ class PHPFSPOT {
 
       /* Check if database file is writeable */
       if(!is_writeable($this->cfg->fspot_db)) {
-         print $this->cfg->fspot_db ." is not writeable for user ". $this->getuid() ."\n";
+         print "Error: ". $this->cfg->fspot_db ." is not writeable for user ". $this->getuid() .".\n";
+         print "Please fix permissions so phpfspot can create indices within the F-Spot database to"
+            ." speed up some database operations.\n";
          exit(1);
       }
 
@@ -174,13 +176,15 @@ class PHPFSPOT {
 
       /* Check if directory where the database file is stored is writeable  */
       if(!is_writeable(dirname($this->cfg->phpfspot_db))) {
-         print dirname($this->cfg->phpfspot_db) .": directory is not writeable for user ". $this->getuid() ."\n";
+         print "Error: ". dirname($this->cfg->phpfspot_db) .": directory is not writeable for user ". $this->getuid() .".\n";
+         print "Please fix permissions so phpfspot can create its own sqlite database to store some settings.\n";
          exit(1);
       }
 
       /* Check if database file is writeable */
       if(!is_writeable($this->cfg->phpfspot_db)) {
-         print $this->cfg->phpfspot_db ." is not writeable for user ". $this->getuid() ."\n";
+         print "Error: ". $this->cfg->phpfspot_db ." is not writeable for user ". $this->getuid() .".\n";
+         print "Please fix permissions so phpfspot can create its own sqlite database to store some settings.\n";
          exit(1);
       }
 
@@ -351,7 +355,8 @@ class PHPFSPOT {
       if(!isset($content)) {
          /* if tags are already selected, we can immediately display photo-index */
          if((isset($_SESSION['selected_tags']) && !empty($_SESSION['selected_tags']) &&
-            $_SESSION['start_action'] != 'showp') || $_SESSION['start_action'] == 'showpi')
+             isset($_SESSION['start_action']) && $_SESSION['start_action'] != 'showp') ||
+            (isset($_SESSION['start_action']) && $_SESSION['start_action'] == 'showpi'))
             $this->tmpl->assign('initial_content', $this->showPhotoIndex());
          else {
             /* if a photo is already selected, we can immediately display single-photo */