1 | <?php |
---|
2 | # ***** BEGIN LICENSE BLOCK ***** |
---|
3 | # |
---|
4 | # This file is part of Popularity Contest. |
---|
5 | # Copyright 2007,2009 Moe (http://gniark.net/) |
---|
6 | # |
---|
7 | # Popularity Contest 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; either version 3 of the License, or |
---|
10 | # (at your option) any later version. |
---|
11 | # |
---|
12 | # Popularity Contest is distributed in the hope that it will be useful, |
---|
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
15 | # GNU General Public License for more details. |
---|
16 | # |
---|
17 | # You should have received a copy of the GNU General Public License |
---|
18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
---|
19 | # |
---|
20 | # Icon (icon.png) is from Silk Icons : http://www.famfamfam.com/lab/icons/silk/ |
---|
21 | # |
---|
22 | # ***** END LICENSE BLOCK ***** |
---|
23 | |
---|
24 | if (!defined('DC_CONTEXT_ADMIN')) {return;} |
---|
25 | |
---|
26 | # On lit la version du plugin |
---|
27 | $m_version = $core->plugins->moduleInfo('popularityContest','version'); |
---|
28 | |
---|
29 | # On lit la version du plugin dans la table des versions |
---|
30 | $i_version = $core->getVersion('popularityContest'); |
---|
31 | |
---|
32 | # La version dans la table est supérieure ou égale à |
---|
33 | # celle du module, on ne fait rien puisque celui-ci |
---|
34 | # est installé |
---|
35 | if (version_compare($i_version,$m_version,'>=')) {return;} |
---|
36 | |
---|
37 | # default settings |
---|
38 | $core->blog->settings->setNameSpace('popularitycontest'); |
---|
39 | # Time interval in seconds between sends to Popularity Contest : 3 days |
---|
40 | $core->blog->settings->put('popularityContest_time_interval', |
---|
41 | (3*24*3600),'integer', |
---|
42 | 'Time interval in seconds between sends to Popularity Contest', |
---|
43 | # don't replace old value, global setting |
---|
44 | false,true); |
---|
45 | # Popularity Contest last report |
---|
46 | $core->blog->settings->put('popularityContest_last_report', |
---|
47 | strtotime('-1 month'),'integer', |
---|
48 | 'Popularity Contest last report (Unix timestamp)',false,true); |
---|
49 | # Popularity Contest last try |
---|
50 | $core->blog->settings->put('popularityContest_last_try', |
---|
51 | strtotime('-1 month'),'integer', |
---|
52 | 'Popularity Contest last try (Unix timestamp)',false,true); |
---|
53 | # Hide plugins |
---|
54 | $core->blog->settings->put('popularityContest_hidden_plugins', |
---|
55 | base64_encode(serialize(array(''))),'text','Hidden plugins',false,true); |
---|
56 | $core->blog->settings->setNameSpace('system'); |
---|
57 | |
---|
58 | # La procédure d'installation commence vraiment là |
---|
59 | $core->setVersion('popularityContest',$m_version); |
---|
60 | return true; |
---|
61 | ?> |
---|