Changeset 21289


Ignore:
Timestamp:
Mar 6, 2013, 5:45:33 PM (12 years ago)
Author:
plg
Message:

bug fixed: table creation crashed with mysqli

specific code for pgsql/sqlite removed

replace $conflocal_data_dir by $confdata_location (introduced in Piwigo 2.4)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/community/maintain.inc.php

    r12358 r21289  
    1010  global $conf, $prefixeTable;
    1111
    12   if ('mysql' == $conf['dblayer'])
    13   {
    14     $query = '
     12  $query = '
    1513CREATE TABLE '.$prefixeTable.'community_permissions (
    1614  id int(11) NOT NULL AUTO_INCREMENT,
     
    2523) ENGINE=MyISAM DEFAULT CHARACTER SET utf8
    2624;';
    27     pwg_query($query);
    28 
    29     $query = '
     25  pwg_query($query);
     26
     27  $query = '
    3028CREATE TABLE '.$prefixeTable.'community_pendings (
    3129  image_id mediumint(8) unsigned NOT NULL,
     
    3533) ENGINE=MyISAM DEFAULT CHARACTER SET utf8
    3634;';
    37     pwg_query($query);
    38   }
    39   elseif ('pgsql' == $conf['dblayer'])
    40   {
    41     $query = '
    42 CREATE TABLE "'.$prefixeTable.'community_permissions" (
    43   "id" serial NOT NULL,
    44   "type" VARCHAR(255) NOT NULL,
    45   "group_id" INTEGER,
    46   "user_id" INTEGER,
    47   "category_id" INTEGER,
    48   "recursive" BOOLEAN default true,
    49   "create_subcategories" BOOLEAN default false,
    50   "moderated" BOOLEAN default true,
    51   PRIMARY KEY ("id")
    52 )
    53 ;';
    54     pwg_query($query);
    55 
    56     $query = '
    57 CREATE TABLE "'.$prefixeTable.'community_pendings" (
    58   image_id INTEGER NOT NULL,
    59   state VARCHAR(255) NOT NULL,
    60   added_on TIMESTAMP NOT NULL,
    61   validated_by INTEGER
    62 )
    63 ;';
    64     pwg_query($query);
    65   }
    66   else
    67   {
    68     $query = '
    69 CREATE TABLE "'.$prefixeTable.'community_permissions" (
    70   "id" INTEGER NOT NULL,
    71   "type" VARCHAR(255) NOT NULL,
    72   "group_id" INTEGER,
    73   "user_id" INTEGER,
    74   "category_id" INTEGER,
    75   "recursive" BOOLEAN default true,
    76   "create_subcategories" BOOLEAN default false,
    77   "moderated" BOOLEAN default true,
    78   PRIMARY KEY ("id")
    79 )
    80 ;';
    81     pwg_query($query);
    82 
    83     $query = '
    84 CREATE TABLE "'.$prefixeTable.'community_pendings" (
    85   image_id INTEGER NOT NULL,
    86   state VARCHAR(255) NOT NULL,
    87   added_on TIMESTAMP NOT NULL,
    88   validated_by INTEGER
    89 )
    90 ;';
    91     pwg_query($query);
    92   }
     35  pwg_query($query);
    9336}
    9437
     
    14790  global $conf, $prefixeTable;
    14891 
    149   $from_piwigo21_file = $conf['local_data_dir'].'/plugins/core_user_upload_to_community.php';
     92  $from_piwigo21_file = $conf['data_location'].'/plugins/core_user_upload_to_community.php';
    15093  if (is_file($from_piwigo21_file))
    15194  {
Note: See TracChangeset for help on using the changeset viewer.