From 16738920268f50813b4dbdafdc619b4ec8a2d9f2 Mon Sep 17 00:00:00 2001 From: plegall Date: Tue, 20 Sep 2005 22:04:57 +0000 Subject: - update: upgrade from 1.4.0 or 1.4.1. Upgrade from 1.3.x is not available anymore. - update: README files updated for very near branch 1.5 :-) - new: file tools/config_local.inc.php as example for optional include/config_local.inc.php - bug fixed: configuration parameter show_picture_name_on_title was useless git-svn-id: http://piwigo.org/svn/trunk@870 68402e56-0260-453c-a942-63ccdbb3a9ee --- install/dbscheme.txt | 160 ------------------ install/upgrade_1.3.0.php | 401 ---------------------------------------------- install/upgrade_1.3.1.php | 363 ----------------------------------------- install/upgrade_1.3.2.php | 362 ----------------------------------------- install/upgrade_1.3.3.php | 362 ----------------------------------------- install/upgrade_1.3.4.php | 362 ----------------------------------------- install/upgrade_1.4.0.php | 275 +++++++++++++++++++++++++++++++ install/upgrade_1.4.1.php | 275 +++++++++++++++++++++++++++++++ 8 files changed, 550 insertions(+), 2010 deletions(-) delete mode 100644 install/dbscheme.txt delete mode 100644 install/upgrade_1.3.0.php delete mode 100644 install/upgrade_1.3.1.php delete mode 100644 install/upgrade_1.3.2.php delete mode 100644 install/upgrade_1.3.3.php delete mode 100644 install/upgrade_1.3.4.php create mode 100644 install/upgrade_1.4.0.php create mode 100644 install/upgrade_1.4.1.php (limited to 'install') diff --git a/install/dbscheme.txt b/install/dbscheme.txt deleted file mode 100644 index 002059c4d..000000000 --- a/install/dbscheme.txt +++ /dev/null @@ -1,160 +0,0 @@ - -table:caddie -table:categories -table:comments -table:config -table:favorites -table:group_access -table:groups -table:history -table:image_category -table:images -table:rate -table:sessions -table:sites -table:user_access -table:user_forbidden -table:user_group -table:users -table:waiting - -column:user_id table:caddie type:smallint nullable:N length:5 signed:Y -column:element_id table:caddie type:mediumint nullable:N length:8 signed:Y -column:id table:categories type:smallint nullable:N length:5 signed:N -column:date_last table:categories type:datetime nullable:Y -column:nb_images table:categories type:mediumint nullable:N length:8 signed:N -column:name table:categories type:varchar nullable:N length:255 binary:N -column:id_uppercat table:categories type:smallint nullable:Y length:5 signed:N -column:comment table:categories type:text nullable:Y -column:dir table:categories type:varchar nullable:Y length:255 binary:N -column:rank table:categories type:tinyint nullable:Y length:3 signed:N -column:status table:categories type:enum('public','private') nullable:N -column:site_id table:categories type:tinyint nullable:Y length:4 signed:N -column:visible table:categories type:enum('true','false') nullable:N -column:uploadable table:categories type:enum('true','false') nullable:N -column:representative_picture_id table:categories type:mediumint nullable:Y length:8 signed:N -column:uppercats table:categories type:varchar nullable:N length:255 binary:N -column:commentable table:categories type:enum('true','false') nullable:N -column:global_rank table:categories type:varchar nullable:Y length:255 binary:N -column:id table:comments type:int nullable:N length:11 signed:N -column:image_id table:comments type:mediumint nullable:N length:8 signed:N -column:date table:comments type:datetime nullable:N -column:author table:comments type:varchar nullable:Y length:255 binary:N -column:content table:comments type:longtext nullable:Y -column:validated table:comments type:enum('true','false') nullable:N -column:validation_date table:comments type:datetime nullable:Y -column:param table:config type:varchar nullable:N length:40 binary:N -column:value table:config type:varchar nullable:Y length:255 binary:N -column:comment table:config type:varchar nullable:Y length:255 binary:N -column:user_id table:favorites type:smallint nullable:N length:5 signed:N -column:image_id table:favorites type:mediumint nullable:N length:8 signed:N -column:group_id table:group_access type:smallint nullable:N length:5 signed:N -column:cat_id table:group_access type:smallint nullable:N length:5 signed:N -column:id table:groups type:smallint nullable:N length:5 signed:N -column:name table:groups type:varchar nullable:N length:255 binary:N -column:date table:history type:datetime nullable:N -column:login table:history type:varchar nullable:Y length:15 binary:N -column:IP table:history type:varchar nullable:N length:50 binary:N -column:category table:history type:varchar nullable:Y length:150 binary:N -column:file table:history type:varchar nullable:Y length:50 binary:N -column:picture table:history type:varchar nullable:Y length:150 binary:N -column:image_id table:image_category type:mediumint nullable:N length:8 signed:N -column:category_id table:image_category type:smallint nullable:N length:5 signed:N -column:id table:images type:mediumint nullable:N length:8 signed:N -column:file table:images type:varchar nullable:N length:255 binary:N -column:date_available table:images type:datetime nullable:N -column:date_creation table:images type:date nullable:Y -column:tn_ext table:images type:varchar nullable:Y length:4 binary:N -column:name table:images type:varchar nullable:Y length:255 binary:N -column:comment table:images type:text nullable:Y -column:author table:images type:varchar nullable:Y length:255 binary:N -column:hit table:images type:int nullable:N length:10 signed:N -column:filesize table:images type:mediumint nullable:Y length:9 signed:N -column:width table:images type:smallint nullable:Y length:9 signed:N -column:height table:images type:smallint nullable:Y length:9 signed:N -column:keywords table:images type:varchar nullable:Y length:255 binary:N -column:storage_category_id table:images type:smallint nullable:Y length:5 signed:N -column:representative_ext table:images type:varchar nullable:Y length:4 binary:N -column:date_metadata_update table:images type:date nullable:Y -column:average_rate table:images type:float nullable:Y length:5,2 signed:N -column:path table:images type:varchar nullable:N length:255 binary:N -column:user_id table:rate type:smallint nullable:N length:5 signed:N -column:element_id table:rate type:mediumint nullable:N length:8 signed:N -column:rate table:rate type:tinyint nullable:N length:2 signed:N -column:id table:sessions type:varchar nullable:N length:255 binary:Y -column:user_id table:sessions type:smallint nullable:N length:5 signed:N -column:expiration table:sessions type:datetime nullable:N -column:id table:sites type:tinyint nullable:N length:4 signed:Y -column:galleries_url table:sites type:varchar nullable:N length:255 binary:N -column:user_id table:user_access type:smallint nullable:N length:5 signed:N -column:cat_id table:user_access type:smallint nullable:N length:5 signed:N -column:user_id table:user_forbidden type:smallint nullable:N length:5 signed:N -column:need_update table:user_forbidden type:enum('true','false') nullable:N -column:forbidden_categories table:user_forbidden type:text nullable:Y -column:user_id table:user_group type:smallint nullable:N length:5 signed:N -column:group_id table:user_group type:smallint nullable:N length:5 signed:N -column:id table:users type:smallint nullable:N length:5 signed:N -column:username table:users type:varchar nullable:N length:20 binary:Y -column:password table:users type:varchar nullable:Y length:32 binary:N -column:mail_address table:users type:varchar nullable:Y length:255 binary:N -column:nb_image_line table:users type:tinyint nullable:N length:1 signed:N -column:nb_line_page table:users type:tinyint nullable:N length:3 signed:N -column:status table:users type:enum('admin','guest') nullable:N -column:language table:users type:varchar nullable:N length:50 binary:N -column:maxwidth table:users type:smallint nullable:Y length:6 signed:Y -column:maxheight table:users type:smallint nullable:Y length:6 signed:Y -column:expand table:users type:enum('true','false') nullable:N -column:show_nb_comments table:users type:enum('true','false') nullable:N -column:recent_period table:users type:tinyint nullable:N length:3 signed:N -column:template table:users type:varchar nullable:N length:255 binary:N -column:last_feed_check table:users type:datetime nullable:Y -column:feed_id table:users type:varchar nullable:Y length:50 binary:Y -column:registration_date table:users type:datetime nullable:N -column:id table:waiting type:int nullable:N length:10 signed:N -column:storage_category_id table:waiting type:smallint nullable:N length:5 signed:N -column:file table:waiting type:varchar nullable:N length:255 binary:N -column:username table:waiting type:varchar nullable:N length:255 binary:N -column:mail_address table:waiting type:varchar nullable:N length:255 binary:N -column:date table:waiting type:int nullable:N length:10 signed:N -column:tn_ext table:waiting type:char nullable:Y length:3 binary:N -column:validated table:waiting type:enum('true','false') nullable:N -column:infos table:waiting type:text nullable:Y - -PK:caddie_pk table:caddie column:user_id -PK:caddie_pk table:caddie column:element_id -PK:categories_pk table:categories column:id -PK:comments_pk table:comments column:id -PK:config_pk table:config column:param -PK:favorites_pk table:favorites column:user_id -PK:favorites_pk table:favorites column:image_id -PK:group_access_pk table:group_access column:group_id -PK:group_access_pk table:group_access column:cat_id -PK:groups_pk table:groups column:id -PK:image_category_pk table:image_category column:image_id -PK:image_category_pk table:image_category column:category_id -PK:images_pk table:images column:id -PK:rate_pk table:rate column:user_id -PK:rate_pk table:rate column:element_id -PK:sessions_pk table:sessions column:id -PK:sites_pk table:sites column:id -PK:user_access_pk table:user_access column:user_id -PK:user_access_pk table:user_access column:cat_id -PK:user_forbidden_pk table:user_forbidden column:user_id -PK:user_group_pk table:user_group column:group_id -PK:user_group_pk table:user_group column:user_id -PK:users_pk table:users column:id -PK:waiting_pk table:waiting column:id - -index:categories_i2 table:categories column:id_uppercat -index:comments_i2 table:comments column:validation_date -index:comments_i1 table:comments column:image_id -index:history_i1 table:history column:date -index:image_category_i1 table:image_category column:image_id -index:image_category_i2 table:image_category column:category_id -index:images_i2 table:images column:date_available -index:images_i1 table:images column:storage_category_id -index:images_i3 table:images column:average_rate -index:images_i4 table:images column:hit -index:images_i5 table:images column:date_creation -index:sites_ui1 table:sites column:galleries_url -index:users_ui1 table:users column:username diff --git a/install/upgrade_1.3.0.php b/install/upgrade_1.3.0.php deleted file mode 100644 index 430a14ed0..000000000 --- a/install/upgrade_1.3.0.php +++ /dev/null @@ -1,401 +0,0 @@ -['.get_elapsed_time($last_time, $new_time).']'; -echo ' Basic database structure upgrade done'; -flush(); -$last_time = $new_time; - -execute_sqlfile(PHPWG_ROOT_PATH.'install/config.sql', - 'phpwebgallery_', - PREFIX_TABLE); - -$queries = array( - " -UPDATE phpwebgallery_config - SET value = '".$save['prefix_thumbnail']."' - WHERE param = 'prefix_thumbnail' -;", - - " -UPDATE phpwebgallery_config - SET value = '".$save['mail_webmaster']."' - WHERE param = 'mail_webmaster' -;" - ); - -foreach ($queries as $query) -{ - $query = str_replace('phpwebgallery_', PREFIX_TABLE, $query); - pwg_query($query); -} - -$new_time = get_moment(); -echo '
['.get_elapsed_time($last_time, $new_time).']';
-echo ' Saved configuration information restored
'; -flush(); -$last_time = $new_time; - -// filling the new column categories.uppercats -$id_uppercats = array(); - -$query = ' -SELECT id, id_uppercat - FROM '.CATEGORIES_TABLE.' -;'; -$result = pwg_query($query); -while ($row = mysql_fetch_array($result)) -{ - if (!isset($row['id_uppercat']) or $row['id_uppercat'] == '') - { - $row['id_uppercat'] = 'NULL'; - } - $id_uppercats[$row['id']] = $row['id_uppercat']; -} - -$datas = array(); - -foreach (array_keys($id_uppercats) as $id) -{ - $data = array(); - $data['id'] = $id; - $uppercats = array(); - - array_push($uppercats, $id); - while (isset($id_uppercats[$id]) and $id_uppercats[$id] != 'NULL') - { - array_push($uppercats, $id_uppercats[$id]); - $id = $id_uppercats[$id]; - } - $data['uppercats'] = implode(',', array_reverse($uppercats)); - - array_push($datas, $data); -} - -$fields = array('primary' => array('id'), 'update' => array('uppercats')); -mass_updates(CATEGORIES_TABLE, $fields, $datas); - -$new_time = get_moment(); -echo '
['.get_elapsed_time($last_time, $new_time).']';
-echo ' filling the new column categories.uppercats
'; -flush(); -$last_time = $new_time; - -// refresh calculated datas -ordering(); -update_global_rank(); -update_category(); - -$new_time = get_moment(); -echo '
['.get_elapsed_time($last_time, $new_time).']';
-echo ' Calculated data updated (categories.rank, categories.global_rank,
-categories.date_last, categories.representative_picture_id,
-categories.nb_images)
'; -flush(); -$last_time = $new_time; - -// update calculated field "images.path" -$cat_ids = array(); - -$query = ' -SELECT DISTINCT(storage_category_id) AS unique_storage_category_id - FROM '.IMAGES_TABLE.' -;'; -$result = pwg_query($query); -while ($row = mysql_fetch_array($result)) -{ - array_push($cat_ids, $row['unique_storage_category_id']); -} -$fulldirs = get_fulldirs($cat_ids); - -foreach ($cat_ids as $cat_id) -{ - $query = ' -UPDATE '.IMAGES_TABLE.' - SET path = CONCAT(\''.$fulldirs[$cat_id].'\',\'/\',file) - WHERE storage_category_id = '.$cat_id.' -;'; - pwg_query($query); -} - -$new_time = get_moment(); -echo '
['.get_elapsed_time($last_time, $new_time).']';
-echo ' new column images.path filled
'; -flush(); -$last_time = $new_time; - -// all sub-categories of private categories become private -$cat_ids = array(); - -$query = ' -SELECT id - FROM '.CATEGORIES_TABLE.' - WHERE status = \'private\' -;'; -$result = pwg_query($query); -while ($row = mysql_fetch_array($result)) -{ - array_push($cat_ids, $row['id']); -} - -if (count($cat_ids) > 0) -{ - $privates = get_subcat_ids($cat_ids); - - $query = ' -UPDATE '.CATEGORIES_TABLE.' - SET status = \'private\' - WHERE id IN ('.implode(',', $privates).') -;'; - pwg_query($query); -} - -$new_time = get_moment(); -echo '
['.get_elapsed_time($last_time, $new_time).']';
-echo ' all sub-categories of private categories become private
'; -flush(); -$last_time = $new_time; - -$infos = array( - 'user permissions and group permissions have been erased', - - 'only thumbnails prefix and webmaster mail address have been saved from -previous configuration', - - 'in include/mysql.inc.php, before -
?>
-insert -
define(\'PHPWG_INSTALLED\', true);
'
-  
-  );
-
-?>
\ No newline at end of file
diff --git a/install/upgrade_1.3.1.php b/install/upgrade_1.3.1.php
deleted file mode 100644
index 0e130a19d..000000000
--- a/install/upgrade_1.3.1.php
+++ /dev/null
@@ -1,363 +0,0 @@
-['.get_elapsed_time($last_time, $new_time).']';
-echo ' Basic database structure upgrade done
'; -flush(); -$last_time = $new_time; - -execute_sqlfile(PHPWG_ROOT_PATH.'install/config.sql', - 'phpwebgallery_', - PREFIX_TABLE); - -$queries = array( - " -UPDATE phpwebgallery_config - SET value = '".$save['prefix_thumbnail']."' - WHERE param = 'prefix_thumbnail' -;", - - " -UPDATE phpwebgallery_config - SET value = '".$save['mail_webmaster']."' - WHERE param = 'mail_webmaster' -;" - ); - -foreach ($queries as $query) -{ - $query = str_replace('phpwebgallery_', PREFIX_TABLE, $query); - pwg_query($query); -} - -$new_time = get_moment(); -echo '
['.get_elapsed_time($last_time, $new_time).']';
-echo ' Saved configuration information restored
'; -flush(); -$last_time = $new_time; - -ordering(); -update_global_rank(); -update_category(); - -$new_time = get_moment(); -echo '
['.get_elapsed_time($last_time, $new_time).']';
-echo ' Calculated data updated (categories.rank, categories.global_rank,
-categories.date_last, categories.representative_picture_id,
-categories.nb_images)
'; -flush(); -$last_time = $new_time; - -// update calculated field "images.path" -$cat_ids = array(); - -$query = ' -SELECT DISTINCT(storage_category_id) AS unique_storage_category_id - FROM '.IMAGES_TABLE.' -;'; -$result = pwg_query($query); -while ($row = mysql_fetch_array($result)) -{ - array_push($cat_ids, $row['unique_storage_category_id']); -} -$fulldirs = get_fulldirs($cat_ids); - -foreach ($cat_ids as $cat_id) -{ - $query = ' -UPDATE '.IMAGES_TABLE.' - SET path = CONCAT(\''.$fulldirs[$cat_id].'\',\'/\',file) - WHERE storage_category_id = '.$cat_id.' -;'; - pwg_query($query); -} - -$new_time = get_moment(); -echo '
['.get_elapsed_time($last_time, $new_time).']';
-echo ' new column images.path filled
'; -flush(); -$last_time = $new_time; - -// all sub-categories of private categories become private -$cat_ids = array(); - -$query = ' -SELECT id - FROM '.CATEGORIES_TABLE.' - WHERE status = \'private\' -;'; -$result = pwg_query($query); -while ($row = mysql_fetch_array($result)) -{ - array_push($cat_ids, $row['id']); -} - -if (count($cat_ids) > 0) -{ - $privates = get_subcat_ids($cat_ids); - - $query = ' -UPDATE '.CATEGORIES_TABLE.' - SET status = \'private\' - WHERE id IN ('.implode(',', $privates).') -;'; - pwg_query($query); -} - -$new_time = get_moment(); -echo '
['.get_elapsed_time($last_time, $new_time).']';
-echo ' all sub-categories of private categories become private
'; -flush(); -$last_time = $new_time; - -$infos = array( - 'user permissions and group permissions have been erased', - - 'only thumbnails prefix and webmaster mail address have been saved from -previous configuration', - - 'in include/mysql.inc.php, before -
?>
-insert -
define(\'PHPWG_INSTALLED\', true);
'
-  
-  );
-
-?>
\ No newline at end of file
diff --git a/install/upgrade_1.3.2.php b/install/upgrade_1.3.2.php
deleted file mode 100644
index b046cf112..000000000
--- a/install/upgrade_1.3.2.php
+++ /dev/null
@@ -1,362 +0,0 @@
-['.get_elapsed_time($last_time, $new_time).']';
-echo ' Basic database structure upgrade done
'; -flush(); -$last_time = $new_time; - -execute_sqlfile(PHPWG_ROOT_PATH.'install/config.sql', - 'phpwebgallery_', - PREFIX_TABLE); - -$queries = array( - " -UPDATE phpwebgallery_config - SET value = '".$save['prefix_thumbnail']."' - WHERE param = 'prefix_thumbnail' -;", - - " -UPDATE phpwebgallery_config - SET value = '".$save['mail_webmaster']."' - WHERE param = 'mail_webmaster' -;" - ); - -foreach ($queries as $query) -{ - $query = str_replace('phpwebgallery_', PREFIX_TABLE, $query); - pwg_query($query); -} - -$new_time = get_moment(); -echo '
['.get_elapsed_time($last_time, $new_time).']';
-echo ' Saved configuration information restored
'; -flush(); -$last_time = $new_time; - -ordering(); -update_global_rank(); -update_category(); - -$new_time = get_moment(); -echo '
['.get_elapsed_time($last_time, $new_time).']';
-echo ' Calculated data updated (categories.rank, categories.global_rank,
-categories.date_last, categories.representative_picture_id,
-categories.nb_images)
'; -flush(); -$last_time = $new_time; - -// update calculated field "images.path" -$cat_ids = array(); - -$query = ' -SELECT DISTINCT(storage_category_id) AS unique_storage_category_id - FROM '.IMAGES_TABLE.' -;'; -$result = pwg_query($query); -while ($row = mysql_fetch_array($result)) -{ - array_push($cat_ids, $row['unique_storage_category_id']); -} -$fulldirs = get_fulldirs($cat_ids); - -foreach ($cat_ids as $cat_id) -{ - $query = ' -UPDATE '.IMAGES_TABLE.' - SET path = CONCAT(\''.$fulldirs[$cat_id].'\',\'/\',file) - WHERE storage_category_id = '.$cat_id.' -;'; - pwg_query($query); -} - -$new_time = get_moment(); -echo '
['.get_elapsed_time($last_time, $new_time).']';
-echo ' new column images.path filled
'; -flush(); -$last_time = $new_time; - -// all sub-categories of private categories become private -$cat_ids = array(); - -$query = ' -SELECT id - FROM '.CATEGORIES_TABLE.' - WHERE status = \'private\' -;'; -$result = pwg_query($query); -while ($row = mysql_fetch_array($result)) -{ - array_push($cat_ids, $row['id']); -} - -if (count($cat_ids) > 0) -{ - $privates = get_subcat_ids($cat_ids); - - $query = ' -UPDATE '.CATEGORIES_TABLE.' - SET status = \'private\' - WHERE id IN ('.implode(',', $privates).') -;'; - pwg_query($query); -} - -$new_time = get_moment(); -echo '
['.get_elapsed_time($last_time, $new_time).']';
-echo ' all sub-categories of private categories become private
'; -flush(); -$last_time = $new_time; - -$infos = array( - 'user permissions and group permissions have been erased', - - 'only thumbnails prefix and webmaster mail address have been saved from -previous configuration', - - 'in include/mysql.inc.php, before -
?>
-insert -
define(\'PHPWG_INSTALLED\', true);
'
-  
-  );
-
-?>
\ No newline at end of file
diff --git a/install/upgrade_1.3.3.php b/install/upgrade_1.3.3.php
deleted file mode 100644
index b046cf112..000000000
--- a/install/upgrade_1.3.3.php
+++ /dev/null
@@ -1,362 +0,0 @@
-['.get_elapsed_time($last_time, $new_time).']';
-echo ' Basic database structure upgrade done
'; -flush(); -$last_time = $new_time; - -execute_sqlfile(PHPWG_ROOT_PATH.'install/config.sql', - 'phpwebgallery_', - PREFIX_TABLE); - -$queries = array( - " -UPDATE phpwebgallery_config - SET value = '".$save['prefix_thumbnail']."' - WHERE param = 'prefix_thumbnail' -;", - - " -UPDATE phpwebgallery_config - SET value = '".$save['mail_webmaster']."' - WHERE param = 'mail_webmaster' -;" - ); - -foreach ($queries as $query) -{ - $query = str_replace('phpwebgallery_', PREFIX_TABLE, $query); - pwg_query($query); -} - -$new_time = get_moment(); -echo '
['.get_elapsed_time($last_time, $new_time).']';
-echo ' Saved configuration information restored
'; -flush(); -$last_time = $new_time; - -ordering(); -update_global_rank(); -update_category(); - -$new_time = get_moment(); -echo '
['.get_elapsed_time($last_time, $new_time).']';
-echo ' Calculated data updated (categories.rank, categories.global_rank,
-categories.date_last, categories.representative_picture_id,
-categories.nb_images)
'; -flush(); -$last_time = $new_time; - -// update calculated field "images.path" -$cat_ids = array(); - -$query = ' -SELECT DISTINCT(storage_category_id) AS unique_storage_category_id - FROM '.IMAGES_TABLE.' -;'; -$result = pwg_query($query); -while ($row = mysql_fetch_array($result)) -{ - array_push($cat_ids, $row['unique_storage_category_id']); -} -$fulldirs = get_fulldirs($cat_ids); - -foreach ($cat_ids as $cat_id) -{ - $query = ' -UPDATE '.IMAGES_TABLE.' - SET path = CONCAT(\''.$fulldirs[$cat_id].'\',\'/\',file) - WHERE storage_category_id = '.$cat_id.' -;'; - pwg_query($query); -} - -$new_time = get_moment(); -echo '
['.get_elapsed_time($last_time, $new_time).']';
-echo ' new column images.path filled
'; -flush(); -$last_time = $new_time; - -// all sub-categories of private categories become private -$cat_ids = array(); - -$query = ' -SELECT id - FROM '.CATEGORIES_TABLE.' - WHERE status = \'private\' -;'; -$result = pwg_query($query); -while ($row = mysql_fetch_array($result)) -{ - array_push($cat_ids, $row['id']); -} - -if (count($cat_ids) > 0) -{ - $privates = get_subcat_ids($cat_ids); - - $query = ' -UPDATE '.CATEGORIES_TABLE.' - SET status = \'private\' - WHERE id IN ('.implode(',', $privates).') -;'; - pwg_query($query); -} - -$new_time = get_moment(); -echo '
['.get_elapsed_time($last_time, $new_time).']';
-echo ' all sub-categories of private categories become private
'; -flush(); -$last_time = $new_time; - -$infos = array( - 'user permissions and group permissions have been erased', - - 'only thumbnails prefix and webmaster mail address have been saved from -previous configuration', - - 'in include/mysql.inc.php, before -
?>
-insert -
define(\'PHPWG_INSTALLED\', true);
'
-  
-  );
-
-?>
\ No newline at end of file
diff --git a/install/upgrade_1.3.4.php b/install/upgrade_1.3.4.php
deleted file mode 100644
index b046cf112..000000000
--- a/install/upgrade_1.3.4.php
+++ /dev/null
@@ -1,362 +0,0 @@
-['.get_elapsed_time($last_time, $new_time).']';
-echo ' Basic database structure upgrade done
'; -flush(); -$last_time = $new_time; - -execute_sqlfile(PHPWG_ROOT_PATH.'install/config.sql', - 'phpwebgallery_', - PREFIX_TABLE); - -$queries = array( - " -UPDATE phpwebgallery_config - SET value = '".$save['prefix_thumbnail']."' - WHERE param = 'prefix_thumbnail' -;", - - " -UPDATE phpwebgallery_config - SET value = '".$save['mail_webmaster']."' - WHERE param = 'mail_webmaster' -;" - ); - -foreach ($queries as $query) -{ - $query = str_replace('phpwebgallery_', PREFIX_TABLE, $query); - pwg_query($query); -} - -$new_time = get_moment(); -echo '
['.get_elapsed_time($last_time, $new_time).']';
-echo ' Saved configuration information restored
'; -flush(); -$last_time = $new_time; - -ordering(); -update_global_rank(); -update_category(); - -$new_time = get_moment(); -echo '
['.get_elapsed_time($last_time, $new_time).']';
-echo ' Calculated data updated (categories.rank, categories.global_rank,
-categories.date_last, categories.representative_picture_id,
-categories.nb_images)
'; -flush(); -$last_time = $new_time; - -// update calculated field "images.path" -$cat_ids = array(); - -$query = ' -SELECT DISTINCT(storage_category_id) AS unique_storage_category_id - FROM '.IMAGES_TABLE.' -;'; -$result = pwg_query($query); -while ($row = mysql_fetch_array($result)) -{ - array_push($cat_ids, $row['unique_storage_category_id']); -} -$fulldirs = get_fulldirs($cat_ids); - -foreach ($cat_ids as $cat_id) -{ - $query = ' -UPDATE '.IMAGES_TABLE.' - SET path = CONCAT(\''.$fulldirs[$cat_id].'\',\'/\',file) - WHERE storage_category_id = '.$cat_id.' -;'; - pwg_query($query); -} - -$new_time = get_moment(); -echo '
['.get_elapsed_time($last_time, $new_time).']';
-echo ' new column images.path filled
'; -flush(); -$last_time = $new_time; - -// all sub-categories of private categories become private -$cat_ids = array(); - -$query = ' -SELECT id - FROM '.CATEGORIES_TABLE.' - WHERE status = \'private\' -;'; -$result = pwg_query($query); -while ($row = mysql_fetch_array($result)) -{ - array_push($cat_ids, $row['id']); -} - -if (count($cat_ids) > 0) -{ - $privates = get_subcat_ids($cat_ids); - - $query = ' -UPDATE '.CATEGORIES_TABLE.' - SET status = \'private\' - WHERE id IN ('.implode(',', $privates).') -;'; - pwg_query($query); -} - -$new_time = get_moment(); -echo '
['.get_elapsed_time($last_time, $new_time).']';
-echo ' all sub-categories of private categories become private
'; -flush(); -$last_time = $new_time; - -$infos = array( - 'user permissions and group permissions have been erased', - - 'only thumbnails prefix and webmaster mail address have been saved from -previous configuration', - - 'in include/mysql.inc.php, before -
?>
-insert -
define(\'PHPWG_INSTALLED\', true);
'
-  
-  );
-
-?>
\ No newline at end of file
diff --git a/install/upgrade_1.4.0.php b/install/upgrade_1.4.0.php
new file mode 100644
index 000000000..ea17f32a4
--- /dev/null
+++ b/install/upgrade_1.4.0.php
@@ -0,0 +1,275 @@
+['.get_elapsed_time($last_time, $new_time).']';
+echo ' Basic database structure upgrade done
'; +flush(); +$last_time = $new_time; + +// user datas migration from phpwebgallery_users to phpwebgallery_user_infos +$query = ' +SELECT * + FROM '.USERS_TABLE.' +;'; + +$datas = array(); +list($dbnow) = mysql_fetch_row(pwg_query('SELECT NOW();')); + +$result = pwg_query($query); +while ($row = mysql_fetch_array($result)) +{ + $row['user_id'] = $row['id']; + $row['registration_date'] = $dbnow; + array_push($datas, $row); +} + +include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); +mass_inserts( + USER_INFOS_TABLE, + array( + 'user_id', + 'nb_image_line', + 'nb_line_page', + 'status', + 'language', + 'maxwidth', + 'maxheight', + 'expand', + 'show_nb_comments', + 'recent_period', + 'template', + 'registration_date' + ), + $datas + ); + +$queries = array( + + " +UPDATE ".USER_INFOS_TABLE." + SET template = 'yoga' +;", + + " +UPDATE ".USER_INFOS_TABLE." + SET language = 'en_UK.iso-8859-1' + WHERE language NOT IN ('en_UK.iso-8859-1', 'fr_FR.iso-8859-1') +;", + + " +UPDATE ".CONFIG_TABLE." + SET value = 'en_UK.iso-8859-1' + WHERE param = 'default_language' + AND value NOT IN ('en_UK.iso-8859-1', 'fr_FR.iso-8859-1') +;", + + " +UPDATE ".CONFIG_TABLE." + SET value = 'yoga' + WHERE param = 'default_template' +;" + + ); + +foreach ($queries as $query) +{ + $query = str_replace('phpwebgallery_', PREFIX_TABLE, $query); + pwg_query($query); +} + +$infos = array(); + +if ($prefix_thumbnail != 'TN-') +{ + array_push( + $infos, + 'the thumbnail prefix configuration parameter was moved to configuration +file, copy config_local.inc.php from "tools" directory to "include" directory +and edit $conf[\'prefix_thumbnail\'] = '.$prefix_thumbnail + ); +} + +?> \ No newline at end of file diff --git a/install/upgrade_1.4.1.php b/install/upgrade_1.4.1.php new file mode 100644 index 000000000..ea17f32a4 --- /dev/null +++ b/install/upgrade_1.4.1.php @@ -0,0 +1,275 @@ +['.get_elapsed_time($last_time, $new_time).']'; +echo ' Basic database structure upgrade done
'; +flush(); +$last_time = $new_time; + +// user datas migration from phpwebgallery_users to phpwebgallery_user_infos +$query = ' +SELECT * + FROM '.USERS_TABLE.' +;'; + +$datas = array(); +list($dbnow) = mysql_fetch_row(pwg_query('SELECT NOW();')); + +$result = pwg_query($query); +while ($row = mysql_fetch_array($result)) +{ + $row['user_id'] = $row['id']; + $row['registration_date'] = $dbnow; + array_push($datas, $row); +} + +include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); +mass_inserts( + USER_INFOS_TABLE, + array( + 'user_id', + 'nb_image_line', + 'nb_line_page', + 'status', + 'language', + 'maxwidth', + 'maxheight', + 'expand', + 'show_nb_comments', + 'recent_period', + 'template', + 'registration_date' + ), + $datas + ); + +$queries = array( + + " +UPDATE ".USER_INFOS_TABLE." + SET template = 'yoga' +;", + + " +UPDATE ".USER_INFOS_TABLE." + SET language = 'en_UK.iso-8859-1' + WHERE language NOT IN ('en_UK.iso-8859-1', 'fr_FR.iso-8859-1') +;", + + " +UPDATE ".CONFIG_TABLE." + SET value = 'en_UK.iso-8859-1' + WHERE param = 'default_language' + AND value NOT IN ('en_UK.iso-8859-1', 'fr_FR.iso-8859-1') +;", + + " +UPDATE ".CONFIG_TABLE." + SET value = 'yoga' + WHERE param = 'default_template' +;" + + ); + +foreach ($queries as $query) +{ + $query = str_replace('phpwebgallery_', PREFIX_TABLE, $query); + pwg_query($query); +} + +$infos = array(); + +if ($prefix_thumbnail != 'TN-') +{ + array_push( + $infos, + 'the thumbnail prefix configuration parameter was moved to configuration +file, copy config_local.inc.php from "tools" directory to "include" directory +and edit $conf[\'prefix_thumbnail\'] = '.$prefix_thumbnail + ); +} + +?> \ No newline at end of file -- cgit v1.2.3