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