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">
7 <html lang="<?php echo $lang?>">
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)))) {
23 create_thumbnail_or_copy ($imgfilename, $thumbfilename);
30 require_once ("./inc/settings.php");
31 require_once ("./inc/db/mysql.php");
32 require_once ("./inc/utils.php");
36 $connection->connect (DBHOST, DBUSER, DBPWD, DBNAME, DBPREFIX);
37 $usrtblexists = $connection->users_table_exists ();
38 $itemstblexists = $connection->items_table_exists ();
39 } catch (Exception $e) {
42 if (!$usrtblexists || !$itemstblexists) {
46 die(sprintf('<p class="error center">%s</p>', trans('SYP is not correctly installed. Please follow README.txt instructions
47 and go to <a href="wizard.en.php">wizard</a>.')));
50 safe_create_writable_dir (getthumbsdir ());
51 if (create_all_thumbs ($connection)) {
52 par_success (trans('Thumbnails successfully created.'));
54 par_error (trans('Error when creating thumbnails.'));
57 par_success (trans ('SYP upgrade went smoothly. You can now go to <a href="admin.en.php">admin area</a>'));