Changeset 4276 for extensions/event_cats/maintain.inc.php
- Timestamp:
- Nov 16, 2009, 1:26:06 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/event_cats/maintain.inc.php
r4239 r4276 36 36 include_once(EVNTCATS_PATH.'include/ec_conf.inc.php'); 37 37 38 // *********************************************************************** 38 39 function plugin_uninstall() { 39 global $prefixeTable , $ec_conf;40 global $prefixeTable; 40 41 41 unset($ec_conf);42 42 pwg_query("DELETE FROM `".CONFIG_TABLE."` WHERE `param` = 'event_cats' LIMIT 1;"); 43 return pwg_query('DROP TABLE IF EXISTS `'.$prefixeTable.'event_cats`;'); 43 pwg_query('DROP TABLE IF EXISTS `'.$prefixeTable.'event_cats_duplic`;'); 44 return pwg_query('DROP TABLE IF EXISTS `'.$prefixeTable.'event_cats_autolog`;'); 44 45 } 45 46 47 // *********************************************************************** 46 48 function plugin_install() { 47 49 global $prefixeTable; 48 50 49 51 plugin_uninstall(); 52 50 53 // create table for plugin, if it doesn't exist yet 51 $ q =pwg_query("52 CREATE TABLE `".$prefixeTable."event_cats ` (54 $r = (pwg_query(" 55 CREATE TABLE `".$prefixeTable."event_cats_autolog` ( 53 56 `id` SMALLINT(5) UNSIGNED NOT NULL AUTO_INCREMENT , 54 57 `code` VARCHAR(32) DEFAULT NULL , … … 63 66 ) 64 67 DEFAULT CHARACTER SET utf8; 65 ") ;68 ") !== false); 66 69 67 70 /* … … 131 134 132 135 */ 133 pwg_query(" 136 137 if ($r) $r = (pwg_query(" 138 CREATE TABLE `".$prefixeTable."event_cats_duplic` ( 139 `item` VARCHAR(5) NOT NULL , 140 `val` VARCHAR(32) NOT NULL , 141 KEY `item` (`item`), 142 KEY `val` (`val`) 143 ) 144 DEFAULT CHARACTER SET utf8; 145 ") !== false); 146 147 /* 148 Explanations on table structure : 149 150 item : the code used as "autolog" argument. If thie code provided by the 151 visitor does not exist in the table, the administrator can choose 152 whether the visitor is redirected to the home page (nothing 153 happens) or to the "access denied" page ; 154 value : the account concerned in following values ; 155 156 */ 157 158 if ($r) $r = (pwg_query(" 134 159 INSERT INTO `".CONFIG_TABLE."` (`param`,`value`,`comment`) 135 160 VALUES ('event_cats','0','Paramètres du plugin Event Cats'); 136 "); 137 change_ec_conf('activated', '0'); 138 return $q; 161 ") !== false); 162 163 if ($r) $r = (change_ec_conf('activated', '0')); 164 165 if ($r) return true; 166 else { 167 plugin_uninstall(); 168 return false; 169 } 139 170 } 140 171 172 // *********************************************************************** 141 173 function plugin_activate() { 142 174 change_ec_conf('activated', '1'); 143 175 } 144 176 177 // *********************************************************************** 145 178 function plugin_deactivate() { 146 179 change_ec_conf('activated', '0');
Note: See TracChangeset
for help on using the changeset viewer.