2 /* Copyright (c) 2009 Arnaud Renevier, Inc, published under the modified BSD
5 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
6 "http://www.w3.org/TR/html4/loose.dtd">
9 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" >
10 <link rel="stylesheet" href="./media/common.css" type="text/css" />
11 <title><?php ptrans ('SYP upgrade')?></title>
15 function create_all_thumbs($con) {
16 $features = $con->listfeatures ();
17 foreach ($features as $feature) {
18 if ($feature->imgpath) {
19 $imgfilename = UPLOADDIR . "/" . $feature->imgpath;
20 $thumbfilename = getthumbsdir () . "/mini_" . $feature->imgpath;
21 if ((file_exists ($imgfilename)) &&
22 (!(file_exists ($thumbfilename)))) {
24 create_thumbnail ($imgfilename, $thumbfilename);
25 } catch (Exception $e) {
34 require_once ("./inc/settings.php");
35 require_once ("./inc/db/mysql.php");
36 require_once ("./inc/utils.php");
40 $connection->connect (DBHOST, DBUSER, DBPWD, DBNAME, DBPREFIX);
41 $usrtblexists = $connection->users_table_exists ();
42 $itemstblexists = $connection->items_table_exists ();
43 } catch (Exception $e) {
46 if (!$usrtblexists || !$itemstblexists) {
50 die(sprintf('<p class="error center">%s</p>', trans('SYP is not correctly installed. Please follow README.txt instructions
51 and go to <a href="wizard.en.php">wizard</a>.')));
54 safe_create_writable_dir (getthumbsdir ());
55 if (create_all_thumbs ($connection)) {
56 par_success (trans('Thumbnails successfully created.'));
58 par_error (trans('Error when creating thumbnails.'));
61 par_success (trans ('SYP upgrade went smoothly. You can now go to <a href="admin.en.php">admin area</a>'));