source: extensions/see_photos_by_user/maintain.class.php @ 32006

Last change on this file since 32006 was 31460, checked in by ddtddt, 8 years ago

[extensions] - see_photos_by_user - 2.8

File size: 4.2 KB
Line 
1<?php
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// +-----------------------------------------------------------------------+
21defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
22
23class 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  {
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    }
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'])) {
68        conf_update_param('see_photos_by_user_nbphotos', '0',true);
69    }
70    if (!isset($conf['see_photos_by_user_limit'])) {
71        conf_update_param('see_photos_by_user_limit', '1000',true);
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) {
77        conf_update_param('see_photos_by_user_show', '1',true);
78    }
79    if (!isset($conf['see_photos_by_user_show_user_home'])) {
80        conf_update_param('see_photos_by_user_show_user_home', '1',true);
81    }
82    if (!isset($conf['see_photos_by_user_color'])) {
83        conf_update_param('see_photos_by_user_color', '#ffffff',true);
84    }
85    if (!isset($conf['see_photos_by_user_shape'])) {
86        conf_update_param('see_photos_by_user_shape', 'sphere',true);
87    }
88  }
89 
90  function deactivate()
91  {
92  }
93
94  function uninstall()
95  {
96    conf_delete_param('see_photos_by_user_nbphotos');
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');
103  }
104}
105?>
Note: See TracBrowser for help on using the repository browser.