]> dev.renevier.net Git - syp.git/blobdiff - inc/templates_upgrade.php
improve wizard (hand editing of settings.php is no more needed)
[syp.git] / inc / templates_upgrade.php
index 1a69b68584b159af5e4a15d13fdf9aa49a3e3bea..9c3a24ab3411dfc13cb0150f337aeb62fd1e1222 100644 (file)
@@ -1,6 +1,9 @@
 <?php
 /* Copyright (c) 2009 Arnaud Renevier, Inc, published under the modified BSD
    license. */
+    if (!@include_once ("./inc/settings.php")) {
+        header ('Location: install.php');
+    }
 ?>
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">  
                 $thumbfilename = getthumbsdir () .  "/mini_" . $feature->imgpath;
                 if ((file_exists ($imgfilename)) && 
                     (!(file_exists ($thumbfilename)))) {
-                    try {
-                        create_thumbnail ($imgfilename, $thumbfilename);
-                    } catch (Exception $e) {
-                        return false;
-                    }
+                        create_thumbnail_or_copy ($imgfilename, $thumbfilename);
                 }
             }
         }
         return true;
     }
 
-    require_once ("./inc/settings.php");
     require_once ("./inc/db/mysql.php");
+    require_once ("./inc/install_utils.php");
     require_once ("./inc/utils.php");
 
     $error = false;
     }
     if ($error) {
        die(sprintf('<p class="error center">%s</p>', trans('SYP is not correctly installed. Please follow README.txt instructions
-       and go to <a href="wizard.en.php">wizard</a>.')));
+       and go to <a href="install.en.php">wizard</a>.')));
     }
 
     safe_create_writable_dir (getthumbsdir ());
     if (create_all_thumbs ($connection)) {
         par_success (trans('Thumbnails successfully created.'));
     } else {
-        par_error (trans('Error when creating thumbnails.'));
+        par_error_and_leave (trans('Error when creating thumbnails.'));
     }
 
     par_success (trans ('SYP upgrade went smoothly. You can now go to <a href="admin.en.php">admin area</a>'));