X-Git-Url: https://dev.renevier.net/gitweb.cgi?p=syp.git;a=blobdiff_plain;f=inc%2Ftemplates_upgrade.php;fp=inc%2Ftemplates_upgrade.php;h=410790ad180f67e66b36771d7786958eb0e10a41;hp=0000000000000000000000000000000000000000;hb=9acc365249b5e630da6b5cdd23e3a8015f39ddc7;hpb=ae3851e4befcc7f6bee6d161dc77ac2e4e9c6515 diff --git a/inc/templates_upgrade.php b/inc/templates_upgrade.php new file mode 100644 index 0000000..410790a --- /dev/null +++ b/inc/templates_upgrade.php @@ -0,0 +1,65 @@ + + + + + + + <?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)))) { + try { + create_thumbnail ($imgfilename, $thumbfilename); + } catch (Exception $e) { + return false; + } + } + } + } + return true; + } + + require_once ("./inc/settings.php"); + require_once ("./inc/db/mysql.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 (trans('Error when creating thumbnails.')); + } + + par_success (trans ('SYP upgrade went smoothly. You can now go to admin area')); + +?> + +