aboutsummaryrefslogtreecommitdiffstats
path: root/upgrade.php
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2010-04-28 14:28:05 +0000
committerplegall <plg@piwigo.org>2010-04-28 14:28:05 +0000
commit73db66afa58cb14c6ced4163c10f4603a3399428 (patch)
treee5546bda92f92c4de6c1f104a66efebd3f462df3 /upgrade.php
parentaaa31653eee276541f693a42159c1ea40421dbfd (diff)
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
Diffstat (limited to '')
-rw-r--r--upgrade.php34
1 files changed, 26 insertions, 8 deletions
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 <i>%s</i>, before <b>?></b>, insert:',
- 'local/config/database.inc.php') .
- '<p><textarea rows="4" cols="40">' .
- implode("\r\n" , $mysql_changes).'</textarea></p>'
- );
+ array_push(
+ $page['infos'],
+ sprintf(
+ l10n('In <i>%s</i>, before <b>?></b>, insert:'),
+ 'local/config/database.inc.php'
+ )
+ .'<p><textarea rows="4" cols="40">'
+ .implode("\r\n" , $mysql_changes).'</textarea></p>'
+ );
}
}
@@ -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)
{