Changeset 30702 for extensions/manage_properties_photos/maintain.class.php
- Timestamp:
- Dec 6, 2014, 8:32:09 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/manage_properties_photos/maintain.class.php
r30676 r30702 2 2 defined('PHPWG_ROOT_PATH') or die('Hacking attempt!'); 3 3 4 class manage_ info_photos_maintain extends PluginMaintain4 class manage_properties_photos_maintain extends PluginMaintain 5 5 { 6 6 private $installed = false; … … 13 13 global $prefixeTable; 14 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 designationVARCHAR(255) NOT NULL ,19 order infoSMALLINT(5) UNSIGNED NOT NULL ,15 if (!defined('ADD_PROP_PHOTO_TABLE')) define('ADD_PROP_PHOTO_TABLE', $prefixeTable.'add_properties_photos'); 16 $query = "CREATE TABLE IF NOT EXISTS ". ADD_PROP_PHOTO_TABLE ." ( 17 id_prop_pho SMALLINT(5) UNSIGNED NOT NULL auto_increment, 18 wording VARCHAR(255) NOT NULL , 19 orderprop SMALLINT(5) UNSIGNED NOT NULL , 20 20 active SMALLINT(5) UNSIGNED NOT NULL , 21 21 edit SMALLINT(5) UNSIGNED NOT NULL , 22 PRIMARY KEY (id_ info_pho))DEFAULT CHARSET=utf8;";22 PRIMARY KEY (id_prop_pho))DEFAULT CHARSET=utf8;"; 23 23 $result = pwg_query($query); 24 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 ." (25 if (!defined('ADD_PROP_PHOTO_DATA_TABLE')) define('ADD_PROP_PHOTO_DATA_TABLE', $prefixeTable.'add_properties_photos_data'); 26 $query = "CREATE TABLE IF NOT EXISTS ". ADD_PROP_PHOTO_DATA_TABLE ." ( 27 27 id_img SMALLINT(5) UNSIGNED NOT NULL , 28 id_ info_pho SMALLINT(5) UNSIGNED NOT NULL ,28 id_prop_pho SMALLINT(5) UNSIGNED NOT NULL , 29 29 data VARCHAR(255) NOT NULL , 30 PRIMARY KEY (id_img,id_ info_pho))DEFAULT CHARSET=utf8;";30 PRIMARY KEY (id_img,id_prop_pho))DEFAULT CHARSET=utf8;"; 31 31 $result = pwg_query($query); 32 32 33 $q = 'INSERT INTO ' . $prefixeTable . 'add_ Info_photos(id_info_pho,designation,orderinfo,active,edit)VALUES (1,"author",1,0,0);';33 $q = 'INSERT INTO ' . $prefixeTable . 'add_properties_photos(id_prop_pho,wording,orderprop,active,edit)VALUES (1,"author",1,0,0);'; 34 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);';35 $q = 'INSERT INTO ' . $prefixeTable . 'add_properties_photos(id_prop_pho,wording,orderprop,active,edit)VALUES (2,"Created on",2,0,0);'; 36 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);';37 $q = 'INSERT INTO ' . $prefixeTable . 'add_properties_photos(id_prop_pho,wording,orderprop,active,edit)VALUES (3,"Posted on",3,0,0);'; 38 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);';39 $q = 'INSERT INTO ' . $prefixeTable . 'add_properties_photos(id_prop_pho,wording,orderprop,active,edit)VALUES (4,"Dimensions",4,0,0);'; 40 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);';41 $q = 'INSERT INTO ' . $prefixeTable . 'add_properties_photos(id_prop_pho,wording,orderprop,active,edit)VALUES (5,"File",5,0,0);'; 42 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);';43 $q = 'INSERT INTO ' . $prefixeTable . 'add_properties_photos(id_prop_pho,wording,orderprop,active,edit)VALUES (6,"Filesize",6,0,0);'; 44 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);';45 $q = 'INSERT INTO ' . $prefixeTable . 'add_properties_photos(id_prop_pho,wording,orderprop,active,edit)VALUES (7,"Tags",7,0,0);'; 46 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);';47 $q = 'INSERT INTO ' . $prefixeTable . 'add_properties_photos(id_prop_pho,wording,orderprop,active,edit)VALUES (8,"Albums",8,0,0);'; 48 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);';49 $q = 'INSERT INTO ' . $prefixeTable . 'add_properties_photos(id_prop_pho,wording,orderprop,active,edit)VALUES (9,"Visits",9,0,0);'; 50 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);';51 $q = 'INSERT INTO ' . $prefixeTable . 'add_properties_photos(id_prop_pho,wording,orderprop,active,edit)VALUES (10,"Average",10,0,0);'; 52 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);';53 $q = 'INSERT INTO ' . $prefixeTable . 'add_properties_photos(id_prop_pho,wording,orderprop,active,edit)VALUES (11,"Who can see this photo?",11,0,0);'; 54 54 pwg_query($q); 55 55 … … 61 61 62 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 } 63 67 64 } 68 65 … … 71 68 72 69 function uninstall(){ 73 conf_delete_param('add_Info_photos'); 74 $q = 'DROP TABLE ' . $prefixeTable . 'add_Info_photos;'; 70 $q = 'DROP TABLE ' . $prefixeTable . 'add_properties_photos;'; 75 71 pwg_query($q); 76 $q = 'DROP TABLE ' . $prefixeTable . 'add_ Info_photos_data;';72 $q = 'DROP TABLE ' . $prefixeTable . 'add_properties_photos_data;'; 77 73 pwg_query($q); 78 74 }
Note: See TracChangeset
for help on using the changeset viewer.