[30631] | 1 | <?php |
---|
| 2 | defined('PHPWG_ROOT_PATH') or die('Hacking attempt!'); |
---|
| 3 | |
---|
| 4 | class manage_info_photos_maintain extends PluginMaintain |
---|
| 5 | { |
---|
| 6 | private $installed = false; |
---|
| 7 | |
---|
| 8 | function __construct($plugin_id){ |
---|
| 9 | parent::__construct($plugin_id); |
---|
| 10 | } |
---|
| 11 | |
---|
| 12 | function install($plugin_version, &$errors=array()){ |
---|
| 13 | global $prefixeTable; |
---|
| 14 | |
---|
| 15 | if (!defined('ADD_INFO_PHOTO_TABLE')) define('ADD_INFO_PHOTO_TABLE', $prefixeTable.'add_Info_photos'); |
---|
| 16 | $query = "CREATE TABLE IF NOT EXISTS ". ADD_INFO_PHOTO_TABLE ." ( |
---|
| 17 | id_info_pho SMALLINT(5) UNSIGNED NOT NULL auto_increment, |
---|
| 18 | designation VARCHAR(255) NOT NULL , |
---|
| 19 | orderinfo SMALLINT(5) UNSIGNED NOT NULL , |
---|
| 20 | active SMALLINT(5) UNSIGNED NOT NULL , |
---|
| 21 | edit SMALLINT(5) UNSIGNED NOT NULL , |
---|
| 22 | PRIMARY KEY (id_info_pho))DEFAULT CHARSET=utf8;"; |
---|
| 23 | $result = pwg_query($query); |
---|
| 24 | |
---|
| 25 | if (!defined('ADD_INFO_PHOTO_DATA_TABLE')) define('ADD_INFO_PHOTO_DATA_TABLE', $prefixeTable.'add_Info_photos_data'); |
---|
| 26 | $query = "CREATE TABLE IF NOT EXISTS ". ADD_INFO_PHOTO_DATA_TABLE ." ( |
---|
| 27 | id_img SMALLINT(5) UNSIGNED NOT NULL , |
---|
| 28 | id_info_pho SMALLINT(5) UNSIGNED NOT NULL , |
---|
| 29 | data VARCHAR(255) NOT NULL , |
---|
| 30 | PRIMARY KEY (id_img,id_info_pho))DEFAULT CHARSET=utf8;"; |
---|
| 31 | $result = pwg_query($query); |
---|
| 32 | |
---|
| 33 | $q = 'INSERT INTO ' . $prefixeTable . 'Add_Info_photos(id_info_pho,designation,orderinfo,active,edit)VALUES (1,"author",1,0,0);'; |
---|
| 34 | pwg_query($q); |
---|
| 35 | $q = 'INSERT INTO ' . $prefixeTable . 'Add_Info_photos(id_info_pho,designation,orderinfo,active,edit)VALUES (2,"Created on",2,0,0);'; |
---|
| 36 | pwg_query($q); |
---|
| 37 | $q = 'INSERT INTO ' . $prefixeTable . 'Add_Info_photos(id_info_pho,designation,orderinfo,active,edit)VALUES (3,"Posted on",3,0,0);'; |
---|
| 38 | pwg_query($q); |
---|
| 39 | $q = 'INSERT INTO ' . $prefixeTable . 'Add_Info_photos(id_info_pho,designation,orderinfo,active,edit)VALUES (4,"Dimensions",4,0,0);'; |
---|
| 40 | pwg_query($q); |
---|
| 41 | $q = 'INSERT INTO ' . $prefixeTable . 'Add_Info_photos(id_info_pho,designation,orderinfo,active,edit)VALUES (5,"File",5,0,0);'; |
---|
| 42 | pwg_query($q); |
---|
| 43 | $q = 'INSERT INTO ' . $prefixeTable . 'Add_Info_photos(id_info_pho,designation,orderinfo,active,edit)VALUES (6,"Filesize",6,0,0);'; |
---|
| 44 | pwg_query($q); |
---|
| 45 | $q = 'INSERT INTO ' . $prefixeTable . 'Add_Info_photos(id_info_pho,designation,orderinfo,active,edit)VALUES (7,"Tags",7,0,0);'; |
---|
| 46 | pwg_query($q); |
---|
| 47 | $q = 'INSERT INTO ' . $prefixeTable . 'Add_Info_photos(id_info_pho,designation,orderinfo,active,edit)VALUES (8,"Albums",8,0,0);'; |
---|
| 48 | pwg_query($q); |
---|
| 49 | $q = 'INSERT INTO ' . $prefixeTable . 'Add_Info_photos(id_info_pho,designation,orderinfo,active,edit)VALUES (9,"Visits",9,0,0);'; |
---|
| 50 | pwg_query($q); |
---|
| 51 | $q = 'INSERT INTO ' . $prefixeTable . 'Add_Info_photos(id_info_pho,designation,orderinfo,active,edit)VALUES (10,"Average",10,0,0);'; |
---|
| 52 | pwg_query($q); |
---|
| 53 | $q = 'INSERT INTO ' . $prefixeTable . 'Add_Info_photos(id_info_pho,designation,orderinfo,active,edit)VALUES (11,"Who can see this photo?",11,0,0);'; |
---|
| 54 | pwg_query($q); |
---|
| 55 | |
---|
| 56 | } |
---|
| 57 | |
---|
| 58 | function activate($plugin_version, &$errors=array()){ |
---|
| 59 | |
---|
| 60 | } |
---|
| 61 | |
---|
| 62 | function update($old_version, $new_version, &$errors=array()){ |
---|
| 63 | global $conf; |
---|
| 64 | if (!isset($conf['Add_Info_photos'])) { |
---|
| 65 | conf_update_param('Add_Info_photos','Categories',true); |
---|
| 66 | } |
---|
| 67 | } |
---|
| 68 | |
---|
| 69 | function deactivate(){ |
---|
| 70 | } |
---|
| 71 | |
---|
| 72 | function uninstall(){ |
---|
| 73 | conf_delete_param('Add_Info_photos'); |
---|
| 74 | $q = 'DROP TABLE ' . $prefixeTable . 'add_Info_photos;'; |
---|
| 75 | pwg_query($q); |
---|
| 76 | $q = 'DROP TABLE ' . $prefixeTable . 'add_Info_photos_data;'; |
---|
| 77 | pwg_query($q); |
---|
| 78 | } |
---|
| 79 | } |
---|
| 80 | ?> |
---|