Ignore:
Timestamp:
Dec 6, 2014, 8:32:09 AM (10 years ago)
Author:
ddtddt
Message:

[extensions] - manage_properties_photos -beta 4

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/manage_properties_photos/maintain.class.php

    r30676 r30702  
    22defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
    33
    4 class manage_info_photos_maintain extends PluginMaintain
     4class manage_properties_photos_maintain extends PluginMaintain
    55{
    66  private $installed = false;
     
    1313       global $prefixeTable;
    1414
    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 ,
     15if (!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 ." (
     17id_prop_pho SMALLINT(5) UNSIGNED NOT NULL auto_increment,
     18wording VARCHAR(255) NOT NULL ,
     19orderprop SMALLINT(5) UNSIGNED NOT NULL ,
    2020active SMALLINT(5) UNSIGNED NOT NULL ,
    2121edit SMALLINT(5) UNSIGNED NOT NULL ,
    22 PRIMARY KEY (id_info_pho))DEFAULT CHARSET=utf8;";
     22PRIMARY KEY (id_prop_pho))DEFAULT CHARSET=utf8;";
    2323        $result = pwg_query($query);
    2424
    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 ." (
     25if (!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 ." (
    2727id_img SMALLINT(5) UNSIGNED NOT NULL ,
    28 id_info_pho SMALLINT(5) UNSIGNED NOT NULL ,
     28id_prop_pho SMALLINT(5) UNSIGNED NOT NULL ,
    2929data VARCHAR(255) NOT NULL ,
    30 PRIMARY KEY (id_img,id_info_pho))DEFAULT CHARSET=utf8;";
     30PRIMARY KEY (id_img,id_prop_pho))DEFAULT CHARSET=utf8;";
    3131        $result = pwg_query($query);
    3232       
    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);';
    3434    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);';
    3636    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);';
    3838    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);';
    4040    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);';
    4242    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);';
    4444    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);';
    4646    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);';
    4848    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);';
    5050    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);';
    5252    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);';
    5454    pwg_query($q);
    5555   
     
    6161
    6262  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
    6764  }
    6865 
     
    7168
    7269  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;';
    7571    pwg_query($q);
    76     $q = 'DROP TABLE ' . $prefixeTable . 'add_Info_photos_data;';
     72    $q = 'DROP TABLE ' . $prefixeTable . 'add_properties_photos_data;';
    7773    pwg_query($q);
    7874  }
Note: See TracChangeset for help on using the changeset viewer.