Changeset 6758 for extensions/nbc_HistoryIPExcluder/trunk/maintain.inc.php
- Timestamp:
- Aug 15, 2010, 3:03:21 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/nbc_HistoryIPExcluder/trunk/maintain.inc.php
r5615 r6758 10 10 INSERT INTO '.CONFIG_TABLE.' (param,value,comment) 11 11 VALUES ("HistoryIPExcluder","","History IP Excluder parameters"); 12 '; 13 14 pwg_query($q); 15 16 $default = array ( 17 'Blacklist' => "0", 18 'Version'=> "2.1.1", 19 ); 20 21 $q = ' 22 INSERT INTO '.CONFIG_TABLE.' (param,value,comment) 23 VALUES ("HistoryIPConfig","'.addslashes(serialize($default)).'","History IP Excluder options"); 12 24 '; 13 25 … … 31 43 if ($count == 1) 32 44 { 33 /* upgrade from branch 2.0.0 to 2.0.1 */45 /* upgrade from branch 2.0.0 to 2.0.1 */ 34 46 /* ************************************ */ 35 47 upgrade_200(); 48 } 49 50 $query = ' 51 SELECT param 52 FROM '.CONFIG_TABLE.' 53 WHERE param = "HistoryIPConfig" 54 ;'; 55 $count = pwg_db_num_rows(pwg_query($query)); 56 57 if ($count == 0) 58 { 59 /* upgrade from branch 2.1.0 to 2.1.1 */ 60 /* ************************************ */ 61 upgrade_210(); 36 62 } 37 63 } … … 42 68 global $conf; 43 69 44 if (isset($conf[' nbc_HistoryIPExcluder']))70 if (isset($conf['HistoryIPExcluder'])) 45 71 { 46 72 $q = ' 47 73 DELETE FROM '.CONFIG_TABLE.' 48 WHERE param=" nbc_HistoryIPExcluder" LIMIT 1;74 WHERE param="HistoryIPExcluder" LIMIT 1; 49 75 '; 50 76 51 77 pwg_query($q); 52 78 } 79 if (isset($conf['HistoryIPConfig'])) 80 { 81 $q = ' 82 DELETE FROM '.CONFIG_TABLE.' 83 WHERE param="HistoryIPConfig" LIMIT 1; 84 '; 85 86 pwg_query($q); 87 } 53 88 } 54 89 … … 71 106 ;'; 72 107 pwg_query($q); 108 109 upgrade_210(); 110 } 111 112 function upgrade_210() 113 { 114 global $conf; 115 116 $default = array ( 117 'Blacklist' => "0", 118 'Version'=> "2.1.1", 119 ); 120 121 $q = ' 122 INSERT INTO '.CONFIG_TABLE.' (param,value,comment) 123 VALUES ("HistoryIPConfig","'.addslashes(serialize($default)).'","History IP Excluder options"); 124 '; 125 126 pwg_query($q); 73 127 } 74 128 ?>
Note: See TracChangeset
for help on using the changeset viewer.