source: extensions/nbc_HistoryIPExcluder/trunk/maintain.inc.php @ 5615

Last change on this file since 5615 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
3function plugin_install()
4{
5  global $conf;
6 
7  $default= array();
8
9  $q = '
10INSERT INTO '.CONFIG_TABLE.' (param,value,comment)
11VALUES ("HistoryIPExcluder","","History IP Excluder parameters");
12';
13     
14  pwg_query($q);
15}
16
17
18function plugin_activate()
19{
20  global $conf;
21 
22/* Check for upgrade from 2.0.0 to 2.0.1 */
23/* *************************************** */
24        $query = '
25SELECT param
26  FROM '.CONFIG_TABLE.'
27WHERE 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
40function plugin_uninstall()
41{
42  global $conf;
43
44  if (isset($conf['nbc_HistoryIPExcluder']))
45  {
46    $q = '
47DELETE FROM '.CONFIG_TABLE.'
48WHERE param="nbc_HistoryIPExcluder" LIMIT 1;
49';
50
51    pwg_query($q);
52  }
53}
54
55
56function upgrade_200()
57{
58  global $conf;
59 
60  $q = '
61UPDATE '.CONFIG_TABLE.'
62SET param = "HistoryIPExcluder"
63WHERE param = "nbc_HistoryIPExcluder"
64;';
65  pwg_query($q);
66
67  $q = '
68UPDATE '.CONFIG_TABLE.'
69SET comment = "History IP Excluder parameters"
70WHERE comment = "Parametres nbc History IP Excluder"
71;';
72  pwg_query($q);
73}
74?>
Note: See TracBrowser for help on using the repository browser.