Last change
on this file since 11217 was
5615,
checked in by Eric, 14 years ago
|
[nbc_HistoryIPExcluder]
- Piwigo 2.1 compliance
- Multiple database support
- Improving the display of plugin's name
|
-
Property svn:eol-style set to
LF
|
File size:
1.2 KB
|
Line | |
---|
1 | <?php |
---|
2 | |
---|
3 | function plugin_install() |
---|
4 | { |
---|
5 | global $conf; |
---|
6 | |
---|
7 | $default= array(); |
---|
8 | |
---|
9 | $q = ' |
---|
10 | INSERT INTO '.CONFIG_TABLE.' (param,value,comment) |
---|
11 | VALUES ("HistoryIPExcluder","","History IP Excluder parameters"); |
---|
12 | '; |
---|
13 | |
---|
14 | pwg_query($q); |
---|
15 | } |
---|
16 | |
---|
17 | |
---|
18 | function plugin_activate() |
---|
19 | { |
---|
20 | global $conf; |
---|
21 | |
---|
22 | /* Check for upgrade from 2.0.0 to 2.0.1 */ |
---|
23 | /* *************************************** */ |
---|
24 | $query = ' |
---|
25 | SELECT param |
---|
26 | FROM '.CONFIG_TABLE.' |
---|
27 | WHERE param = "nbc_HistoryIPExcluder" |
---|
28 | ;'; |
---|
29 | $count = pwg_db_num_rows(pwg_query($query)); |
---|
30 | |
---|
31 | if ($count == 1) |
---|
32 | { |
---|
33 | /* upgrade from branch 2.0.0 to 2.0.1 */ |
---|
34 | /* ************************************ */ |
---|
35 | upgrade_200(); |
---|
36 | } |
---|
37 | } |
---|
38 | |
---|
39 | |
---|
40 | function plugin_uninstall() |
---|
41 | { |
---|
42 | global $conf; |
---|
43 | |
---|
44 | if (isset($conf['nbc_HistoryIPExcluder'])) |
---|
45 | { |
---|
46 | $q = ' |
---|
47 | DELETE FROM '.CONFIG_TABLE.' |
---|
48 | WHERE param="nbc_HistoryIPExcluder" LIMIT 1; |
---|
49 | '; |
---|
50 | |
---|
51 | pwg_query($q); |
---|
52 | } |
---|
53 | } |
---|
54 | |
---|
55 | |
---|
56 | function upgrade_200() |
---|
57 | { |
---|
58 | global $conf; |
---|
59 | |
---|
60 | $q = ' |
---|
61 | UPDATE '.CONFIG_TABLE.' |
---|
62 | SET param = "HistoryIPExcluder" |
---|
63 | WHERE param = "nbc_HistoryIPExcluder" |
---|
64 | ;'; |
---|
65 | pwg_query($q); |
---|
66 | |
---|
67 | $q = ' |
---|
68 | UPDATE '.CONFIG_TABLE.' |
---|
69 | SET comment = "History IP Excluder parameters" |
---|
70 | WHERE comment = "Parametres nbc History IP Excluder" |
---|
71 | ;'; |
---|
72 | pwg_query($q); |
---|
73 | } |
---|
74 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.