Initial commit: Backup der Webseiten

- zoesch.de
- blitzkiste.net
- gruene-hassberge (norbert.zoesch.de)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Felix Zösch
2025-12-13 01:17:15 +01:00
commit 07c290a453
4607 changed files with 1202735 additions and 0 deletions

View File

@@ -0,0 +1,52 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'add high_width and high_height fields into IMAGES_TABLE';
if ('mysql' == $conf['dblayer'])
{
$query = 'ALTER TABLE '.IMAGES_TABLE.'
ADD COLUMN `high_width` smallint(9) unsigned default NULL,
ADD COLUMN `high_height` smallint(9) unsigned default NULL;';
}
if (in_array($conf['dblayer'], array('pgsql', 'sqlite', 'pdo-sqlite')))
{
$query = 'ALTER TABLE '.IMAGES_TABLE.'
ADD COLUMN "high_width" INTEGER,
ADD COLUMN "high_height" INTEGER;';
}
pwg_query($query);
echo
"\n"
. $upgrade_description
."\n"
;
?>

View File

@@ -0,0 +1,65 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'merge nb_line_page and nb_image_line into nb_image_page';
// add column
if ('mysql' == $conf['dblayer'])
{
pwg_query('
ALTER TABLE '.USER_INFOS_TABLE.'
ADD COLUMN `nb_image_page` smallint(3) unsigned NOT NULL default \'15\'
;');
}
else if (in_array($conf['dblayer'], array('pgsql', 'sqlite', 'pdo-sqlite')))
{
pwg_query('
ALTER TABLE '.USER_INFOS_TABLE.'
ADD COLUMN "nb_image_page" INTEGER default 15 NOT NULL
;');
}
// merge datas
pwg_query('
UPDATE '.USER_INFOS_TABLE.'
SET nb_image_page = nb_line_page*nb_image_line
;');
// delete old columns
pwg_query('
ALTER TABLE '.USER_INFOS_TABLE.'
DROP `nb_line_page`,
DROP `nb_image_line`
;');
echo
"\n"
. $upgrade_description
."\n"
;
?>

View File

@@ -0,0 +1,45 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'change nb_image_page into smallint(3)';
// add column
if ('mysql' == $conf['dblayer'])
{
pwg_query('
ALTER TABLE '.USER_INFOS_TABLE.'
CHANGE `nb_image_page` `nb_image_page` SMALLINT(3) UNSIGNED NOT NULL DEFAULT 15
;');
}
echo
"\n"
. $upgrade_description
."\n"
;
?>

View File

@@ -0,0 +1,42 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'Extensions ignored for update';
$query = '
INSERT INTO '.PREFIX_TABLE.'config (param,value,comment)
VALUES (\'updates_ignored\',\'a:3:{s:7:"plugins";a:0:{}s:6:"themes";a:0:{}s:9:"languages";a:0:{}}\', \''.$upgrade_description.'\')
;';
pwg_query($query);
echo
"\n"
. $upgrade_description
."\n"
;
?>

View File

@@ -0,0 +1,86 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'Add upload form parameters in database';
global $conf;
load_conf_from_db();
$upload_form_config = array(
'websize_resize' => true,
'websize_maxwidth' => 800,
'websize_maxheight' => 600,
'websize_quality' => 95,
'thumb_maxwidth' => 128,
'thumb_maxheight' => 96,
'thumb_quality' => 95,
'thumb_crop' => false,
'thumb_follow_orientation' => true,
'hd_keep' => true,
'hd_resize' => false,
'hd_maxwidth' => 2000,
'hd_maxheight' => 2000,
'hd_quality' => 95,
);
$inserts = array();
foreach ($upload_form_config as $param_shortname => $param)
{
$param_name = 'upload_form_'.$param_shortname;
if (!isset($conf[$param_name]))
{
$conf[$param_name] = $param;
array_push(
$inserts,
array(
'param' => $param_name,
'value' => boolean_to_string($param),
)
);
}
}
if (count($inserts) > 0)
{
mass_inserts(
CONFIG_TABLE,
array_keys($inserts[0]),
$inserts
);
}
echo
"\n"
. $upgrade_description
."\n"
;
?>

View File

@@ -0,0 +1,42 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'Show menubar on picture page';
$query = '
INSERT INTO '.PREFIX_TABLE.'config (param,value,comment)
VALUES (\'picture_menu\',\'false\', \''.$upgrade_description.'\')
;';
pwg_query($query);
echo
"\n"
. $upgrade_description
."\n"
;
?>

View File

@@ -0,0 +1,48 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'add order parameters to bdd';
$query = '
INSERT INTO '.PREFIX_TABLE.'config(param,value,comment)
VALUES (\'order_by\', \''.$conf['order_by'].'\', \'default photos order\')
;';
pwg_query($query);
$query = '
INSERT INTO '.PREFIX_TABLE.'config(param,value,comment)
VALUES (\'order_by_inside_category\', \''.$conf['order_by_inside_category'].'\', \'default photos order inside category\')
;';
pwg_query($query);
echo
"\n"
. $upgrade_description
."\n"
;
?>

View File

@@ -0,0 +1,42 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'Display new icons next albums and pictures';
$query = '
INSERT INTO '.PREFIX_TABLE.'config (param,value,comment)
VALUES (\'index_new_icon\',\'true\',\'Display new icons next albums and pictures\')
;';
pwg_query($query);
echo
"\n"
. $upgrade_description
."\n"
;
?>

View File

@@ -0,0 +1,127 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'add order parameters to bdd #2';
$order_regex = '#^(( *)(id|file|name|date_available|date_creation|hit|average_rate|comment|author|filesize|width|height|high_filesize|high_width|high_height|rank) (ASC|DESC),{1}){1,}$#';
// local file is writable
if ( is_writable($local_file = PHPWG_ROOT_PATH. 'local/config/config.inc.php') )
{
$order_by = str_ireplace(
array('order by ', 'asc', 'desc'),
array(null, 'ASC', 'DESC'),
trim($conf['order_by_inside_category'])
);
// for a simple patern
if ( preg_match($order_regex, $order_by.',') )
{
$order_by = 'ORDER BY '.$order_by;
// update database
$query = '
UPDATE '.PREFIX_TABLE.'config
SET value = \''.preg_replace('# rank (ASC|DESC)(,?)#', null, $order_by).'\'
WHERE param = \'order_by\'
;';
pwg_query($query);
$query = '
UPDATE '.PREFIX_TABLE.'config
SET value = \''.$order_by.'\'
WHERE param = \'order_by_inside_category\'
';
pwg_query($query);
// update local file (delete lines)
$local_config = file($local_file);
$new_local_config = array();
foreach ($local_config as $line)
{
if (strpos($line, 'order_by') === false)
{
$new_local_config[] = $line;
}
}
var_dump($new_local_config);
file_put_contents(
$local_file,
implode("", $new_local_config)
);
}
// for a complex patern
else
{
// update database with default param
$query = '
UPDATE '.PREFIX_TABLE.'config
SET value = \'ORDER BY date_available DESC, file ASC, id ASC\'
WHERE param = \'order_by\'
;';
pwg_query($query);
$query = '
UPDATE '.PREFIX_TABLE.'config
SET value = \'ORDER BY date_available DESC, file ASC, id ASC\'
WHERE param = \'order_by_inside_category\'
';
pwg_query($query);
// update local file (rename lines)
$local_config = file_get_contents($local_file);
$new_local_config = str_replace(
array("['order_by']", "['order_by_inside_category']"),
array("['order_by_custom']", "['order_by_inside_category_custom']"),
$local_config
);
file_put_contents($local_file, $new_local_config);
}
}
// local file is locked
else
{
// update database with default param
$query = '
UPDATE '.PREFIX_TABLE.'config
SET value = \'ORDER BY date_available DESC, file ASC, id ASC\'
WHERE param = \'order_by\'
;';
pwg_query($query);
$query = '
UPDATE '.PREFIX_TABLE.'config
SET value = \'ORDER BY date_available DESC, file ASC, id ASC\'
WHERE param = \'order_by_inside_category\'
';
pwg_query($query);
}
echo
"\n"
. $upgrade_description
."\n"
;
?>

View File

@@ -0,0 +1,41 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
$upgrade_description = 'Rename #images.average_rate to ratingscore.';
include_once(PHPWG_ROOT_PATH.'include/constants.php');
if ('mysql' == $conf['dblayer'])
$q = 'ALTER TABLE '.IMAGES_TABLE.' CHANGE average_rate rating_score float(5,2) unsigned default NULL';
else
$q = 'ALTER TABLE '.IMAGES_TABLE.' RENAME average_rate TO rating_score';
pwg_query($q);
$q="UPDATE ".CATEGORIES_TABLE." SET image_order=REPLACE(image_order, 'average_rate', 'rating_score')";
pwg_query($q);
$q="UPDATE ".CONFIG_TABLE." SET value=REPLACE(value, 'average_rate', 'rating_score')
WHERE param IN ('picture_informations', 'order_by', 'order_by_inside_category')";
pwg_query($q);
?>

View File

@@ -0,0 +1,117 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
$upgrade_description = 'Move "gallery_url" parameter from config table to local configuration file';
include_once(PHPWG_ROOT_PATH.'include/constants.php');
if (!isset($page))
{
$page = array();
}
if (!isset($page['errors']))
{
$page['errors'] = array();
}
$query = '
SELECT
value
FROM '.CONFIG_TABLE.'
WHERE param =\'gallery_url\'
;';
list($gallery_url) = pwg_db_fetch_row(pwg_query($query));
if (!empty($gallery_url))
{
// let's try to write it in the local configuration file
$local_conf = PHPWG_ROOT_PATH. 'local/config/config.inc.php';
if (isset($conf['local_dir_site']))
{
$local_conf = PHPWG_ROOT_PATH.PWG_LOCAL_DIR.'config/config.inc.php';
}
$conf_line = '$conf[\'gallery_url\'] = \''.$gallery_url.'\';';
if (!is_file($local_conf))
{
$config_file_contents_new = "<?php\n".$conf_line."\n?>";
}
else
{
// we have to update the local conf
$config_file_contents = @file_get_contents($local_conf);
if ($config_file_contents === false)
{
$error = 'Cannot load '.$local_conf.', add by hand: '.$conf_line;
array_push($page['errors'], $error);
echo $error;
}
else
{
$php_end_tag = strrpos($config_file_contents, '?'.'>');
if ($php_end_tag === false)
{
// the file is empty
$config_file_contents_new = "<?php\n".$conf_line."\n?>";
}
else
{
$config_file_contents_new =
substr($config_file_contents, 0, $php_end_tag) . "\n"
.$conf_line."\n"
.substr($config_file_contents, $php_end_tag)
;
}
}
}
if (isset($config_file_contents_new))
{
if (!@file_put_contents($local_conf, $config_file_contents_new))
{
$error = 'Cannot write into local configuration file '.$local_conf.', add by hand: '.$conf_line;
array_push($page['errors'], $error);
echo $error;
}
}
}
$query = '
DELETE
FROM '.CONFIG_TABLE.'
WHERE param =\'gallery_url\'
;';
pwg_query($query);
echo
"\n"
. $upgrade_description
."\n"
;
?>

View File

@@ -0,0 +1,53 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'New colum user_infos.activation_key';
// Add column
$query = 'ALTER TABLE '.USER_INFOS_TABLE.' ADD COLUMN ';
if ('mysql' == $conf['dblayer'])
{
$query.= ' `activation_key` char(20) default NULL';
}
if (in_array($conf['dblayer'], array('pgsql', 'sqlite', 'pdo-sqlite')))
{
$query.= ' "activation_key" CHAR(20) default NULL';
}
$query.= ';';
pwg_query($query);
echo
"\n"
. $upgrade_description
."\n"
;
?>

View File

@@ -0,0 +1,54 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'Change combined dir';
// Add column
$query = 'DELETE FROM '.CONFIG_TABLE.'
WHERE param IN (\'local_data_dir_checked\', \'combined_dir_checked\') ';
pwg_query($query);
$dir=PHPWG_ROOT_PATH.'local/combined/';
if (is_dir($dir))
{
foreach (glob($dir.'*.css') as $file)
{
@unlink($file);
}
foreach (glob($dir.'*.js') as $file)
@unlink($file);
@unlink($dir.'index.htm');
@rmdir($dir);
}
echo
"\n"
. $upgrade_description
."\n"
;
?>

View File

@@ -0,0 +1,41 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'New settings for resizing original photo (related to multiple sizes feature)';
conf_update_param('original_resize', 'false');
conf_update_param('original_resize_maxwidth', 2016);
conf_update_param('original_resize_maxheight', 2016);
conf_update_param('original_resize_quality', 95);
echo
"\n"
. $upgrade_description
."\n"
;
?>

View File

@@ -0,0 +1,38 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'new parameter: Activate comments';
conf_update_param('activate_comments', 'true');
echo
"\n"
. $upgrade_description
."\n"
;
?>

View File

@@ -0,0 +1,38 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'New setting for comments order on picture page';
conf_update_param('comments_order', 'ASC');
echo
"\n"
. $upgrade_description
."\n"
;
?>

View File

@@ -0,0 +1,48 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'Add #images.coi';
include_once(PHPWG_ROOT_PATH.'include/constants.php');
// +-----------------------------------------------------------------------+
// | Upgrade content |
// +-----------------------------------------------------------------------+
$query = '
ALTER TABLE '.IMAGES_TABLE.' ADD COLUMN coi CHAR(4) DEFAULT NULL COMMENT \'center of interest\' AFTER height
';
pwg_query($query);
echo
"\n"
.'"'.$upgrade_description.'"'.' ended'
."\n"
;
?>

View File

@@ -0,0 +1,65 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'fill empty images name with filename';
include_once(PHPWG_ROOT_PATH.'include/constants.php');
// +-----------------------------------------------------------------------+
// | Upgrade content |
// +-----------------------------------------------------------------------+
$query = 'SELECT id, file FROM '.IMAGES_TABLE.' WHERE name IS NULL;';
$images = pwg_query($query);
$updates = array();
while ($row = pwg_db_fetch_assoc($images))
{
$updates[] = array(
'id' => $row['id'],
'name' => get_name_from_file($row['file']),
);
}
mass_updates(
IMAGES_TABLE,
array(
'primary' => array('id'),
'update' => array('name'),
),
$updates
);
echo
"\n"
.'"'.$upgrade_description.'"'.' ended'
."\n"
;
?>

View File

@@ -0,0 +1,41 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'Automatically activate mobile theme.';
include_once(PHPWG_ROOT_PATH.'include/constants.php');
include_once(PHPWG_ROOT_PATH.'admin/include/themes.class.php');
$themes = new themes();
$themes->perform_action('activate', 'smartpocket');
echo
"\n"
. $upgrade_description
."\n"
;
?>

View File

@@ -0,0 +1,48 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'Reset derivative configuration to include XXS and XS sizes.';
include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
clear_derivative_cache();
$derivative_conf_file = PHPWG_ROOT_PATH.$conf['data_location'].'derivatives.dat';
if (is_file($derivative_conf_file))
{
unlink($derivative_conf_file);
}
conf_update_param('derivatives', '');
echo
"\n"
. $upgrade_description
."\n"
;
?>

View File

@@ -0,0 +1,39 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'rotation mode (code, not angle) is stored in the database';
$query = 'ALTER TABLE '.IMAGES_TABLE.' ADD COLUMN rotation tinyint unsigned DEFAULT NULL';
pwg_query($query);
echo
"\n"
. $upgrade_description
."\n"
;
?>

View File

@@ -0,0 +1,39 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
// see http://piwigo.org/doc/doku.php?id=user_documentation:htaccess_and_hotlink_in_2.4
$upgrade_description = 'add/append htaccess for hotlinks (cancelled, see plugin "Hotlink Compatibility")';
echo
"\n"
. $upgrade_description
."\n"
;
?>

View File

@@ -0,0 +1,83 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'derivatives: new organization of "upload" and "galleries" directories';
$query = '
SELECT
id,
path,
tn_ext,
has_high,
high_filesize,
high_width,
high_height
FROM '.IMAGES_TABLE.'
;';
$result = pwg_query($query);
$starttime = get_moment();
$updates = array();
while ($row = pwg_db_fetch_assoc($result))
{
if ('true' == $row['has_high'])
{
$high_path = dirname($row['path']).'/pwg_high/'.basename($row['path']);
rename($high_path, $row['path']);
array_push(
$updates,
array(
'id' => $row['id'],
'width' => $row['high_width'],
'height' => $row['high_height'],
'filesize' => $row['high_filesize'],
)
);
}
}
if (count($updates) > 0)
{
mass_updates(
IMAGES_TABLE,
array(
'primary' => array('id'),
'update' => array('width', 'height', 'filesize'),
),
$updates
);
}
echo
"\n"
. $upgrade_description.sprintf(' (execution in %.3fs)', (get_moment() - $starttime))
."\n"
;
?>

View File

@@ -0,0 +1,218 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'convert 2.3 resize settings into 2.4 derivative settings';
include_once(PHPWG_ROOT_PATH.'include/constants.php');
$dbconf = array();
$conf_orig = $conf;
load_conf_from_db();
$dbconf = $conf;
$conf = $conf_orig;
//
// Piwigo 2.3 "HD resize" settings become "original resize" settings in Piwigo 2.4
//
if ($dbconf['upload_form_hd_keep'])
{
if ($dbconf['upload_form_hd_resize'])
{
conf_update_param('original_resize', 'true');
conf_update_param('original_resize_maxwidth', $dbconf['upload_form_hd_maxwidth']);
conf_update_param('original_resize_maxheight', $dbconf['upload_form_hd_maxheight']);
conf_update_param('original_resize_quality', $dbconf['upload_form_hd_quality']);
}
}
else
{
// The user has decided to remove the high quality. In Piwigo 2.4, this
// setting does not exists anymore, but we can simulate it by an original
// resize with 2.3 websize dimensions
conf_update_param('original_resize', 'true');
conf_update_param(
'original_resize_maxwidth',
is_numeric($dbconf['upload_form_websize_maxwidth']) ? $dbconf['upload_form_websize_maxwidth'] : 800
);
conf_update_param(
'original_resize_maxheight',
is_numeric($dbconf['upload_form_websize_maxheight']) ? $dbconf['upload_form_websize_maxheight'] : 600
);
conf_update_param('original_resize_quality', $dbconf['upload_form_hd_quality']);
}
$types = ImageStdParams::get_default_sizes();
//
// Piwigo 2.3 "thumbnail" becomes "thumb" size in Piwigo 2.4
//
$thumb_width_min = 128; // the default value in Piwigo 2.3
$thumb_width_max = 300; // slightly bigger than XXS default maxwidth
$thumb_height_min = 96; // the default value in Piwigo 2.3
$thumb_height_max = 300; // slightly bigger than XXS default maxheight
$thumb_is_square = false;
if ($dbconf['upload_form_thumb_crop'])
{
if ($dbconf['upload_form_thumb_maxwidth'] == $dbconf['upload_form_thumb_maxheight'])
{
$thumb_is_square = true;
}
}
if ($dbconf['upload_form_thumb_maxwidth'] < $thumb_width_min)
{
$dbconf['upload_form_thumb_maxwidth'] = $thumb_width_min;
}
if ($dbconf['upload_form_thumb_maxwidth'] > $thumb_width_max)
{
$dbconf['upload_form_thumb_maxwidth'] = $thumb_width_max;
}
if ($dbconf['upload_form_thumb_maxheight'] < $thumb_height_min)
{
$dbconf['upload_form_thumb_maxheight'] = $thumb_height_min;
}
if ($dbconf['upload_form_thumb_maxheight'] > $thumb_height_max)
{
$dbconf['upload_form_thumb_maxheight'] = $thumb_height_max;
}
if ($thumb_is_square)
{
$dbconf['upload_form_thumb_maxheight'] = $dbconf['upload_form_thumb_maxwidth'];
}
$size = array($dbconf['upload_form_thumb_maxwidth'], $dbconf['upload_form_thumb_maxheight']);
$thumb = new DerivativeParams(
new SizingParams(
$size,
$dbconf['upload_form_thumb_crop'] ? 1 : 0,
$dbconf['upload_form_thumb_crop'] ? $size : null
)
);
$types[IMG_THUMB] = $thumb;
// slightly enlarge XSS to be bigger than thumbnail size (but smaller than XS)
if ($dbconf['upload_form_thumb_maxwidth'] >= $types[IMG_XXSMALL]->sizing->ideal_size[0]
or $dbconf['upload_form_thumb_maxheight'] >= $types[IMG_XXSMALL]->sizing->ideal_size[1])
{
$xxs_maxwidth = $types[IMG_XXSMALL]->sizing->ideal_size[0];
if ($dbconf['upload_form_thumb_maxwidth'] >= $xxs_maxwidth)
{
$xxs_maxwidth = 350;
}
$xxs_maxheight = $types[IMG_XXSMALL]->sizing->ideal_size[1];
if ($dbconf['upload_form_thumb_maxheight'] >= $xxs_maxheight)
{
$xxs_maxheight = 310;
}
$xxs = new DerivativeParams(new SizingParams(array($xxs_maxwidth, $xxs_maxheight)));
$types[IMG_XXSMALL] = $xxs;
}
//
// Piwigo 2.3 "websize" becomes "medium" size in Piwigo 2.4
//
// if there was no "websize resize" on Piwigo 2.3, we can't take the resize
// settings into account, we keep the default settings of Piwigo 2.4.
if ($dbconf['upload_form_websize_resize'])
{
$medium_width_min = 577; // default S maxwidth + 1 pixel
$medium_width_max = 1007; // default L maxwidth - 1 pixel
$medium_height_min = 433; // default S maxheight + 1 pixel
$medium_height_max = 755; // default L maxheight - 1 pixel
// width
if (!is_numeric($dbconf['upload_form_websize_maxwidth'])) // sometimes maxwidth="false"
{
$dbconf['upload_form_websize_maxwidth'] = $medium_width_max;
}
if ($dbconf['upload_form_websize_maxwidth'] < $medium_width_min)
{
$dbconf['upload_form_websize_maxwidth'] = $medium_width_min;
}
if ($dbconf['upload_form_websize_maxwidth'] > $medium_width_max)
{
$dbconf['upload_form_websize_maxwidth'] = $medium_width_max;
}
// height
if (!is_numeric($dbconf['upload_form_websize_maxheight'])) // sometimes maxheight="false"
{
$dbconf['upload_form_websize_maxheight'] = $medium_height_max;
}
if ($dbconf['upload_form_websize_maxheight'] < $medium_height_min)
{
$dbconf['upload_form_websize_maxheight'] = $medium_height_min;
}
if ($dbconf['upload_form_websize_maxheight'] > $medium_height_max)
{
$dbconf['upload_form_websize_maxheight'] = $medium_height_max;
}
$medium = new DerivativeParams(
new SizingParams(
array(
$dbconf['upload_form_websize_maxwidth'],
$dbconf['upload_form_websize_maxheight']
)
)
);
$types[IMG_MEDIUM] = $medium;
}
//
// Save derivative new settings
//
ImageStdParams::set_and_save($types);
pwg_query('DELETE FROM '.CONFIG_TABLE.' WHERE param = \'disabled_derivatives\'');
clear_derivative_cache();
echo "\n".$upgrade_description."\n";
?>

View File

@@ -0,0 +1,60 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'derivatives: remove useless configuration settings and columns';
include_once(PHPWG_ROOT_PATH.'include/constants.php');
//
// Clean useless configuration settings
//
pwg_query('DELETE FROM '.CONFIG_TABLE.' WHERE param like \'upload_form_%\';');
//
// Remove useless columns
//
$query = '
ALTER TABLE '.USER_INFOS_TABLE.'
DROP `maxwidth`,
DROP `maxheight`
;';
pwg_query($query);
$query = '
ALTER TABLE '.IMAGES_TABLE.'
DROP `high_width`,
DROP `high_height`,
DROP `high_filesize`,
DROP `has_high`,
DROP `tn_ext`
;';
pwg_query($query);
echo "\n".$upgrade_description."\n";
?>

View File

@@ -0,0 +1,197 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'derivatives: search and replace hotlinks inside Piwigo (page_banner';
include_once(PHPWG_ROOT_PATH.'include/constants.php');
if (!isset($conf['prefix_thumbnail']))
{
$conf['prefix_thumbnail'] = 'TN-';
}
if (!isset($conf['dir_thumbnail']))
{
$conf['dir_thumbnail'] = 'thumbnail';
}
$dbconf = array();
$conf_orig = $conf;
load_conf_from_db();
$dbconf = $conf;
$conf = $conf_orig;
$banner_orig = $dbconf['page_banner'];
$banner_new = replace_hotlinks($dbconf['page_banner']);
if ($banner_orig != $banner_new)
{
conf_update_param('page_banner', pwg_db_real_escape_string($banner_new));
}
//
// Additional Pages
//
$is_plugin_installed = false;
$plugin_table = $prefixeTable.'additionalpages';
$query = 'SHOW TABLES LIKE \''.$plugin_table.'\';';
$result = pwg_query($query);
while ($row = pwg_db_fetch_row($result))
{
if ($plugin_table == $row[0])
{
$is_plugin_installed = true;
}
}
if ($is_plugin_installed)
{
$query = '
SELECT
id,
content
FROM '.$plugin_table.'
;';
$result = pwg_query($query);
while ($row = pwg_db_fetch_assoc($result))
{
$content_orig = $row['content'];
$content_new = replace_hotlinks($content_orig);
if ($content_orig != $content_new)
{
single_update(
$plugin_table,
array('content' => pwg_db_real_escape_string($content_new)),
array('id' => $row['id'])
);
}
}
$upgrade_description.= ', Additional Pages';
}
//
// PWG Stuffs
//
$is_plugin_installed = false;
$plugin_table = $prefixeTable.'stuffs';
$query = 'SHOW TABLES LIKE \''.$plugin_table.'\';';
$result = pwg_query($query);
while ($row = pwg_db_fetch_row($result))
{
if ($plugin_table == $row[0])
{
$is_plugin_installed = true;
}
}
if ($is_plugin_installed)
{
$query = '
SELECT
id,
datas
FROM '.$plugin_table.'
WHERE path LIKE \'%plugins/PWG_Stuffs/modules/Personal%\'
;';
$result = pwg_query($query);
while ($row = pwg_db_fetch_assoc($result))
{
$content_orig = $row['datas'];
$content_new = serialize(replace_hotlinks(unserialize($content_orig)));
if ($content_orig != $content_new)
{
single_update(
$plugin_table,
array('datas' => pwg_db_real_escape_string($content_new)),
array('id' => $row['id'])
);
}
}
$upgrade_description.= ', PWG Stuffs';
}
$upgrade_description.= ')';
echo "\n".$upgrade_description."\n";
// +-----------------------------------------------------------------------+
// | Functions |
// +-----------------------------------------------------------------------+
function replace_hotlinks($string)
{
global $conf;
// websize 2.3 = medium 2.4
$string = preg_replace(
'#(upload/\d{4}/\d{2}/\d{2}/\d{14}-\w{8})(\.(jpg|png))#',
'i.php?/$1-me$2',
$string
);
// I've tried but I didn't find the way to do it correctly
// $string = preg_replace(
// '#(galleries/.*?/)(?!:(pwg_high|'.$conf['dir_thumbnail'].')/)([^/]*?)(\.[a-z0-9]{3,4})([\'"])#',
// 'i.php?/(1=$1)(2=$2)-me(3=$3)(4=$4)', // 'i.php?/$1$2-me$3',
// $string
// );
// thumbnail 2.3 = th size 2.4
$string = preg_replace(
'#(upload/\d{4}/\d{2}/\d{2}/)'.$conf['dir_thumbnail'].'/'.$conf['prefix_thumbnail'].'(\d{14}-\w{8})(\.(jpg|png))#',
'i.php?/$1$2-th$3',
$string
);
$string = preg_replace(
'#(galleries/.*?/)'.$conf['dir_thumbnail'].'/'.$conf['prefix_thumbnail'].'(.*?)(\.[a-z0-9]{3,4})([\'"])#',
'i.php?/$1$2-th$3$4',
$string
);
// HD 2.3 = original 2.4
$string = preg_replace(
'#(upload/\d{4}/\d{2}/\d{2}/)pwg_high/(\d{14}-\w{8}\.(jpg|png))#',
'$1$2',
$string
);
$string = preg_replace(
'#(galleries/.*?)/pwg_high(/.*?\.[a-z0-9]{3,4})#',
'$1$2',
$string
);
return $string;
}
?>

View File

@@ -0,0 +1,48 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'rename language sl_SL into sl_SI';
include_once(PHPWG_ROOT_PATH.'include/constants.php');
$query = '
UPDATE '.USER_INFOS_TABLE.'
SET language = \'sl_SI\'
WHERE language = \'sl_SL\'
;';
pwg_query($query);
$query = '
UPDATE '.LANGUAGES_TABLE.'
SET id = \'sl_SI\'
WHERE id = \'sl_SL\'
;';
pwg_query($query);
echo "\n".$upgrade_description."\n";
?>

View File

@@ -0,0 +1,48 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'rename language no_NO into nb_NO';
include_once(PHPWG_ROOT_PATH.'include/constants.php');
$query = '
UPDATE '.USER_INFOS_TABLE.'
SET language = \'nb_NO\'
WHERE language = \'no_NO\'
;';
pwg_query($query);
$query = '
UPDATE '.LANGUAGES_TABLE.'
SET id = \'nb_NO\'
WHERE id = \'no_NO\'
;';
pwg_query($query);
echo "\n".$upgrade_description."\n";
?>

View File

@@ -0,0 +1,38 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'add anonymous_id in comments table';
include_once(PHPWG_ROOT_PATH.'include/constants.php');
$query = 'ALTER TABLE `'.COMMENTS_TABLE.'` ADD `anonymous_id` VARCHAR( 45 ) DEFAULT NULL;';
pwg_query($query);
echo "\n".$upgrade_description."\n";
?>

View File

@@ -0,0 +1,38 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'add "website_url" field in comments table';
include_once(PHPWG_ROOT_PATH.'include/constants.php');
$query = 'ALTER TABLE `'.COMMENTS_TABLE.'` ADD `website_url` varchar(255) DEFAULT NULL;';
pwg_query($query);
echo "\n".$upgrade_description."\n";
?>

View File

@@ -0,0 +1,41 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'add "email" field in comments table';
include_once(PHPWG_ROOT_PATH.'include/constants.php');
$query = 'ALTER TABLE `'.COMMENTS_TABLE.'` ADD `email` varchar(255) default NULL;';
pwg_query($query);
conf_update_param('comments_author_mandatory', 'false');
conf_update_param('comments_email_mandatory', 'false');
echo "\n".$upgrade_description."\n";
?>

View File

@@ -0,0 +1,35 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'add "nb_categories_page" parameter';
conf_update_param('nb_categories_page', '50');
echo "\n".$upgrade_description."\n";
?>

View File

@@ -0,0 +1,36 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
$upgrade_description = 'Enlarge #users.password to increase security.';
global $prefixeTable;
// we don't use USERS_TABLE because it might be an external table, here we
// want to change to users table specific to Piwigo
$query = 'ALTER TABLE '.$prefixeTable.'users CHANGE password password varchar(255) default NULL';
pwg_query($query);
echo "\n".$upgrade_description."\n";
?>

View File

@@ -0,0 +1,35 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
$upgrade_description = '#categories.site_id default value.';
$query = 'ALTER TABLE '.CATEGORIES_TABLE.' CHANGE site_id site_id tinyint(4) unsigned default NULL';
pwg_query($query);
$query = 'UPDATE '.CATEGORIES_TABLE.' SET site_id=NULL WHERE dir IS NULL';
pwg_query($query);
echo "\n".$upgrade_description."\n";
?>

View File

@@ -0,0 +1,43 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
$upgrade_description = 'replace dblayer to "mysqli" if available.';
global $conf;
$config_file = PHPWG_ROOT_PATH.PWG_LOCAL_DIR .'config/database.inc.php';
if ( extension_loaded('mysqli') and $conf['dblayer']=='mysql' and is_writable($config_file) )
{
$file_content = file_get_contents($config_file);
$file_content = preg_replace(
'#\$conf\[\'dblayer\'\]( *)=( *)\'mysql\';#',
'$conf[\'dblayer\']$1=$2\'mysqli\';',
$file_content);
file_put_contents($config_file, $file_content);
}
echo "\n".$upgrade_description."\n";
?>

View File

@@ -0,0 +1,47 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
$upgrade_description = 'add nb available comments/tags';
$query = 'ALTER TABLE '.USER_INFOS_TABLE.'
ADD PRIMARY KEY (`user_id`)
, DROP INDEX `user_infos_ui1`';
pwg_query($query);
$query = 'ALTER TABLE '.USER_CACHE_TABLE.'
ADD COLUMN `last_photo_date` datetime DEFAULT NULL AFTER `nb_total_images`';
pwg_query($query);
invalidate_user_cache();
$query = 'ALTER TABLE '.USER_CACHE_TABLE.'
ADD COLUMN `nb_available_tags` INT(5) DEFAULT NULL AFTER `last_photo_date`';
pwg_query($query);
$query = 'ALTER TABLE '.USER_CACHE_TABLE.'
ADD COLUMN `nb_available_comments` INT(5) DEFAULT NULL AFTER `nb_available_tags`';
pwg_query($query);
echo "\n".$upgrade_description."\n";
?>

View File

@@ -0,0 +1,37 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
$upgrade_description = 'add nb direct child categories';
$query = '
ALTER TABLE '.USER_CACHE_CATEGORIES_TABLE.'
ADD COLUMN nb_categories mediumint(8) unsigned NOT NULL default 0 AFTER count_images';
pwg_query($query);
invalidate_user_cache();
echo "\n".$upgrade_description."\n";
?>

View File

@@ -0,0 +1,62 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
$upgrade_description = 'add ASC keyword to categories image_order field';
$query = '
SELECT id, image_order
FROM '.CATEGORIES_TABLE.'
WHERE image_order != ""
;';
$cats = hash_from_query($query, 'id');
foreach ($cats as $id => &$data)
{
$image_order = explode(',',$data['image_order']);
foreach ($image_order as &$order)
{
if (strpos($order, ' ASC')===false && strpos($order, ' DESC')===false)
{
$order.= ' ASC';
}
}
unset($order);
$data['image_order'] = implode(',',$image_order);
}
unset($data);
mass_updates(CATEGORIES_TABLE,
array(
'primary' => array('id'),
'update' => array('image_order'),
),
$cats
);
echo "\n".$upgrade_description."\n";
?>

View File

@@ -0,0 +1,35 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'add "mail_theme" parameter';
conf_update_param('mail_theme', 'clear');
echo "\n".$upgrade_description."\n";
?>

View File

@@ -0,0 +1,64 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'add "latitude" and "longitude" fields';
// add fields
$query = '
ALTER TABLE '. IMAGES_TABLE .'
ADD `latitude` DOUBLE(8, 6) DEFAULT NULL,
ADD `longitude` DOUBLE(9, 6) DEFAULT NULL
;';
pwg_query($query);
// add index
$query = '
ALTER TABLE '. IMAGES_TABLE .'
ADD INDEX `images_i6` (`latitude`)
;';
pwg_query($query);
// search for old "lat" field
$query = 'SHOW COLUMNS FROM '. IMAGES_TABLE .' LIKE "lat";';
if (pwg_db_num_rows(pwg_query($query)))
{
// duplicate non-null values
$query = '
UPDATE '. IMAGES_TABLE .'
SET latitude = lat,
longitude = lon
WHERE lat IS NOT NULL
AND lon IS NOT NULL
;';
pwg_query($query);
}
echo "\n".$upgrade_description."\n";
?>

View File

@@ -0,0 +1,37 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = '#tags.name is not binary';
// add fields
$query = 'ALTER TABLE '.TAGS_TABLE.' CHANGE COLUMN `name` `name` VARCHAR(255) NOT NULL DEFAULT \'\'';
pwg_query($query);
echo "\n".$upgrade_description."\n";
?>

View File

@@ -0,0 +1,45 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
$upgrade_description = 'add lastmodified field for categories, images, groups, users, tags';
$tables = array(
CATEGORIES_TABLE,
GROUPS_TABLE,
IMAGES_TABLE,
TAGS_TABLE,
USER_INFOS_TABLE
);
foreach ($tables as $table)
{
pwg_query('
ALTER TABLE '. $table .'
ADD `lastmodified` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
ADD INDEX `lastmodified` (`lastmodified`)
;');
}
echo "\n".$upgrade_description."\n";

View File

@@ -0,0 +1,35 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'add "comments_enable_website" parameter';
conf_update_param('comments_enable_website', 'true');
echo "\n".$upgrade_description."\n";
?>

View File

@@ -0,0 +1,60 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'enlarge your user_id (16 millions possible users)';
// we use PREFIX_TABLE, in case Piwigo uses an external user table
pwg_query('ALTER TABLE '.PREFIX_TABLE.'users CHANGE id id MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT;');
pwg_query('ALTER TABLE '.IMAGES_TABLE.' CHANGE added_by added_by MEDIUMINT UNSIGNED NOT NULL DEFAULT \'0\';');
pwg_query('ALTER TABLE '.COMMENTS_TABLE.' CHANGE author_id author_id MEDIUMINT UNSIGNED DEFAULT NULL;');
$tables = array(
USER_ACCESS_TABLE,
USER_CACHE_TABLE,
USER_FEED_TABLE,
USER_GROUP_TABLE,
USER_INFOS_TABLE,
USER_CACHE_CATEGORIES_TABLE,
USER_MAIL_NOTIFICATION_TABLE,
RATE_TABLE,
CADDIE_TABLE,
FAVORITES_TABLE,
HISTORY_TABLE,
);
foreach ($tables as $table)
{
pwg_query('
ALTER TABLE '.$table.'
CHANGE user_id user_id MEDIUMINT UNSIGNED NOT NULL DEFAULT \'0\'
;');
}
echo "\n".$upgrade_description."\n";
?>

View File

@@ -0,0 +1,43 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'add activation_key_expire';
// we use PREFIX_TABLE, in case Piwigo uses an external user table
pwg_query('
ALTER TABLE '.USER_INFOS_TABLE.'
CHANGE activation_key activation_key VARCHAR(255) DEFAULT NULL,
ADD COLUMN activation_key_expire DATETIME DEFAULT NULL AFTER activation_key
;');
// purge current expiration keys
pwg_query('UPDATE '.USER_INFOS_TABLE.' SET activation_key = NULL;');
echo "\n".$upgrade_description."\n";
?>

View File

@@ -0,0 +1,44 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'add image formats table';
// we use PREFIX_TABLE, in case Piwigo uses an external user table
pwg_query('
CREATE TABLE `'.PREFIX_TABLE.'image_format` (
`format_id` int(11) unsigned NOT NULL auto_increment,
`image_id` mediumint(8) unsigned NOT NULL DEFAULT \'0\',
`ext` varchar(255) NOT NULL,
`filesize` mediumint(9) unsigned DEFAULT NULL,
PRIMARY KEY (`format_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8
;');
echo "\n".$upgrade_description."\n";
?>

View File

@@ -0,0 +1,39 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'add format_id in history table';
// we use PREFIX_TABLE, in case Piwigo uses an external user table
pwg_query('
ALTER TABLE `'.PREFIX_TABLE.'history`
ADD COLUMN `format_id` int(11) unsigned DEFAULT NULL
;');
echo "\n".$upgrade_description."\n";
?>

View File

@@ -0,0 +1,46 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'add user authentication keys table';
// we use PREFIX_TABLE, in case Piwigo uses an external user table
pwg_query('
CREATE TABLE `'.PREFIX_TABLE.'user_auth_keys` (
`auth_key_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`auth_key` varchar(255) NOT NULL,
`user_id` mediumint(8) unsigned NOT NULL,
`created_on` datetime NOT NULL,
`duration` int(11) unsigned DEFAULT NULL,
`expired_on` datetime NOT NULL,
PRIMARY KEY (`auth_key_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8
;');
echo "\n".$upgrade_description."\n";
?>

View File

@@ -0,0 +1,39 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'add auth_key_id in history table';
// we use PREFIX_TABLE, in case Piwigo uses an external user table
pwg_query('
ALTER TABLE `'.PREFIX_TABLE.'history`
ADD COLUMN `auth_key_id` int(11) unsigned DEFAULT NULL
;');
echo "\n".$upgrade_description."\n";
?>

View File

@@ -0,0 +1,40 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'add last_visit+last_visit_from_history in user_infos table';
// we use PREFIX_TABLE, in case Piwigo uses an external user table
pwg_query('
ALTER TABLE `'.PREFIX_TABLE.'user_infos`
ADD COLUMN `last_visit` datetime default NULL,
ADD COLUMN `last_visit_from_history` enum(\'true\',\'false\') NOT NULL default \'false\'
;');
echo "\n".$upgrade_description."\n";
?>

View File

@@ -0,0 +1,80 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'add history_id_from+history_id_to in history_summary table';
// we use PREFIX_TABLE, in case Piwigo uses an external user table
pwg_query('
ALTER TABLE `'.PREFIX_TABLE.'history_summary`
ADD COLUMN `history_id_from` int(10) unsigned default NULL,
ADD COLUMN `history_id_to` int(10) unsigned default NULL
;');
$query = '
SELECT
*
FROM '.PREFIX_TABLE.'history
WHERE summarized = \'true\'
ORDER BY id DESC
LIMIT 1
;';
// note : much faster than searching MAX(ID), ie on my big sample 14 seconds Vs 2 seconds
$history_lines = query2array($query);
if (count($history_lines) > 0)
{
$last_summarized = $history_lines[0];
list($year, $month, $day) = explode('-', $last_summarized['date']);
list($hour) = explode(':', $last_summarized['time']);
single_update(
PREFIX_TABLE.'history_summary',
array(
'history_id_to' => $last_summarized['id'],
),
array(
'year' => $year,
'month' => $month,
'day' => $day,
'hour' => $hour,
)
);
// in case this script would update no summary line, it would mean the
// summary has been purged and will be rebuild from scratch, based on the
// content of history table
}
// for now, we keep column history.summarized even if Piwigo 2.9 no longer
// uses it. We will remove it in a future version. First we need to have
// "less" lines in history table. This will be possible with the automatic
// purge implemented in Piwigo 2.9.
echo "\n".$upgrade_description."\n";
?>

View File

@@ -0,0 +1,36 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'add "picture_sizes_icon" and "index_sizes_icon" parameters';
conf_update_param('index_sizes_icon', 'true');
conf_update_param('picture_sizes_icon', 'true');
echo "\n".$upgrade_description."\n";
?>

View File

@@ -0,0 +1,40 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'add 5 parameters to show/hide icons (edit/caddie/repressentative)';
conf_update_param('index_edit_icon','true');
conf_update_param('index_caddie_icon','true');
conf_update_param('picture_edit_icon','true');
conf_update_param('picture_caddie_icon','true');
conf_update_param('picture_representative_icon','true');
echo "\n".$upgrade_description."\n";
?>

View File

@@ -0,0 +1,50 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'Add unique index on #_groups for name';
include_once(PHPWG_ROOT_PATH.'include/constants.php');
// +-----------------------------------------------------------------------+
// | Upgrade content |
// +-----------------------------------------------------------------------+
$query = "
alter table ".GROUPS_TABLE."
add UNIQUE KEY `groups_ui1` (`name`)
;";
pwg_query($query);
echo
"\n"
.'"'.$upgrade_description.'"'.' ended'
."\n"
;
?>

View File

@@ -0,0 +1,48 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'Add obligatory_user_mail config';
include_once(PHPWG_ROOT_PATH.'include/constants.php');
// +-----------------------------------------------------------------------+
// | Upgrade content |
// +-----------------------------------------------------------------------+
$query = "
INSERT INTO ".CONFIG_TABLE." (param,value,comment) VALUES ('obligatory_user_mail_address','false','Mail address is obligatory for users');
";
pwg_query($query);
echo
"\n"
.'"'.$upgrade_description.'"'.' ended'
."\n"
;
?>

View File

@@ -0,0 +1,73 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'Add #user_infos.level, #images.level and #user_cache.forbidden_images';
include_once(PHPWG_ROOT_PATH.'include/constants.php');
// +-----------------------------------------------------------------------+
// | Upgrade content |
// +-----------------------------------------------------------------------+
$query = '
ALTER TABLE '.IMAGES_TABLE.' ADD COLUMN level TINYINT UNSIGNED NOT NULL DEFAULT 0
';
pwg_query($query);
$query = '
ALTER TABLE '.USER_INFOS_TABLE.' ADD COLUMN level TINYINT UNSIGNED NOT NULL DEFAULT 0
';
pwg_query($query);
$query = '
ALTER TABLE '.USER_CACHE_TABLE.' ADD COLUMN image_access_type enum("NOT IN","IN") NOT NULL default "NOT IN"
';
pwg_query($query);
$query = '
ALTER TABLE '.USER_CACHE_TABLE.' ADD COLUMN image_access_list TEXT DEFAULT NULL
';
pwg_query($query);
$query = '
UPDATE '.USER_INFOS_TABLE.' SET level=8 WHERE status="webmaster"
';
pwg_query($query);
$query = '
UPDATE '.USER_CACHE_TABLE.' SET need_update=true
';
pwg_query($query);
echo
"\n"
.'"'.$upgrade_description.'"'.' ended'
."\n"
;
?>

View File

@@ -0,0 +1,50 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'Activation of c13_upgrade plugin';
include_once(PHPWG_ROOT_PATH.'include/constants.php');
// +-----------------------------------------------------------------------+
// | Upgrade content |
// +-----------------------------------------------------------------------+
$query = '
REPLACE INTO '.PLUGINS_TABLE.'
(id, state)
VALUES (\'c13y_upgrade\', \'active\')
;';
pwg_query($query);
echo
"\n"
.'"'.$upgrade_description.'"'.' ended'
."\n"
;
?>

View File

@@ -0,0 +1,300 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
function upgrade65_change_table_to_blob($table, $field_definitions)
{
$types = array('varchar' => 'varbinary',
'text' => 'blob',
'mediumtext' => 'mediumblob',
'longtext' => 'longblob');
$changes=array();
foreach( $field_definitions as $row)
{
if ( !isset($row['Collation']) or $row['Collation']=='NULL' )
continue;
list ($type) = explode('(', $row['Type']);
if (!isset($types[$type]))
continue; // no need
$binaryType = preg_replace('/'. $type .'/i', $types[$type], $row['Type'] );
$changes[] = 'MODIFY COLUMN '.$row['Field'].' '.$binaryType;
}
if (count($changes))
{
$query = 'ALTER TABLE '.$table.' '.implode(', ', $changes);
pwg_query($query);
}
}
function upgrade65_change_table_to_charset($table, $field_definitions, $db_charset)
{
$changes=array();
foreach( $field_definitions as $row)
{
if ( !isset($row['Collation']) or $row['Collation']=='NULL' )
continue;
$query = $row['Field'].' '.$row['Type'];
$query .= ' CHARACTER SET '.$db_charset;
if (strpos($row['Collation'],'_bin')!==false)
{
$query .= ' BINARY';
}
if ($row['Null']!='YES')
{
$query.=' NOT NULL';
if (isset($row['Default']))
$query.=' DEFAULT "'.addslashes($row['Default']).'"';
}
else
{
if (!isset($row['Default']))
$query.=' DEFAULT NULL';
else
$query.=' DEFAULT "'.addslashes($row['Default']).'"';
}
if ($row['Extra']=='auto_increment')
{
$query.=' auto_increment';
}
$changes[] = 'MODIFY COLUMN '.$query;
}
if (count($changes))
{
$query = 'ALTER TABLE `'.$table.'` '.implode(', ', $changes);
pwg_query($query);
}
}
$upgrade_description = 'PWG charset migration';
// +-----------------------------------------------------------------------+
// | Upgrade content |
// +-----------------------------------------------------------------------+
if ( !defined('PWG_CHARSET') )
{
$upgrade_log = '';
// +-----------------------------------------------------------------------+
// load all the user languages
$all_langs=array();
$query='
SELECT language, COUNT(user_id) AS count FROM '.USER_INFOS_TABLE.'
GROUP BY language';
$result = pwg_query($query);
while ( $row=pwg_db_fetch_assoc($result) )
{
$language = $row["language"];
$lang_def = explode('.', $language);
if ( count($lang_def)==2 )
{
$new_lang = $lang_def[0];
$charset = strtolower($lang_def[1]);
}
else
{
$new_lang = 'en_UK';
$charset = 'iso-8859-1';
}
$all_langs[$language] = array(
'count' => $row['count'],
'new_lang' => $new_lang,
'charset' => $charset,
);
$upgrade_log .= ">>user_lang\t".$language."\t".$row['count']."\n";
}
$upgrade_log .= "\n";
// +-----------------------------------------------------------------------+
// get admin charset
include(PHPWG_ROOT_PATH . 'include/config_default.inc.php');
@include(PHPWG_ROOT_PATH. 'local/config/config.inc.php');
$admin_charset='iso-8859-1';
$query='
SELECT language FROM '.USER_INFOS_TABLE.'
WHERE user_id='.$conf['webmaster_id'];
$result = pwg_query($query);
if (pwg_db_num_rows($result)==0)
{
$query='
SELECT language FROM '.USER_INFOS_TABLE.'
WHERE status="webmaster" and adviser="false"
LIMIT 1';
$result = pwg_query($query);
}
if ( $row=pwg_db_fetch_assoc($result) )
{
$admin_charset = $all_langs[$row['language']]['charset'];
}
$upgrade_log .= ">>admin_charset\t".$admin_charset."\n";
// +-----------------------------------------------------------------------+
// get mysql version and structure of tables
$mysql_version = mysql_get_server_info();
$upgrade_log .= ">>mysql_ver\t".$mysql_version."\n";
$all_tables = array();
$query = 'SHOW TABLES LIKE "'.$prefixeTable.'%"';
$result = pwg_query($query);
while ( $row=pwg_db_fetch_row($result) )
{
array_push($all_tables, $row[0]);
}
$all_tables_definition = array();
foreach( $all_tables as $table)
{
$query = 'SHOW FULL COLUMNS FROM '.$table;
$result = pwg_query($query);
$field_definitions=array();
while ( $row=pwg_db_fetch_assoc($result) )
{
if ( !isset($row['Collation']) or $row['Collation']=='NULL' )
continue;
array_push($field_definitions, $row);
}
$all_tables_definition[$table] = $field_definitions;
}
// +-----------------------------------------------------------------------+
// calculate the result and convert the tables
//tables that can be converted without going through binary (they contain only ascii data)
$safe_tables=array('history','history_backup','history_summary','old_permalinks','plugins','rate','upgrade','user_cache','user_feed','user_infos','user_mail_notification', 'users', 'waiting','ws_access');
$safe_tables=array_flip($safe_tables);
$pwg_charset = 'iso-8859-1';
$db_charset = 'latin1';
$db_collate = '';
if ( version_compare($mysql_version, '4.1', '<') )
{ // below 4.1 no charset support
$upgrade_log .= "< conversion\tnothing\n";
}
elseif ($admin_charset=='iso-8859-1')
{
$pwg_charset = 'utf-8';
$db_charset = 'utf8';
foreach($all_tables as $table)
{
upgrade65_change_table_to_charset($table, $all_tables_definition[$table], 'utf8' );
$query = 'ALTER TABLE '.$table.' DEFAULT CHARACTER SET utf8';
pwg_query($query);
}
$upgrade_log .= "< conversion\tchange utf8\n";
}
/*ALTER TABLE tbl_name CONVERT TO CHARACTER SET charset_name; (or change column character set)
Warning: The preceding operation converts column values between the character sets. This is not what you want if you have a column in one character set (like latin1) but the stored values actually use some other, incompatible character set (like utf8). In this case, you have to do the following for each such column:
ALTER TABLE t1 CHANGE c1 c1 BLOB;
ALTER TABLE t1 CHANGE c1 c1 TEXT CHARACTER SET utf8;
*/
elseif ( $admin_charset=='utf-8')
{
$pwg_charset = 'utf-8';
$db_charset = 'utf8';
foreach($all_tables as $table)
{
if ( !isset($safe_tables[ substr($table, strlen($prefixeTable)) ]) )
upgrade65_change_table_to_blob($table, $all_tables_definition[$table] );
upgrade65_change_table_to_charset($table, $all_tables_definition[$table], 'utf8' );
$query = 'ALTER TABLE '.$table.' DEFAULT CHARACTER SET utf8';
pwg_query($query);
}
$upgrade_log .= "< conversion\tchange binary\n";
$upgrade_log .= "< conversion\tchange utf8\n";
}
elseif ( $admin_charset=='iso-8859-2'/*Central European*/)
{
$pwg_charset = 'utf-8';
$db_charset = 'utf8';
foreach($all_tables as $table)
{
if ( !isset($safe_tables[ substr($table, strlen($prefixeTable)) ]) )
{
upgrade65_change_table_to_blob($table, $all_tables_definition[$table] );
upgrade65_change_table_to_charset($table, $all_tables_definition[$table], 'latin2' );
}
upgrade65_change_table_to_charset($table, $all_tables_definition[$table], 'utf8' );
$query = 'ALTER TABLE '.$table.' DEFAULT CHARACTER SET utf8';
pwg_query($query);
}
$upgrade_log .= "< conversion\tchange binary\n";
$upgrade_log .= "< conversion\tchange latin2\n";
$upgrade_log .= "< conversion\tchange utf8\n";
}
// +-----------------------------------------------------------------------+
// changes to write in database.inc.php
array_push($mysql_changes,
'define(\'PWG_CHARSET\', \''.$pwg_charset.'\');
define(\'DB_CHARSET\', \''.$db_charset.'\');
define(\'DB_COLLATE\', \'\');'
);
foreach ($all_langs as $old_lang=>$lang_data)
{
$query='
UPDATE '.USER_INFOS_TABLE.' SET language="'.$lang_data['new_lang'].'"
WHERE language="'.$old_lang.'"';
pwg_query($query);
}
define('PWG_CHARSET', $pwg_charset);
define('DB_CHARSET', $db_charset);
define('DB_COLLATE', '');
if ( version_compare(mysql_get_server_info(), '4.1.0', '>=') and DB_CHARSET!='' )
{
pwg_query('SET NAMES "'.DB_CHARSET.'"');
}
echo $upgrade_log;
$fp = @fopen( PHPWG_ROOT_PATH.'upgrade65.log', 'w' );
if ($fp)
{
@fputs($fp, $upgrade_log, strlen($upgrade_log));
@fclose($fp);
}
echo
"\n"
.'"'.$upgrade_description.'"'.' ended'
."\n"
;
}
else
{
echo 'PWG_CHARSET already defined - nada';
}
?>

View File

@@ -0,0 +1,48 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'Add c13y_ignore config';
include_once(PHPWG_ROOT_PATH.'include/constants.php');
// +-----------------------------------------------------------------------+
// | Upgrade content |
// +-----------------------------------------------------------------------+
$query = "
INSERT INTO ".CONFIG_TABLE." (param,value,comment) VALUES ('c13y_ignore',null,'List of ignored anomalies');
";
pwg_query($query);
echo
"\n"
.'"'.$upgrade_description.'"'.' ended'
."\n"
;
?>

View File

@@ -0,0 +1,48 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'Uninstall dew plugin';
include_once(PHPWG_ROOT_PATH.'include/constants.php');
// +-----------------------------------------------------------------------+
// | Upgrade content |
// +-----------------------------------------------------------------------+
$query = "
delete from ".PLUGINS_TABLE." where id ='dew';
";
pwg_query($query);
echo
"\n"
.'"'.$upgrade_description.'"'.' ended'
."\n"
;
?>

View File

@@ -0,0 +1,55 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'Change type from text to mediumtext for #sessions.data #user_cache.forbidden_categories and #user_cache.image_access_list';
include_once(PHPWG_ROOT_PATH.'include/constants.php');
// +-----------------------------------------------------------------------+
// | Upgrade content |
// +-----------------------------------------------------------------------+
$query = '
ALTER TABLE '.SESSIONS_TABLE.'
MODIFY COLUMN data MEDIUMTEXT NOT NULL';
pwg_query($query);
$query = '
ALTER TABLE '.USER_CACHE_TABLE.'
MODIFY COLUMN forbidden_categories MEDIUMTEXT,
MODIFY COLUMN image_access_list MEDIUMTEXT
';
pwg_query($query);
echo
"\n"
.'"'.$upgrade_description.'"'.' ended'
."\n"
;
?>

View File

@@ -0,0 +1,58 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'Move #categories.date_last and nb_images to #user_cache_categories';
include_once(PHPWG_ROOT_PATH.'include/constants.php');
// +-----------------------------------------------------------------------+
// | Upgrade content |
// +-----------------------------------------------------------------------+
$query = '
ALTER TABLE '.USER_CACHE_CATEGORIES_TABLE.'
ADD COLUMN date_last datetime default NULL AFTER cat_id,
ADD COLUMN nb_images mediumint(8) unsigned NOT NULL default 0 AFTER max_date_last';
pwg_query($query);
$query = '
ALTER TABLE '.CATEGORIES_TABLE.'
DROP COLUMN date_last,
DROP COLUMN nb_images
';
pwg_query($query);
invalidate_user_cache(); // just to force recalculation
echo
"\n"
.'"'.$upgrade_description.'"'.' ended'
."\n"
;
?>

View File

@@ -0,0 +1,53 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'Add upload config';
include_once(PHPWG_ROOT_PATH.'include/constants.php');
// +-----------------------------------------------------------------------+
// | Upgrade content |
// +-----------------------------------------------------------------------+
$query = "
replace into ".CONFIG_TABLE."
(param, value, comment)
values
('upload_link_everytime','false','Show Upload link every time'),
('upload_user_access',".ACCESS_CLASSIC.",'Minimal user status allowed to upload pictures')
;";
pwg_query($query);
echo
"\n"
.'"'.$upgrade_description.'"'.' ended'
."\n"
;
?>

View File

@@ -0,0 +1,58 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'Delete unnecessary #history_summary.id, #history.year, #history.month, #history.day and #history.hour';
include_once(PHPWG_ROOT_PATH.'include/constants.php');
// +-----------------------------------------------------------------------+
// | Upgrade content |
// +-----------------------------------------------------------------------+
$query = 'ALTER TABLE '.HISTORY_SUMMARY_TABLE.'
DROP PRIMARY KEY,
DROP COLUMN id,
ADD UNIQUE KEY history_summary_ymdh (`year`, `month`, `day`, `hour`)
;';
pwg_query($query);
$query = 'ALTER TABLE '.HISTORY_TABLE.'
DROP COLUMN year,
DROP COLUMN month,
DROP COLUMN day,
DROP COLUMN hour
;';
pwg_query($query);
echo
"\n"
.'"'.$upgrade_description.'"'.' ended'
."\n"
;
?>

View File

@@ -0,0 +1,48 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'Add extents_for_templates config';
include_once(PHPWG_ROOT_PATH.'include/constants.php');
// +-----------------------------------------------------------------------+
// | Upgrade content |
// +-----------------------------------------------------------------------+
$query = "
INSERT INTO ".CONFIG_TABLE." (param,value,comment) VALUES ('extents_for_templates','a:0:{}','Actived template-extension(s)');
";
pwg_query($query);
echo
"\n"
.'"'.$upgrade_description.'"'.' ended'
."\n"
;
?>

View File

@@ -0,0 +1,46 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'Add #user_cache.cache_update_time';
// +-----------------------------------------------------------------------+
// | Upgrade content |
// +-----------------------------------------------------------------------+
$query = '
ALTER TABLE '.USER_CACHE_TABLE.' ADD COLUMN `cache_update_time` INTEGER UNSIGNED NOT NULL DEFAULT 0 AFTER need_update';
pwg_query($query);
echo
"\n"
.'"'.$upgrade_description.'"'.' ended'
."\n"
;
?>

View File

@@ -0,0 +1,48 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'Add blk_menubar config';
include_once(PHPWG_ROOT_PATH.'include/constants.php');
// +-----------------------------------------------------------------------+
// | Upgrade content |
// +-----------------------------------------------------------------------+
$query = "
INSERT INTO ".CONFIG_TABLE." (param,value,comment) VALUES ('blk_menubar','','Menubar options');
";
pwg_query($query);
echo
"\n"
.'"'.$upgrade_description.'"'.' ended'
."\n"
;
?>

View File

@@ -0,0 +1,46 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'Add blk_menubar config';
// +-----------------------------------------------------------------------+
// | Upgrade content |
// +-----------------------------------------------------------------------+
$query = 'DROP TABLE IF EXISTS '.$prefixeTable.'ws_access';
pwg_query($query);
$upgrade_description = $query;
echo
"\n"
.'"'.$upgrade_description.'"'.' ended'
."\n"
;
?>

View File

@@ -0,0 +1,46 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'Add image_category.rank column';
// +-----------------------------------------------------------------------+
// | Upgrade content |
// +-----------------------------------------------------------------------+
$query = 'ALTER TABLE '.IMAGE_CATEGORY_TABLE.' add column `rank` mediumint(8) unsigned default NULL';
pwg_query($query);
$upgrade_description = $query;
echo
"\n"
.'"'.$upgrade_description.'"'.' ended'
."\n"
;
?>

View File

@@ -0,0 +1,54 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'images.file categories.permalink old_permalinks.permalink - become binary';
// +-----------------------------------------------------------------------+
// | Upgrade content |
// +-----------------------------------------------------------------------+
$query = 'ALTER TABLE '.CATEGORIES_TABLE.'
MODIFY COLUMN permalink varchar(64) binary default NULL';
pwg_query($query);
$query = 'ALTER TABLE '.OLD_PERMALINKS_TABLE.'
MODIFY COLUMN permalink varchar(64) binary NOT NULL default ""';
pwg_query($query);
$query = 'ALTER TABLE '.IMAGES_TABLE.'
MODIFY COLUMN file varchar(255) binary NOT NULL default ""';
pwg_query($query);
echo
"\n"
.'"'.$upgrade_description.'"'.' ended'
."\n"
;
?>

View File

@@ -0,0 +1,46 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'Add images.md5sum column, for web API uploaded photos';
// +-----------------------------------------------------------------------+
// | Upgrade content |
// +-----------------------------------------------------------------------+
$query = 'ALTER TABLE '.IMAGES_TABLE.' add column `md5sum` char(32) default NULL';
pwg_query($query);
$upgrade_description = $query;
echo
"\n"
.'"'.$upgrade_description.'"'.' ended'
."\n"
;
?>

View File

@@ -0,0 +1,47 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'Update default template';
// +-----------------------------------------------------------------------+
// | Upgrade content |
// +-----------------------------------------------------------------------+
// set yoga/Sylvia as default value for user_infos.template column
$query = '
ALTER TABLE '.PREFIX_TABLE.'user_infos
CHANGE COLUMN template template varchar(255) NOT NULL default \'yoga/Sylvia\'
;';
pwg_query($query);
echo
"\n"
.'Default template modified to yoga/Sylvia'
."\n"
;
?>

View File

@@ -0,0 +1,988 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
/* $list_files generated by this sh
#!/bin/sh
final_src=trunk-r3105
LIST_SOURCES="\
phpwebgallery-1.0.0 \
phpwebgallery-1.1.0 \
phpwebgallery-1.2.1 \
phpwebgallery-1.3.0 \
phpwebgallery-1.3.1 \
phpwebgallery-1.3.2 \
phpwebgallery-1.3.3 \
phpwebgallery-1.3.4 \
phpwebgallery-1.4.0 \
phpwebgallery-1.4.1 \
phpwebgallery-1.5.0 \
phpwebgallery-1.5.1 \
phpwebgallery-1.5.2 \
phpwebgallery-1.6.0RC1 \
phpwebgallery-1.6.0RC2 \
phpwebgallery-1.6.0 \
phpwebgallery-1.6.1 \
phpwebgallery-1.6.2 \
phpwebgallery-1.7.0RC1 \
phpwebgallery-1.7.0RC2 \
phpwebgallery-1.7.0 \
phpwebgallery-1.7.1 \
phpwebgallery-1.7.2 \
phpwebgallery-1.7.3 \
phpwebgallery-2.0.0RC1 \
phpwebgallery-2.0.0RC2 \
phpwebgallery-2.0.0RC3 \
phpwebgallery-2.0.0RC4 \
$final_src \
"
set $LIST_SOURCES
LastSrc=$1
shift
dir_all=`pwd`
dir_final_src=$dir_all/$Src/$final_src
for Src in $@
do
dir_current=$dir_all/$Src
cd $LastSrc
echo "// Comparison between $Src and $LastSrc"
for f in `find *`
do
current_file_or_dir=$dir_current/$f
final_file_or_dir=$dir_final_src/$f
# if not exists on current src
[ ! -f $current_file_or_dir ] && [ ! -d $current_file_or_dir ] && \
# if not exists on final src
[ ! -f $final_file_or_dir ] && [ ! -d $final_file_or_dir ] && \
# Display file or dir to delete
echo "'$f',"
done
cd -
LastSrc=$Src;
done
*/
$list_files = array(
// Comparison between phpwebgallery-1.1.0 and phpwebgallery-1.0.0
'admin_phpwebgallery',
'admin_phpwebgallery/admin.php',
'admin_phpwebgallery/ajout.php',
'admin_phpwebgallery/configuration.php',
'admin_phpwebgallery/creationBD.php',
'admin_phpwebgallery/historique.php',
'admin_phpwebgallery/index.htm',
'admin_phpwebgallery/install_step1.php',
'admin_phpwebgallery/install_step2.php',
'admin_phpwebgallery/isadmin.php',
'admin_phpwebgallery/liste_users.php',
'admin_phpwebgallery/manuel.php',
'admin_phpwebgallery/miseajour.php',
'admin_phpwebgallery/perm.php',
'commenter.php',
'debut_tableau.inc',
'fin_tableau.inc',
'help_phpwebgallery',
'help_phpwebgallery/admin.png',
'help_phpwebgallery/config_step2.png',
'help_phpwebgallery/index.htm',
'images_phpwebgallery',
'images_phpwebgallery/bleu_01.gif',
'images_phpwebgallery/bleu_02.gif',
'images_phpwebgallery/bleu_03.gif',
'images_phpwebgallery/bleu_04.gif',
'images_phpwebgallery/bleu_05.gif',
'images_phpwebgallery/bleu_06.gif',
'images_phpwebgallery/bleu_07.gif',
'images_phpwebgallery/bleu_08.gif',
'images_phpwebgallery/bleu_09.gif',
'images_phpwebgallery/commentaire.gif',
'images_phpwebgallery/espace.gif',
'images_phpwebgallery/gris_01.gif',
'images_phpwebgallery/gris_02.gif',
'images_phpwebgallery/gris_03.gif',
'images_phpwebgallery/gris_04.gif',
'images_phpwebgallery/gris_05.gif',
'images_phpwebgallery/gris_06.gif',
'images_phpwebgallery/gris_07.gif',
'images_phpwebgallery/gris_08.gif',
'images_phpwebgallery/gris_09.gif',
'images_phpwebgallery/index.htm',
'images_phpwebgallery/info.gif',
'images_phpwebgallery/lost.gif',
'images_phpwebgallery/lost2.gif',
'images_phpwebgallery/moins.gif',
'images_phpwebgallery/new_2.gif',
'images_phpwebgallery/new_rouge.gif',
'images_phpwebgallery/perm.gif',
'images_phpwebgallery/php_sqreuil_artistes.gif',
'images_phpwebgallery/plus.gif',
'images_phpwebgallery/prev.gif',
'images_phpwebgallery/puce.gif',
'images_phpwebgallery/puce_noire.gif',
'images_phpwebgallery/register.gif',
'images_phpwebgallery/register2.gif',
'images_phpwebgallery/supprimer.gif',
'images_phpwebgallery/vert_01.gif',
'images_phpwebgallery/vert_02.gif',
'images_phpwebgallery/vert_03.gif',
'images_phpwebgallery/vert_04.gif',
'images_phpwebgallery/vert_05.gif',
'images_phpwebgallery/vert_06.gif',
'images_phpwebgallery/vert_07.gif',
'images_phpwebgallery/vert_08.gif',
'images_phpwebgallery/vert_09.gif',
'images_phpwebgallery/violet_01.gif',
'images_phpwebgallery/violet_02.gif',
'images_phpwebgallery/violet_03.gif',
'images_phpwebgallery/violet_04.gif',
'images_phpwebgallery/violet_05.gif',
'images_phpwebgallery/violet_06.gif',
'images_phpwebgallery/violet_07.gif',
'images_phpwebgallery/violet_08.gif',
'images_phpwebgallery/violet_09.gif',
'include_phpwebgallery',
'include_phpwebgallery/config.php',
'include_phpwebgallery/index.htm',
'include_phpwebgallery/local/config/database.inc.php',
'index.htm',
// Comparison between phpwebgallery-1.2.1 and phpwebgallery-1.1.0
'admin/isadmin.php',
'images/commentaire.gif',
'images/lost.gif',
'images/prev.gif',
'images/register.gif',
'include/config.php',
'template/agjimmy/blue',
'template/agjimmy/blue/01.gif',
'template/agjimmy/blue/02.gif',
'template/agjimmy/blue/03.gif',
'template/agjimmy/blue/04.gif',
'template/agjimmy/blue/05.gif',
'template/agjimmy/blue/06.gif',
'template/agjimmy/blue/07.gif',
'template/agjimmy/blue/08.gif',
'template/agjimmy/blue/09.gif',
'template/agjimmy/blue/collapsed.gif',
'template/agjimmy/blue/commentaire.gif',
'template/agjimmy/blue/conf.php',
'template/agjimmy/blue/expanded.gif',
'template/agjimmy/blue/lost.gif',
'template/agjimmy/blue/new_long.gif',
'template/agjimmy/blue/new_short.gif',
'template/agjimmy/blue/prev.gif',
'template/agjimmy/blue/register.gif',
'template/eexell/coldblue/commentaire.gif',
'template/eexell/coldblue/prev.gif',
'template/neon',
'template/neon/black',
'template/neon/black/01.gif',
'template/neon/black/02.gif',
'template/neon/black/03.gif',
'template/neon/black/04.gif',
'template/neon/black/05.gif',
'template/neon/black/06.gif',
'template/neon/black/07.gif',
'template/neon/black/08.gif',
'template/neon/black/09.gif',
'template/neon/black/collapsed.gif',
'template/neon/black/commentaire.gif',
'template/neon/black/conf.php',
'template/neon/black/expanded.gif',
'template/neon/black/lost.gif',
'template/neon/black/new_long.gif',
'template/neon/black/new_short.gif',
'template/neon/black/prev.gif',
'template/neon/black/register.gif',
'template/rounded/blue',
'template/rounded/blue/01.gif',
'template/rounded/blue/02.gif',
'template/rounded/blue/03.gif',
'template/rounded/blue/04.gif',
'template/rounded/blue/05.gif',
'template/rounded/blue/06.gif',
'template/rounded/blue/07.gif',
'template/rounded/blue/08.gif',
'template/rounded/blue/09.gif',
'template/rounded/blue/collapsed.gif',
'template/rounded/blue/commentaire.gif',
'template/rounded/blue/conf.php',
'template/rounded/blue/expanded.gif',
'template/rounded/blue/lost.gif',
'template/rounded/blue/new_long.gif',
'template/rounded/blue/new_short.gif',
'template/rounded/blue/prev.gif',
'template/rounded/blue/register.gif',
'template/rounded/darkgray/commentaire.gif',
'template/rounded/darkgray/prev.gif',
'template/rounded/gray',
'template/rounded/gray/01.gif',
'template/rounded/gray/02.gif',
'template/rounded/gray/03.gif',
'template/rounded/gray/04.gif',
'template/rounded/gray/05.gif',
'template/rounded/gray/06.gif',
'template/rounded/gray/07.gif',
'template/rounded/gray/08.gif',
'template/rounded/gray/09.gif',
'template/rounded/gray/collapsed.gif',
'template/rounded/gray/commentaire.gif',
'template/rounded/gray/conf.php',
'template/rounded/gray/expanded.gif',
'template/rounded/gray/lost.gif',
'template/rounded/gray/new_long.gif',
'template/rounded/gray/new_short.gif',
'template/rounded/gray/prev.gif',
'template/rounded/gray/register.gif',
// Comparison between phpwebgallery-1.3.0 and phpwebgallery-1.2.1
'a_propos.php',
'admin/ajout.php',
'admin/cat.php',
'admin/edit_cat.php',
'admin/historique.php',
'admin/images/arrow_up.gif',
'admin/images/moins.gif',
'admin/images/plus.gif',
'admin/images/puce.gif',
'admin/liste_users.php',
'admin/manuel.php',
'admin/miseajour.php',
'admin/perm.php',
'diapo.php',
'images',
'images/php_sqreuil_artistes.gif',
'include/functions.php',
'include/index.htm',
'include/style.php',
'language/czech.php',
'language/danish.php',
'language/italiano.php',
'language/nederlands.php',
'personnaliser.php',
'photo.php',
'template/agjimmy',
'template/agjimmy/lightred',
'template/agjimmy/lightred/01.gif',
'template/agjimmy/lightred/02.gif',
'template/agjimmy/lightred/03.gif',
'template/agjimmy/lightred/04.gif',
'template/agjimmy/lightred/05.gif',
'template/agjimmy/lightred/06.gif',
'template/agjimmy/lightred/07.gif',
'template/agjimmy/lightred/08.gif',
'template/agjimmy/lightred/09.gif',
'template/agjimmy/lightred/collapsed.gif',
'template/agjimmy/lightred/commentaire.gif',
'template/agjimmy/lightred/conf.php',
'template/agjimmy/lightred/delete.gif',
'template/agjimmy/lightred/del_favorite.gif',
'template/agjimmy/lightred/expanded.gif',
'template/agjimmy/lightred/favorite.gif',
'template/agjimmy/lightred/lost.gif',
'template/agjimmy/lightred/new_long.gif',
'template/agjimmy/lightred/new_short.gif',
'template/agjimmy/lightred/register.gif',
'template/eexell',
'template/eexell/coldblue',
'template/eexell/coldblue/01.gif',
'template/eexell/coldblue/02.gif',
'template/eexell/coldblue/03.gif',
'template/eexell/coldblue/04.gif',
'template/eexell/coldblue/05.gif',
'template/eexell/coldblue/06.gif',
'template/eexell/coldblue/07.gif',
'template/eexell/coldblue/08.gif',
'template/eexell/coldblue/09.gif',
'template/eexell/coldblue/collapsed.gif',
'template/eexell/coldblue/conf.php',
'template/eexell/coldblue/delete.gif',
'template/eexell/coldblue/del_favorite.gif',
'template/eexell/coldblue/expanded.gif',
'template/eexell/coldblue/favorite.gif',
'template/eexell/coldblue/lost.gif',
'template/eexell/coldblue/new_long.gif',
'template/eexell/coldblue/new_short.gif',
'template/eexell/coldblue/register.gif',
'template/erya',
'template/erya/blue',
'template/erya/blue/01.gif',
'template/erya/blue/02.gif',
'template/erya/blue/03.gif',
'template/erya/blue/04.gif',
'template/erya/blue/05.gif',
'template/erya/blue/06.gif',
'template/erya/blue/07.gif',
'template/erya/blue/08.gif',
'template/erya/blue/09.gif',
'template/erya/blue/collapsed.gif',
'template/erya/blue/conf.php',
'template/erya/blue/delete.gif',
'template/erya/blue/del_favorite.gif',
'template/erya/blue/expanded.gif',
'template/erya/blue/favorite.gif',
'template/erya/blue/lost.gif',
'template/erya/blue/new_long.gif',
'template/erya/blue/new_short.gif',
'template/erya/blue/register.gif',
'template/melodie',
'template/melodie/blue',
'template/melodie/blue/01.gif',
'template/melodie/blue/02.gif',
'template/melodie/blue/03.gif',
'template/melodie/blue/04.gif',
'template/melodie/blue/05.gif',
'template/melodie/blue/06.gif',
'template/melodie/blue/07.gif',
'template/melodie/blue/08.gif',
'template/melodie/blue/09.gif',
'template/melodie/blue/collapsed.gif',
'template/melodie/blue/conf.php',
'template/melodie/blue/delete.gif',
'template/melodie/blue/del_favorite.gif',
'template/melodie/blue/expanded.gif',
'template/melodie/blue/favorite.gif',
'template/melodie/blue/lost.gif',
'template/melodie/blue/new_long.gif',
'template/melodie/blue/new_short.gif',
'template/melodie/blue/register.gif',
'template/rounded',
'template/rounded/darkgray',
'template/rounded/darkgray/01.gif',
'template/rounded/darkgray/02.gif',
'template/rounded/darkgray/03.gif',
'template/rounded/darkgray/04.gif',
'template/rounded/darkgray/05.gif',
'template/rounded/darkgray/06.gif',
'template/rounded/darkgray/07.gif',
'template/rounded/darkgray/08.gif',
'template/rounded/darkgray/09.gif',
'template/rounded/darkgray/collapsed.gif',
'template/rounded/darkgray/conf.php',
'template/rounded/darkgray/delete.gif',
'template/rounded/darkgray/del_favorite.gif',
'template/rounded/darkgray/expanded.gif',
'template/rounded/darkgray/favorite.gif',
'template/rounded/darkgray/lost.gif',
'template/rounded/darkgray/new_long.gif',
'template/rounded/darkgray/new_short.gif',
'template/rounded/darkgray/register.gif',
'template/square',
'template/square/light',
'template/square/light/01.gif',
'template/square/light/02.gif',
'template/square/light/03.gif',
'template/square/light/04.gif',
'template/square/light/05.gif',
'template/square/light/06.gif',
'template/square/light/07.gif',
'template/square/light/08.gif',
'template/square/light/09.gif',
'template/square/light/collapsed.gif',
'template/square/light/conf.php',
'template/square/light/delete.gif',
'template/square/light/del_favorite.gif',
'template/square/light/expanded.gif',
'template/square/light/favorite.gif',
'template/square/light/lost.gif',
'template/square/light/new_long.gif',
'template/square/light/new_short.gif',
'template/square/light/register.gif',
// Comparison between phpwebgallery-1.3.1 and phpwebgallery-1.3.0
'template/default/style.inc.php',
'template/default/theme/conf.php',
// Comparison between phpwebgallery-1.3.2 and phpwebgallery-1.3.1
// Comparison between phpwebgallery-1.3.3 and phpwebgallery-1.3.2
// Comparison between phpwebgallery-1.3.4 and phpwebgallery-1.3.3
// Comparison between phpwebgallery-1.4.0 and phpwebgallery-1.3.4
'admin/admin.php',
'admin/create_listing_file.php',
'admin/images/admin.png',
'admin/install.php',
'admin/phpwebgallery_structure.sql',
'admin/user_modify.php',
'include/init.inc.php',
'include/vtemplate.class.php',
'language/catala.php',
'language/czech.php',
'language/deutsch.php',
'language/dutch.php',
'language/english.php',
'language/francais.php',
'language/japanese.php',
'language/magyar.php',
'language/norsk.php',
'language/portuguese-br.php',
'language/russian.php',
'language/spanish.php',
'language/svenska.php',
'readme.txt',
'template/default/about.vtp',
'template/default/admin/admin.vtp',
'template/default/admin/cat_list.vtp',
'template/default/admin/cat_modify.vtp',
'template/default/admin/comments.vtp',
'template/default/admin/configuration.vtp',
'template/default/admin/group_list.vtp',
'template/default/admin/group_perm.vtp',
'template/default/admin/help.vtp',
'template/default/admin/infos_image.vtp',
'template/default/admin/install.vtp',
'template/default/admin/picture_modify.vtp',
'template/default/admin/stats.vtp',
'template/default/admin/thumbnail.vtp',
'template/default/admin/update.vtp',
'template/default/admin/user_list.vtp',
'template/default/admin/user_modify.vtp',
'template/default/admin/user_perm.vtp',
'template/default/admin/waiting.vtp',
'template/default/category.vtp',
'template/default/comments.vtp',
'template/default/default-admin.css',
'template/default/footer.htm',
'template/default/footer.vtp',
'template/default/header.htm',
'template/default/header.vtp',
'template/default/htmlfunctions.inc.php',
'template/default/identification.vtp',
'template/default/picture.vtp',
'template/default/profile.vtp',
'template/default/register.vtp',
'template/default/search.vtp',
'template/default/theme/01.gif',
'template/default/theme/02.gif',
'template/default/theme/03.gif',
'template/default/theme/04.gif',
'template/default/theme/05.gif',
'template/default/theme/06.gif',
'template/default/theme/07.gif',
'template/default/theme/08.gif',
'template/default/theme/09.gif',
'template/default/theme/collapsed.gif',
'template/default/theme/expanded.gif',
'template/default/theme/new_long.gif',
'template/default/theme/new_short.gif',
'template/default/upload.vtp',
// Comparison between phpwebgallery-1.4.1 and phpwebgallery-1.4.0
// Comparison between phpwebgallery-1.5.0 and phpwebgallery-1.4.1
'admin/admin_phpinfo.php',
'admin/infos_images.php',
'admin/search.php',
'include/config.inc.php',
'install/dbscheme.txt',
'install/upgrade_1.3.2.php',
'install/upgrade_1.3.3.php',
'install/upgrade_1.3.4.php',
'language/en_UK.iso-8859-1/faq.lang.php',
'language/fr_FR.iso-8859-1/faq.lang.php',
'template/default',
'template/default/about.tpl',
'template/default/admin',
'template/default/admin/cat_list.tpl',
'template/default/admin/cat_modify.tpl',
'template/default/admin/cat_options.tpl',
'template/default/admin/cat_perm.vtp',
'template/default/admin/configuration.tpl',
'template/default/admin/group_list.tpl',
'template/default/admin/group_perm.tpl',
'template/default/admin/help.tpl',
'template/default/admin/images',
'template/default/admin/images/arrow_down.gif',
'template/default/admin/images/arrow_first.gif',
'template/default/admin/images/arrow_last.gif',
'template/default/admin/images/arrow_select.gif',
'template/default/admin/images/arrow_up.gif',
'template/default/admin/images/collapsed.gif',
'template/default/admin/images/delete.gif',
'template/default/admin/images/expanded.gif',
'template/default/admin/images/icon_folder.gif',
'template/default/admin/images/icon_folder_link.gif',
'template/default/admin/images/icon_folder_lock.gif',
'template/default/admin/images/icon_subfolder.gif',
'template/default/admin/images/moins.gif',
'template/default/admin/images/plus.gif',
'template/default/admin/images/puce.gif',
'template/default/admin/images/stat_left.gif',
'template/default/admin/images/stat_middle.gif',
'template/default/admin/images/stat_right.gif',
'template/default/admin/infos_images.tpl',
'template/default/admin/picture_modify.tpl',
'template/default/admin/remote_site.tpl',
'template/default/admin/search_username.tpl',
'template/default/admin/stats.tpl',
'template/default/admin/thumbnail.tpl',
'template/default/admin/update.tpl',
'template/default/admin/user_perm.tpl',
'template/default/admin/waiting.tpl',
'template/default/admin.tpl',
'template/default/category.tpl',
'template/default/comments.tpl',
'template/default/default.css',
'template/default/footer.tpl',
'template/default/header.tpl',
'template/default/identification.tpl',
'template/default/images',
'template/default/images/logo.jpg',
'template/default/images/php_sqreuil_artistes.gif',
'template/default/install.tpl',
'template/default/mimetypes',
'template/default/mimetypes/avi.png',
'template/default/mimetypes/mp3.png',
'template/default/mimetypes/mpg.png',
'template/default/mimetypes/ogg.png',
'template/default/mimetypes/zip.png',
'template/default/picture.tpl',
'template/default/profile.tpl',
'template/default/redirect.tpl',
'template/default/register.tpl',
'template/default/search.tpl',
'template/default/theme',
'template/default/theme/button_bg.gif',
'template/default/theme/categories.gif',
'template/default/theme/delete.gif',
'template/default/theme/del_favorite.gif',
'template/default/theme/download.gif',
'template/default/theme/eCard.gif',
'template/default/theme/favorite.gif',
'template/default/theme/left-arrow.gif',
'template/default/theme/lost.gif',
'template/default/theme/metadata.gif',
'template/default/theme/properties.gif',
'template/default/theme/recent.gif',
'template/default/theme/register.gif',
'template/default/theme/right-arrow.gif',
'template/default/theme/slideshow.gif',
'template/default/theme/tableh1_bg.gif',
'template/default/upgrade.tpl',
'template/default/upload.tpl',
// Comparison between phpwebgallery-1.5.1 and phpwebgallery-1.5.0
'include/.cvsignore',
// Comparison between phpwebgallery-1.5.2 and phpwebgallery-1.5.1
// Comparison between phpwebgallery-1.6.0RC1 and phpwebgallery-1.5.2
'admin/include/isadmin.inc.php',
'admin/remote_site.php',
'admin/update.php',
'include/category_calendar.inc.php',
'install/upgrade_1.4.1.php',
'template/yoga/admin/images',
'template/yoga/admin/images/errors.png',
'template/yoga/admin/images/infos.png',
'template/yoga/admin/remote_site.tpl',
'template/yoga/admin/update.tpl',
'template/yoga/category.tpl',
'template/yoga/mimetypes',
'template/yoga/mimetypes/avi.png',
'template/yoga/mimetypes/mp3.png',
'template/yoga/mimetypes/mpg.png',
'template/yoga/mimetypes/ogg.png',
'template/yoga/mimetypes/zip.png',
'template/yoga/theme/caddie_add.png',
'template/yoga/theme/category_children.png',
'template/yoga/theme/category_delete.png',
'template/yoga/theme/category_edit.png',
'template/yoga/theme/category_elements.png',
'template/yoga/theme/category_jump-to.png',
'template/yoga/theme/category_permissions.png',
'template/yoga/theme/category_representant_random.png',
'template/yoga/theme/delete.png',
'template/yoga/theme/del_favorite.png',
'template/yoga/theme/exit.png',
'template/yoga/theme/favorite.png',
'template/yoga/theme/help.png',
'template/yoga/theme/home.png',
'template/yoga/theme/left.png',
'template/yoga/theme/lost_password.png',
'template/yoga/theme/metadata.png',
'template/yoga/theme/permissions.png',
'template/yoga/theme/preferences.png',
'template/yoga/theme/recent.png',
'template/yoga/theme/register.png',
'template/yoga/theme/representative.png',
'template/yoga/theme/right.png',
'template/yoga/theme/save.png',
'template/yoga/theme/slideshow.png',
'template/yoga/theme/sync_metadata.png',
'template/yoga/theme/up.png',
'template/yoga-dark',
'template/yoga-dark/about.tpl',
'template/yoga-dark/admin',
'template/yoga-dark/admin/cat_list.tpl',
'template/yoga-dark/admin/cat_modify.tpl',
'template/yoga-dark/admin/cat_move.tpl',
'template/yoga-dark/admin/cat_options.tpl',
'template/yoga-dark/admin/cat_perm.tpl',
'template/yoga-dark/admin/comments.tpl',
'template/yoga-dark/admin/configuration.tpl',
'template/yoga-dark/admin/double_select.tpl',
'template/yoga-dark/admin/element_set_global.tpl',
'template/yoga-dark/admin/element_set_unit.tpl',
'template/yoga-dark/admin/group_list.tpl',
'template/yoga-dark/admin/group_perm.tpl',
'template/yoga-dark/admin/images',
'template/yoga-dark/admin/images/errors.png',
'template/yoga-dark/admin/images/infos.png',
'template/yoga-dark/admin/intro.tpl',
'template/yoga-dark/admin/maintenance.tpl',
'template/yoga-dark/admin/picture_modify.tpl',
'template/yoga-dark/admin/remote_site.tpl',
'template/yoga-dark/admin/stats.tpl',
'template/yoga-dark/admin/thumbnail.tpl',
'template/yoga-dark/admin/update.tpl',
'template/yoga-dark/admin/user_list.tpl',
'template/yoga-dark/admin/user_perm.tpl',
'template/yoga-dark/admin/waiting.tpl',
'template/yoga-dark/admin.tpl',
'template/yoga-dark/category.tpl',
'template/yoga-dark/comments.tpl',
'template/yoga-dark/content.css',
'template/yoga-dark/dclear.css',
'template/yoga-dark/default-colors.css',
'template/yoga-dark/default-layout.css',
'template/yoga-dark/fix-khtml.css',
'template/yoga-dark/footer.tpl',
'template/yoga-dark/header.tpl',
'template/yoga-dark/identification.tpl',
'template/yoga-dark/image.css',
'template/yoga-dark/install.tpl',
'template/yoga-dark/menubar.css',
'template/yoga-dark/mimetypes',
'template/yoga-dark/mimetypes/avi.png',
'template/yoga-dark/mimetypes/mp3.png',
'template/yoga-dark/mimetypes/mpg.png',
'template/yoga-dark/mimetypes/ogg.png',
'template/yoga-dark/mimetypes/zip.png',
'template/yoga-dark/notification.tpl',
'template/yoga-dark/password.tpl',
'template/yoga-dark/picture.tpl',
'template/yoga-dark/popuphelp.css',
'template/yoga-dark/popuphelp.tpl',
'template/yoga-dark/print.css',
'template/yoga-dark/profile.tpl',
'template/yoga-dark/redirect.tpl',
'template/yoga-dark/register.tpl',
'template/yoga-dark/search.tpl',
'template/yoga-dark/theme',
'template/yoga-dark/theme/button_bg.gif',
'template/yoga-dark/theme/caddie_add.png',
'template/yoga-dark/theme/category_children.png',
'template/yoga-dark/theme/category_delete.png',
'template/yoga-dark/theme/category_edit.png',
'template/yoga-dark/theme/category_elements.png',
'template/yoga-dark/theme/category_jump-to.png',
'template/yoga-dark/theme/category_permissions.png',
'template/yoga-dark/theme/category_representant_random.png',
'template/yoga-dark/theme/delete.png',
'template/yoga-dark/theme/del_favorite.png',
'template/yoga-dark/theme/exit.png',
'template/yoga-dark/theme/favorite.png',
'template/yoga-dark/theme/help.png',
'template/yoga-dark/theme/home.png',
'template/yoga-dark/theme/left.png',
'template/yoga-dark/theme/lost_password.png',
'template/yoga-dark/theme/metadata.png',
'template/yoga-dark/theme/permissions.png',
'template/yoga-dark/theme/preferences.png',
'template/yoga-dark/theme/recent.png',
'template/yoga-dark/theme/register.png',
'template/yoga-dark/theme/representative.png',
'template/yoga-dark/theme/right.png',
'template/yoga-dark/theme/save.png',
'template/yoga-dark/theme/slideshow.png',
'template/yoga-dark/theme/sync_metadata.png',
'template/yoga-dark/theme/tableh1_bg.gif',
'template/yoga-dark/theme/tableh2_bg.gif',
'template/yoga-dark/theme/up.png',
'template/yoga-dark/upgrade.tpl',
'template/yoga-dark/upload.tpl',
// Comparison between phpwebgallery-1.6.0RC2 and phpwebgallery-1.6.0RC1
// Comparison between phpwebgallery-1.6.0 and phpwebgallery-1.6.0RC2
'template/yoga/dclear.css',
'template/yoga/image.css',
// Comparison between phpwebgallery-1.6.1 and phpwebgallery-1.6.0
'admin/images/index.htm',
'admin/include/index.htm',
'admin/index.htm',
'galleries/index.htm',
'language/index.htm',
// Comparison between phpwebgallery-1.6.2 and phpwebgallery-1.6.1
// Comparison between phpwebgallery-1.7.0RC1 and phpwebgallery-1.6.2
'admin/images/daily_stats.img.php',
'admin/images/global_stats.img.php',
'admin/images/monthly_stats.img.php',
'admin/images/phpBarGraph.php',
'include/category_recent_cats.inc.php',
'include/category_subcats.inc.php',
'include/pngfix.js',
'include/scripts.js',
'install/db/22.1-database.php',
'install/db/22.2-database.php',
'install/db/22.3-database.php',
'install/db/22.5-database.php',
'install/db/22.6-database.php',
'install/db/22.7-database.php',
'install/db/22.8-database.php',
'install/db/22.9-database.php',
'language/en_UK.iso-8859-1/help/remote_site.html',
'language/fr_FR.iso-8859-1/help/remote_site.html',
'template/yoga/upgrade.tpl',
// Comparison between phpwebgallery-1.7.0RC2 and phpwebgallery-1.7.0RC1
'admin/waiting.php',
'template/yoga/admin/waiting.tpl',
// Comparison between phpwebgallery-1.7.0 and phpwebgallery-1.7.0RC2
// Comparison between phpwebgallery-1.7.1 and phpwebgallery-1.7.0
// Comparison between phpwebgallery-1.7.2 and phpwebgallery-1.7.1
'include/functions_group.inc.php',
'template/yoga/thumbnails-fix-ie5-ie6.css',
// Comparison between phpwebgallery-1.7.3 and phpwebgallery-1.7.2
// Comparison between phpwebgallery-2.0.0RC1 and phpwebgallery-1.7.3
'admin/include/functions_check_integrity.inc.php',
'admin/include/functions_tabsheet.inc.php',
'admin/plugins.php',
'admin/ws_checker.php',
'include/template.php',
'install/phpwebgallery_structure.sql',
'language/en_UK.iso-8859-1',
'language/en_UK.iso-8859-1/about.html',
'language/en_UK.iso-8859-1/admin.lang.php',
'language/en_UK.iso-8859-1/common.lang.php',
'language/en_UK.iso-8859-1/help',
'language/en_UK.iso-8859-1/help/advanced_feature.html',
'language/en_UK.iso-8859-1/help/cat_modify.html',
'language/en_UK.iso-8859-1/help/cat_move.html',
'language/en_UK.iso-8859-1/help/cat_options.html',
'language/en_UK.iso-8859-1/help/cat_perm.html',
'language/en_UK.iso-8859-1/help/configuration.html',
'language/en_UK.iso-8859-1/help/group_list.html',
'language/en_UK.iso-8859-1/help/history.html',
'language/en_UK.iso-8859-1/help/index.php',
'language/en_UK.iso-8859-1/help/maintenance.html',
'language/en_UK.iso-8859-1/help/notification_by_mail.html',
'language/en_UK.iso-8859-1/help/permalinks.html',
'language/en_UK.iso-8859-1/help/search.html',
'language/en_UK.iso-8859-1/help/site_manager.html',
'language/en_UK.iso-8859-1/help/synchronize.html',
'language/en_UK.iso-8859-1/help/thumbnail.html',
'language/en_UK.iso-8859-1/help/user_list.html',
'language/en_UK.iso-8859-1/help/web_service.html',
'language/en_UK.iso-8859-1/help.html',
'language/en_UK.iso-8859-1/index.php',
'language/en_UK.iso-8859-1/install.lang.php',
'language/en_UK.iso-8859-1/iso.txt',
'language/fr_FR.iso-8859-1',
'language/fr_FR.iso-8859-1/about.html',
'language/fr_FR.iso-8859-1/admin.lang.php',
'language/fr_FR.iso-8859-1/common.lang.php',
'language/fr_FR.iso-8859-1/help',
'language/fr_FR.iso-8859-1/help/advanced_feature.html',
'language/fr_FR.iso-8859-1/help/cat_modify.html',
'language/fr_FR.iso-8859-1/help/cat_move.html',
'language/fr_FR.iso-8859-1/help/cat_options.html',
'language/fr_FR.iso-8859-1/help/cat_perm.html',
'language/fr_FR.iso-8859-1/help/configuration.html',
'language/fr_FR.iso-8859-1/help/group_list.html',
'language/fr_FR.iso-8859-1/help/history.html',
'language/fr_FR.iso-8859-1/help/index.php',
'language/fr_FR.iso-8859-1/help/maintenance.html',
'language/fr_FR.iso-8859-1/help/notification_by_mail.html',
'language/fr_FR.iso-8859-1/help/permalinks.html',
'language/fr_FR.iso-8859-1/help/search.html',
'language/fr_FR.iso-8859-1/help/site_manager.html',
'language/fr_FR.iso-8859-1/help/synchronize.html',
'language/fr_FR.iso-8859-1/help/thumbnail.html',
'language/fr_FR.iso-8859-1/help/user_list.html',
'language/fr_FR.iso-8859-1/help/web_service.html',
'language/fr_FR.iso-8859-1/help.html',
'language/fr_FR.iso-8859-1/index.php',
'language/fr_FR.iso-8859-1/install.lang.php',
'language/fr_FR.iso-8859-1/iso.txt',
'plugins/add_index/language/en_UK.iso-8859-1',
'plugins/add_index/language/en_UK.iso-8859-1/help',
'plugins/add_index/language/en_UK.iso-8859-1/help/advanced_feature.html',
'plugins/add_index/language/en_UK.iso-8859-1/help/index.php',
'plugins/add_index/language/en_UK.iso-8859-1/help/site_manager.html',
'plugins/add_index/language/en_UK.iso-8859-1/index.php',
'plugins/add_index/language/en_UK.iso-8859-1/plugin.lang.php',
'plugins/add_index/language/fr_FR.iso-8859-1',
'plugins/add_index/language/fr_FR.iso-8859-1/help',
'plugins/add_index/language/fr_FR.iso-8859-1/help/advanced_feature.html',
'plugins/add_index/language/fr_FR.iso-8859-1/help/index.php',
'plugins/add_index/language/fr_FR.iso-8859-1/help/site_manager.html',
'plugins/add_index/language/fr_FR.iso-8859-1/index.php',
'plugins/add_index/language/fr_FR.iso-8859-1/plugin.lang.php',
'plugins/admin_advices/en_UK.iso-8859-1',
'plugins/admin_advices/en_UK.iso-8859-1/index.php',
'plugins/admin_advices/en_UK.iso-8859-1/lang.adv.php',
'plugins/admin_advices/fr_FR.iso-8859-1',
'plugins/admin_advices/fr_FR.iso-8859-1/index.php',
'plugins/admin_advices/fr_FR.iso-8859-1/lang.adv.php',
'plugins/hello_world',
'plugins/hello_world/index.php',
'plugins/hello_world/main.inc.php',
'template/yoga/admin',
'template/yoga/admin/advanced_feature.tpl',
'template/yoga/admin/cat_list.tpl',
'template/yoga/admin/cat_modify.tpl',
'template/yoga/admin/cat_move.tpl',
'template/yoga/admin/cat_options.tpl',
'template/yoga/admin/cat_perm.tpl',
'template/yoga/admin/check_integrity.tpl',
'template/yoga/admin/comments.tpl',
'template/yoga/admin/configuration.tpl',
'template/yoga/admin/default-layout.css',
'template/yoga/admin/double_select.tpl',
'template/yoga/admin/element_set_global.tpl',
'template/yoga/admin/element_set_unit.tpl',
'template/yoga/admin/group_list.tpl',
'template/yoga/admin/group_perm.tpl',
'template/yoga/admin/history.tpl',
'template/yoga/admin/index.php',
'template/yoga/admin/intro.tpl',
'template/yoga/admin/maintenance.tpl',
'template/yoga/admin/notification_by_mail.tpl',
'template/yoga/admin/permalinks.tpl',
'template/yoga/admin/picture_modify.tpl',
'template/yoga/admin/plugin.tpl',
'template/yoga/admin/plugins.tpl',
'template/yoga/admin/profile.tpl',
'template/yoga/admin/rating.tpl',
'template/yoga/admin/site_manager.tpl',
'template/yoga/admin/site_update.tpl',
'template/yoga/admin/stats.tpl',
'template/yoga/admin/tabsheet.tpl',
'template/yoga/admin/tags.tpl',
'template/yoga/admin/thumbnail.tpl',
'template/yoga/admin/upload.tpl',
'template/yoga/admin/user_list.tpl',
'template/yoga/admin/user_perm.tpl',
'template/yoga/admin/ws_checker.tpl',
'template/yoga/admin.tpl',
'template/yoga/icon/category_delete.png',
'template/yoga/icon/category_elements.png',
'template/yoga/icon/category_jump-to.png',
'template/yoga/icon/category_permissions.png',
'template/yoga/icon/check.png',
'template/yoga/icon/edit_s.png',
'template/yoga/icon/page_end.png',
'template/yoga/icon/page_top.png',
'template/yoga/icon/permissions.png',
'template/yoga/icon/slideshow.png',
'template/yoga/icon/star_e.gif',
'template/yoga/icon/star_f.gif',
'template/yoga/icon/sync_metadata.png',
'template/yoga/icon/toggle_is_default_group.png',
'template/yoga/icon/uncheck.png',
'template/yoga/icon/virt_category.png',
'template/yoga/popuphelp.css',
'template-common/layout.css',
// Comparison between phpwebgallery-2.0.0RC2 and phpwebgallery-2.0.0RC1
'language/en_UK/help/web_service.html',
'language/es_ES/help/web_service.html',
'language/fr_FR/help/web_service.html',
'language/it_IT/help/web_service.html',
'language/nl_NL/help/web_service.html',
'template/yoga/mail/text/html/admin',
'template/yoga/mail/text/html/admin/cat_group_info.tpl',
'template/yoga/mail/text/html/admin/index.php',
'template/yoga/mail/text/html/admin/notification_by_mail.tpl',
'template/yoga/mail/text/plain/admin',
'template/yoga/mail/text/plain/admin/cat_group_info.tpl',
'template/yoga/mail/text/plain/admin/index.php',
'template/yoga/mail/text/plain/admin/notification_by_mail.tpl',
'template-common/lib/plugins/jquery.growfield.js',
'template-common/lib/plugins/jquery.growfield.packed.js',
// Comparison between phpwebgallery-2.0.0RC3 and phpwebgallery-2.0.0RC2
'admin/template/goto/icon/del_favorite.png',
'admin/template/goto/theme/roma/datepicker.css',
// Comparison between phpwebgallery-2.0.0RC4 and phpwebgallery-2.0.0RC3
'template/yoga/install.tpl',
'template/yoga/upgrade.tpl',
// Comparison between trunk-r3105 and phpwebgallery-2.0.0RC4
'admin/template/goto/theme/roma/images/bottom-left-bg.png',
'admin/template/goto/theme/roma/images/top-left-bg.png',
'local/config/database.inc.php',
'template-common/lib/ui/ui.accordion.packed.js',
'template-common/lib/ui/ui.core.packed.js',
'template-common/lib/ui/ui.datepicker.css',
'template-common/lib/ui/ui.datepicker.packed.js',
'template-common/lib/ui/ui.dialog.packed.js',
'template-common/lib/ui/ui.draggable.packed.js',
'template-common/lib/ui/ui.droppable.packed.js',
'template-common/lib/ui/ui.resizable.packed.js',
'template-common/lib/ui/ui.selectable.packed.js',
'template-common/lib/ui/ui.slider.packed.js',
'template-common/lib/ui/ui.sortable.packed.js',
'template-common/lib/ui/ui.tabs.packed.js',
);
$list_exlude_files = array(
'local/config/database.inc.php',
);
$upgrade_description = 'Delete old and not used files';
// +-----------------------------------------------------------------------+
// | Upgrade content |
// +-----------------------------------------------------------------------+
// remove exclude files
$files=array_diff($list_files, $list_exlude_files);
// inverse sort in order to remove corretly directory
rsort($files);
foreach ($files as $file)
{
if (is_file($file))
{
echo 'Delete file '.$file."\n";
@chmod($file, 0777);
if (! unlink($file))
{
echo 'Error on delete file '.$file."\n";
}
}
elseif (is_dir($file))
{
echo 'Delete directory '.$file."\n";
@chmod($file, 0777);
if (! rmdir($file))
{
echo 'Error on directory file '.$file."\n";
}
}
}
echo
"\n"
.'"'.$upgrade_description.'"'.' ended'
."\n"
;
?>

View File

@@ -0,0 +1,50 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'add new email features :
users can modify/delete their owns comments';
$query = '
INSERT INTO '.PREFIX_TABLE.'config (param,value,comment)
VALUES (\'user_can_delete_comment\',\'false\',
\'administrators can allow user delete their own comments\'),
(\'user_can_edit_comment\',\'false\',
\'administrators can allow user edit their own comments\'),
(\'email_admin_on_comment_edition\',\'false\',
\'Send an email to the administrators when a comment is modified\'),
(\'email_admin_on_comment_deletion\',\'false\',
\'Send an email to the administrators when a comment is deleted\')
;';
pwg_query($query);
echo
"\n"
. $upgrade_description
."\n"
;
?>

View File

@@ -0,0 +1,44 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'add new column to save author_id.
Guest users names are saved in author column';
$query = '
ALTER TABLE '.PREFIX_TABLE.'comments
ADD COLUMN author_id smallint(5) DEFAULT NULL
;';
pwg_query($query);
echo
"\n"
. $upgrade_description
."\n"
;
?>

View File

@@ -0,0 +1,59 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'Update column save author_id with value.';
$query = '
UPDATE
'.COMMENTS_TABLE.' AS c ,
'.USERS_TABLE.' AS u,
'.USER_INFOS_TABLE.' AS i
SET c.author_id = u.'.$conf['user_fields']['id'].'
WHERE
c.author_id is null
AND c.author = u.'.$conf['user_fields']['username'].'
AND u.'.$conf['user_fields']['id'].' = i.user_id
AND i.registration_date <= c.date
;';
pwg_query($query);
$query = '
UPDATE '.COMMENTS_TABLE.' AS c
SET c.author_id = '.$conf['guest_id'].'
WHERE c.author_id is null
;';
pwg_query($query);
echo
"\n"
. $upgrade_description
."\n"
;
?>

View File

@@ -0,0 +1,96 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'Update default template to default theme.';
$query = '
ALTER TABLE '.USER_INFOS_TABLE.'
CHANGE COLUMN template theme varchar(255) NOT NULL default \'Sylvia\'
;';
pwg_query($query);
$query = '
SELECT user_id, theme
FROM '.USER_INFOS_TABLE.'
;';
$result = pwg_query($query);
$users = array();
while ($row = pwg_db_fetch_assoc($result))
{
list($user_template, $user_theme) = explode('/', $row['theme']);
switch ($user_template)
{
case 'yoga':
break;
case 'gally':
$user_theme = 'gally-'.$user_theme;
break;
case 'floPure':
$user_theme = 'Pure_'.$user_theme;
break;
case 'floOs':
$user_theme = 'OS_'.$user_theme;
break;
case 'simple':
$user_theme = 'simple-'.$user_theme;
break;
default:
$user_theme = 'Sylvia';
}
array_push($users, array(
'user_id' => $row['user_id'],
'theme' => $user_theme
)
);
}
mass_updates(
USER_INFOS_TABLE,
array(
'primary' => array('user_id'),
'update' => array('theme')
),
$users
);
echo
"\n"
. $upgrade_description
."\n"
;
?>

View File

@@ -0,0 +1,51 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'Add a table to manage themes.';
$query = "
CREATE TABLE ".PREFIX_TABLE."themes (
`id` varchar(64) NOT NULL default '',
`version` varchar(64) NOT NULL default '0',
`name` varchar(64) default NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM";
if (DB_CHARSET == 'utf8')
{
$query .= " DEFAULT CHARACTER SET utf8";
}
pwg_query($query);
echo
"\n"
. $upgrade_description
."\n"
;
?>

View File

@@ -0,0 +1,39 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'Automatically activate core themes.';
include_once(PHPWG_ROOT_PATH . 'admin/include/functions_install.inc.php');
activate_core_themes();
echo
"\n"
. $upgrade_description
."\n"
;
?>

View File

@@ -0,0 +1,54 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined("PHPWG_ROOT_PATH"))
{
die('Hacking attempt!');
}
$upgrade_description = 'Add display configuration options.';
$query = '
INSERT INTO '.CONFIG_TABLE.' (param,value,comment)
VALUES
("menubar_filter_icon","true","Display filter icon"),
("index_sort_order_input","true","Display image order selection list"),
("index_flat_icon","true","Display flat icon"),
("index_posted_date_icon","true","Display calendar by posted date"),
("index_created_date_icon","true","Display calendar by creation date icon"),
("index_slideshow_icon","true","Display slideshow icon"),
("picture_metadata_icon","true","Display metadata icon on picture page"),
("picture_slideshow_icon","true","Display slideshow icon on picture page"),
("picture_favorite_icon","true","Display favorite icon on picture page"),
("picture_navigation_icons","true","Display navigation icons on picture page"),
("picture_navigation_thumb","true","Display navigation thumbnails on picture page")
;';
pwg_query($query);
echo
"\n"
. $upgrade_description
."\n"
;
?>

View File

@@ -0,0 +1,49 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined("PHPWG_ROOT_PATH"))
{
die('Hacking attempt!');
}
$upgrade_description = 'Add display configuration for picture properties.';
$query = '
INSERT INTO '.CONFIG_TABLE.' (param,value,comment)
VALUES
("picture_download_icon","true","Display download icon on picture page"),
(
"picture_informations",
"a:11:{s:6:\"author\";b:1;s:10:\"created_on\";b:1;s:9:\"posted_on\";b:1;s:10:\"dimensions\";b:1;s:4:\"file\";b:1;s:8:\"filesize\";b:1;s:4:\"tags\";b:1;s:10:\"categories\";b:1;s:6:\"visits\";b:1;s:12:\"average_rate\";b:1;s:13:\"privacy_level\";b:1;}",
"Information displayed on picture page"
)
;';
pwg_query($query);
echo
"\n"
. $upgrade_description
."\n"
;
?>

View File

@@ -0,0 +1,44 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined("PHPWG_ROOT_PATH"))
{
die('Hacking attempt!');
}
$upgrade_description = 'Admins can activate/deactivate user customization.';
$query = '
INSERT INTO '.CONFIG_TABLE.' (param,value,comment)
VALUES
("allow_user_customization","true","allow users to customize their gallery?")
;';
pwg_query($query);
echo
"\n"
. $upgrade_description
."\n"
;
?>

View File

@@ -0,0 +1,62 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'Add a table to manage languages.';
$query = "
CREATE TABLE ".PREFIX_TABLE."languages (
`id` varchar(64) NOT NULL default '',
`version` varchar(64) NOT NULL default '0',
`name` varchar(64) default NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM";
if (DB_CHARSET == 'utf8')
{
$query .= " DEFAULT CHARACTER SET utf8";
}
pwg_query($query);
// Fill table
include_once(PHPWG_ROOT_PATH.'include/constants.php');
include_once(PHPWG_ROOT_PATH.'admin/include/languages.class.php');
$languages = new languages(PWG_CHARSET);
foreach ($languages->fs_languages as $language_code => $fs_language)
{
$languages->perform_action('activate', $language_code);
}
echo
"\n"
. $upgrade_description
."\n"
;
?>

View File

@@ -0,0 +1,54 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'Remove adviser status.';
// Existing adviser become normal user
$query = "
UPDATE ".USER_INFOS_TABLE."
SET status = 'normal'
WHERE status IN ('webmaster', 'admin')
AND adviser = 'true'
;";
pwg_query($query);
// Remove adviser column
$query = '
ALTER TABLE '.USER_INFOS_TABLE.'
DROP COLUMN adviser
;';
pwg_query($query);
echo
"\n"
. $upgrade_description
."\n"
;
?>

View File

@@ -0,0 +1,57 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'New colum images.added_by, reference to users.id';
// Add column
$query = 'ALTER TABLE '.IMAGES_TABLE.' ADD COLUMN ';
if ('mysql' == $conf['dblayer'])
{
$query.= ' added_by smallint(5)';
}
if (in_array($conf['dblayer'], array('pgsql', 'sqlite', 'pdo-sqlite')))
{
$query.= ' "added_by" INTEGER default 0';
}
$query.= ' NOT NULL;';
pwg_query($query);
// set the existing photos with the webmaster_id as added_by
$query = 'UPDATE '.IMAGES_TABLE.' SET added_by = '.$conf['webmaster_id'].';';
pwg_query($query);
echo
"\n"
. $upgrade_description
."\n"
;
?>

View File

@@ -0,0 +1,42 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'Monday may not be the first day of the week';
$query = '
INSERT INTO '.PREFIX_TABLE.'config (param,value,comment)
VALUES (\'week_starts_on\',\'monday\', \''.$upgrade_description.'\')
;';
pwg_query($query);
echo
"\n"
. $upgrade_description
."\n"
;
?>

View File

@@ -0,0 +1,109 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'remove user upload as core feature and save config for Community plugin';
$user_upload_conf = array();
// upload_user_access
$conf_orig = $conf;
load_conf_from_db();
$user_upload_conf['upload_user_access'] = $conf['upload_user_access'];
$conf = $conf_orig;
// unvalidated photos submitted by users
$query = '
SELECT *
FROM '.PREFIX_TABLE.'waiting
;';
$result = pwg_query($query);
$user_upload_conf['waiting_rows'] = array();
while ($row = pwg_db_fetch_assoc($result)) {
array_push($user_upload_conf['waiting_rows'], $row);
}
// uploadable categories
$query = '
SELECT id
FROM '.CATEGORIES_TABLE.'
WHERE uploadable = \'true\'
;';
$result = pwg_query($query);
$user_upload_conf['uploadable_categories'] = array();
while ($row = pwg_db_fetch_assoc($result)) {
array_push($user_upload_conf['uploadable_categories'], $row['id']);
}
// save configuration for a future use by the Community plugin
$backup_filepath = PHPWG_ROOT_PATH.$conf['data_location'].'plugins/core_user_upload_to_community.php';
$save_conf = true;
if (is_dir(dirname($backup_filepath)))
{
if (!is_writable(dirname($backup_filepath)))
{
$save_conf = false;
}
}
elseif (!is_writable( PHPWG_ROOT_PATH.$conf['data_location'] ))
{
$save_conf = false;
}
if ($save_conf)
{
mkgetdir(dirname($backup_filepath));
file_put_contents(
$backup_filepath,
'<?php $user_upload_conf = \''.serialize($user_upload_conf).'\'; ?>'
);
}
//
// remove all what is related to user upload in the database
//
// categories.uploadable
pwg_query('ALTER TABLE '.CATEGORIES_TABLE.' DROP COLUMN uploadable;');
// waiting
pwg_query('DROP TABLE '.PREFIX_TABLE.'waiting;');
// config parameter settings : upload_user_access, upload_link_everytime
$query = '
DELETE FROM '.PREFIX_TABLE.'config
WHERE param IN (\'upload_user_access\', \'upload_link_everytime\', \'email_admin_on_picture_uploaded\')
;';
pwg_query($query);
echo
"\n"
. $upgrade_description
."\n"
;
?>

View File

@@ -0,0 +1,53 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'New colum user_cache_categories.user_representative_picture_id';
// Add column
$query = 'ALTER TABLE '.USER_CACHE_CATEGORIES_TABLE.' ADD COLUMN ';
if ('mysql' == $conf['dblayer'])
{
$query.= ' `user_representative_picture_id` mediumint(8) unsigned default NULL';
}
if (in_array($conf['dblayer'], array('pgsql', 'sqlite', 'pdo-sqlite')))
{
$query.= ' "user_representative_picture_id" INTEGER';
}
$query.= ';';
pwg_query($query);
echo
"\n"
. $upgrade_description
."\n"
;
?>

View File

@@ -0,0 +1,46 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'add time in images.date_creation column';
// Only MySQL is concerned, other DB engines are already "timestamp"
if ('mysql' == $conf['dblayer'])
{
$query = '
ALTER TABLE '.IMAGES_TABLE.'
MODIFY date_creation datetime
;';
pwg_query($query);
}
echo
"\n"
. $upgrade_description
."\n"
;
?>

View File

@@ -0,0 +1,63 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'makes sure default user has a theme and a language';
$query = '
SELECT
theme,
language
FROM '.USER_INFOS_TABLE.'
WHERE user_id = '.$conf['default_user_id'].'
;';
$result = pwg_query($query);
list($theme, $language) = pwg_db_fetch_row($result);
$data = array(
'user_id' => $conf['default_user_id'],
'theme' => empty($theme) ? 'Sylvia' : $theme,
'language' => empty($language) ? 'en_UK' : $language,
);
mass_updates(
USER_INFOS_TABLE,
array(
'primary' => array('user_id'),
'update' => array('theme', 'language')
),
array(
$data
)
);
echo
"\n"
. $upgrade_description
."\n"
;
?>

View File

@@ -0,0 +1,52 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'add the config parameter comments_update_validation';
$query = '
INSERT INTO '.CONFIG_TABLE.'
(
param,
value,
comment
)
VALUES (
\'comments_update_validation\',
false,
\'administrators validate users updated comments before becoming visible\'
)
;';
pwg_query($query);
echo
"\n"
. $upgrade_description
."\n"
;
?>

View File

@@ -0,0 +1,40 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'delete the config parameter comments_update_validation';
$query = 'DELETE FROM '.CONFIG_TABLE.' WHERE param = \'comments_update_validation\';';
pwg_query($query);
echo
"\n"
. $upgrade_description
."\n"
;
?>

View File

@@ -0,0 +1,30 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
// Recursive call
$url = '../';
header( 'Request-URI: '.$url );
header( 'Content-Location: '.$url );
header( 'Location: '.$url );
exit();
?>