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/upgrade_1.4.1.php | 275 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 275 insertions(+) create mode 100644 install/upgrade_1.4.1.php (limited to 'install/upgrade_1.4.1.php') 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