X-Git-Url: https://dev.renevier.net/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=inc%2Fhtml%2Fupgrade.php;fp=inc%2Fhtml%2Fupgrade.php;h=580868456ed45dda73ca420316b04b3402329927;hb=b8be7edca1802692be4d330c7065e5260fb348f6;hp=0000000000000000000000000000000000000000;hpb=a1d1d319af15be975bde4695a3bfeb7d78ea0398;p=syp.git diff --git a/inc/html/upgrade.php b/inc/html/upgrade.php new file mode 100644 index 0000000..5808684 --- /dev/null +++ b/inc/html/upgrade.php @@ -0,0 +1,64 @@ + + + + + + + <?php ptrans ('SYP upgrade')?> + + +listfeatures (); + foreach ($features as $feature) { + if ($feature->imgpath) { + $imgfilename = UPLOADDIR . "/" . $feature->imgpath; + $thumbfilename = getthumbsdir () . "/mini_" . $feature->imgpath; + if ((file_exists ($imgfilename)) && + (!(file_exists ($thumbfilename)))) { + create_thumbnail_or_copy ($imgfilename, $thumbfilename); + } + } + } + return true; + } + + require_once ("./inc/db/mysql.php"); + require_once ("./inc/install_utils.php"); + require_once ("./inc/utils.php"); + + $error = false; + try { + $connection->connect (DBHOST, DBUSER, DBPWD, DBNAME, DBPREFIX); + $usrtblexists = $connection->users_table_exists (); + $itemstblexists = $connection->items_table_exists (); + } catch (Exception $e) { + $error = true; + } + if (!$usrtblexists || !$itemstblexists) { + $error = true; + } + if ($error) { + die(sprintf('

%s

', trans('SYP is not correctly installed. Please follow README.txt instructions + and go to wizard.'))); + } + + safe_create_writable_dir (getthumbsdir ()); + if (create_all_thumbs ($connection)) { + par_success (trans('Thumbnails successfully created.')); + } else { + par_error_and_leave (trans('Error when creating thumbnails.')); + } + + par_success (trans ('SYP upgrade went smoothly. You can now go to admin area')); + +?> + +