Changeset 9383 for extensions/PWG_Stuffs/maintain.inc.php
- Timestamp:
- Feb 26, 2011, 4:28:24 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/PWG_Stuffs/maintain.inc.php
r9369 r9383 16 16 `name` text NOT NULL, 17 17 `descr` varchar(255) default NULL, 18 `type` varchar(255) NOT NULL,19 18 `path` varchar(255) default NULL, 19 `parent` varchar(255) default NULL, 20 20 `datas` longtext default NULL, 21 21 `users` varchar(255) default NULL, 22 22 `groups` varchar(255) default NULL, 23 `level` TINYINT( 3 ) NOT NULL default "0", 23 24 `show_title` enum(\'true\',\'false\') NOT NULL, 24 25 `on_home` enum(\'true\',\'false\') NOT NULL, 26 `on_root` enum(\'true\',\'false\') NOT NULL, 25 27 `on_cats` enum(\'true\',\'false\') NOT NULL, 26 28 `on_picture` enum(\'true\',\'false\') NOT NULL, … … 34 36 pwg_query($q); 35 37 36 $q = "INSERT INTO `" . $prefixeTable . "stuffs` (`id`, `pos`, `name`, ` descr`, `type`, `path`, `datas`, `users`, `groups`, `show_title`, `on_home`, `on_cats`, `on_picture`, `id_line`, `width`)37 VALUES (0, 1, 'MainBlock', NULL, 'MainBlock', NULL, NULL, 'guest,generic,normal,admin,webmaster', NULL, 'true', 'true', 'true', 'true', NULL, NULL);";38 $q = "INSERT INTO `" . $prefixeTable . "stuffs` (`id`, `pos`, `name`, `users`, `show_title`, `on_home`, `on_cats`, `on_picture`) 39 VALUES (0, 1, 'MainBlock', 'guest,generic,normal,admin,webmaster', 'true', 'true', 'true', 'true');"; 38 40 pwg_query($q); 39 41 } 40 }41 42 42 function plugin_activate($id, $version) 43 { 44 global $plugins, $prefixeTable; 43 if (!isset($conf['PWG_Stuffs'])) 44 { 45 $config = array( 46 'level_perm' => false, 47 'group_perm' => false, 48 'user_perm' => false, 49 ); 45 50 46 // Check if upgrade is needed 47 if ($version != $plugins->fs_plugins[$id]['version']) 48 { 49 define('STUFFS_VERSION', $plugins->fs_plugins[$id]['version']); 50 include('admin/upgrade.inc.php'); 51 $query = 'INSERT INTO ' . CONFIG_TABLE . ' (param,value,comment) 52 VALUES ("PWG_Stuffs" , "'.pwg_db_real_escape_string(serialize($config)).'" , "PWG Stuffs configuration");'; 53 pwg_query($query); 51 54 } 52 55 } … … 54 57 function plugin_uninstall() 55 58 { 56 59 global $prefixeTable; 57 60 58 61 $q = 'DROP TABLE ' . $prefixeTable . 'stuffs;'; 59 pwg_query($q); 62 pwg_query($q); 63 64 $q = 'DELETE FROM ' . CONFIG_TABLE . ' WHERE param="PWG_Stuffs";'; 65 pwg_query($q); 60 66 } 61 67
Note: See TracChangeset
for help on using the changeset viewer.