From 73db66afa58cb14c6ced4163c10f4603a3399428 Mon Sep 17 00:00:00 2001 From: plegall Date: Wed, 28 Apr 2010 14:28:05 +0000 Subject: feature 1630: upgrade to Piwigo 2.1 :-) bug 1604: only activate core themes not all themes. git-svn-id: http://piwigo.org/svn/trunk@5982 68402e56-0260-453c-a942-63ccdbb3a9ee --- upgrade.php | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) (limited to 'upgrade.php') diff --git a/upgrade.php b/upgrade.php index 898926849..7383a5e8a 100644 --- a/upgrade.php +++ b/upgrade.php @@ -47,6 +47,7 @@ include(PHPWG_ROOT_PATH . 'include/config_default.inc.php'); define('USERS_TABLE', $prefixeTable.'users'); include_once(PHPWG_ROOT_PATH.'include/constants.php'); define('PREFIX_TABLE', $prefixeTable); +define('UPGRADES_PATH', PHPWG_ROOT_PATH.'install/db'); // +-----------------------------------------------------------------------+ // | functions | @@ -201,9 +202,11 @@ include_once(PHPWG_ROOT_PATH.'admin/include/functions_upgrade.php'); include(PHPWG_ROOT_PATH .'include/dblayer/functions_'.$conf['dblayer'].'.inc.php'); upgrade_db_connect(); - pwg_db_check_charset(); +list($dbnow) = pwg_db_fetch_row(pwg_query('SELECT NOW();')); +define('CURRENT_DATE', $dbnow); + // +-----------------------------------------------------------------------+ // | template initialization | // +-----------------------------------------------------------------------+ @@ -260,6 +263,10 @@ else if (!in_array('md5sum', $columns_of[PREFIX_TABLE.'images'])) { $current_release = '1.7.0'; } +else if (!in_array(PREFIX_TABLE.'themes', $tables)) +{ + $current_release = '2.0.0'; +} else { die('No upgrade required, the database structure is up to date'); @@ -296,12 +303,15 @@ if (isset($_POST['submit']) and check_upgrade()) if (!@file_put_contents($config_file, $config_file_contents)) { - array_push($page['infos'], - l10n_args('In %s, before ?>, insert:', - 'local/config/database.inc.php') . - '

' - ); + array_push( + $page['infos'], + sprintf( + l10n('In %s, before ?>, insert:'), + 'local/config/database.inc.php' + ) + .'

' + ); } } @@ -367,7 +377,15 @@ REPLACE INTO '.PLUGINS_TABLE.' // +-----------------------------------------------------------------------+ else { - foreach (get_languages('utf-8') as $language_code => $language_name) + if (!defined('PWG_CHARSET')) + { + define('PWG_CHARSET', 'utf-8'); + } + + include_once(PHPWG_ROOT_PATH.'admin/include/languages.class.php'); + $languages = new languages(); + + foreach ($languages->fs_languages as $language_code => $language_name) { if ($language == $language_code) { -- cgit v1.2.3