[30423] | 1 | <?php |
---|
[31460] | 2 | // +-----------------------------------------------------------------------+ |
---|
| 3 | // | See photos by user plugin for piwigo | |
---|
| 4 | // +-----------------------------------------------------------------------+ |
---|
| 5 | // | Copyright(C) 2014 - 2016 ddtddt http://temmii.com/piwigo/ | |
---|
| 6 | // +-----------------------------------------------------------------------+ |
---|
| 7 | // | This program is free software; you can redistribute it and/or modify | |
---|
| 8 | // | it under the terms of the GNU General Public License as published by | |
---|
| 9 | // | the Free Software Foundation | |
---|
| 10 | // | | |
---|
| 11 | // | This program is distributed in the hope that it will be useful, but | |
---|
| 12 | // | WITHOUT ANY WARRANTY; without even the implied warranty of | |
---|
| 13 | // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
---|
| 14 | // | General Public License for more details. | |
---|
| 15 | // | | |
---|
| 16 | // | You should have received a copy of the GNU General Public License | |
---|
| 17 | // | along with this program; if not, write to the Free Software | |
---|
| 18 | // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | |
---|
| 19 | // | USA. | |
---|
| 20 | // +-----------------------------------------------------------------------+ |
---|
[30423] | 21 | defined('PHPWG_ROOT_PATH') or die('Hacking attempt!'); |
---|
| 22 | |
---|
| 23 | class see_photos_by_user_maintain extends PluginMaintain |
---|
| 24 | { |
---|
| 25 | private $installed = false; |
---|
| 26 | |
---|
| 27 | function __construct($plugin_id) |
---|
| 28 | { |
---|
| 29 | parent::__construct($plugin_id); |
---|
| 30 | } |
---|
| 31 | |
---|
| 32 | function install($plugin_version, &$errors=array()) |
---|
| 33 | { |
---|
| 34 | |
---|
| 35 | } |
---|
| 36 | |
---|
| 37 | function activate($plugin_version, &$errors=array()) |
---|
| 38 | { |
---|
[30768] | 39 | global $conf; |
---|
| 40 | if (!isset($conf['see_photos_by_user_nbphotos'])) { |
---|
| 41 | conf_update_param('see_photos_by_user_nbphotos', '0',true); |
---|
| 42 | } |
---|
| 43 | if (!isset($conf['see_photos_by_user_limit'])) { |
---|
| 44 | conf_update_param('see_photos_by_user_limit', '1000',true); |
---|
| 45 | } |
---|
| 46 | if (!isset($conf['see_photos_by_user_order'])) { |
---|
| 47 | conf_update_param('see_photos_by_user_order', 'username ASC'); |
---|
| 48 | } |
---|
| 49 | if (!isset($conf['see_photos_by_user_show'])||$conf['see_photos_by_user_show']>2) { |
---|
| 50 | conf_update_param('see_photos_by_user_show', '1',true); |
---|
| 51 | } |
---|
| 52 | if (!isset($conf['see_photos_by_user_show_user_home'])) { |
---|
| 53 | conf_update_param('see_photos_by_user_show_user_home', '1',true); |
---|
| 54 | } |
---|
| 55 | if (!isset($conf['see_photos_by_user_color'])) { |
---|
| 56 | conf_update_param('see_photos_by_user_color', '#ffffff',true); |
---|
| 57 | } |
---|
| 58 | if (!isset($conf['see_photos_by_user_shape'])) { |
---|
| 59 | conf_update_param('see_photos_by_user_shape', 'sphere',true); |
---|
| 60 | } |
---|
[30423] | 61 | |
---|
| 62 | } |
---|
| 63 | |
---|
| 64 | function update($old_version, $new_version, &$errors=array()) |
---|
| 65 | { |
---|
| 66 | global $conf; |
---|
| 67 | if (!isset($conf['see_photos_by_user_nbphotos'])) { |
---|
[30424] | 68 | conf_update_param('see_photos_by_user_nbphotos', '0',true); |
---|
[30423] | 69 | } |
---|
| 70 | if (!isset($conf['see_photos_by_user_limit'])) { |
---|
[30424] | 71 | conf_update_param('see_photos_by_user_limit', '1000',true); |
---|
[30423] | 72 | } |
---|
| 73 | if (!isset($conf['see_photos_by_user_order'])) { |
---|
| 74 | conf_update_param('see_photos_by_user_order', 'username ASC'); |
---|
| 75 | } |
---|
| 76 | if (!isset($conf['see_photos_by_user_show'])||$conf['see_photos_by_user_show']>2) { |
---|
[30424] | 77 | conf_update_param('see_photos_by_user_show', '1',true); |
---|
[30423] | 78 | } |
---|
| 79 | if (!isset($conf['see_photos_by_user_show_user_home'])) { |
---|
[30424] | 80 | conf_update_param('see_photos_by_user_show_user_home', '1',true); |
---|
[30423] | 81 | } |
---|
| 82 | if (!isset($conf['see_photos_by_user_color'])) { |
---|
[30424] | 83 | conf_update_param('see_photos_by_user_color', '#ffffff',true); |
---|
[30423] | 84 | } |
---|
[30429] | 85 | if (!isset($conf['see_photos_by_user_shape'])) { |
---|
| 86 | conf_update_param('see_photos_by_user_shape', 'sphere',true); |
---|
| 87 | } |
---|
[30423] | 88 | } |
---|
| 89 | |
---|
| 90 | function deactivate() |
---|
| 91 | { |
---|
| 92 | } |
---|
| 93 | |
---|
| 94 | function uninstall() |
---|
| 95 | { |
---|
| 96 | conf_delete_param('see_photos_by_user_nbphotos'); |
---|
[30768] | 97 | conf_delete_param('see_photos_by_user_limit'); |
---|
| 98 | conf_delete_param('see_photos_by_user_order'); |
---|
| 99 | conf_delete_param('see_photos_by_user_show'); |
---|
| 100 | conf_delete_param('see_photos_by_user_show_user_home'); |
---|
| 101 | conf_delete_param('see_photos_by_user_color'); |
---|
| 102 | conf_delete_param('see_photos_by_user_shape'); |
---|
[30423] | 103 | } |
---|
| 104 | } |
---|
| 105 | ?> |
---|