Ignore:
Timestamp:
Nov 4, 2012, 3:59:38 PM (11 years ago)
Author:
mistic100
Message:

update with Piwigo 2.5 features (website url, email, mandatory email and username)

File:
1 edited

Legend:

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

    r15995 r18927  
    22if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
    33
     4defined('COA_ID') or define('COA_ID', basename(dirname(__FILE__)));
     5include_once(PHPWG_PLUGINS_PATH . COA_ID . '/include/install.inc.php');
     6
    47function plugin_install()
    58{
    6   global $prefixeTable;
    7 
    8   pwg_query("
    9 CREATE TABLE `" . $prefixeTable . "comments_categories` (
    10   `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
    11   `category_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
    12   `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
    13   `author` varchar(255) DEFAULT NULL,
    14   `author_id` smallint(5) DEFAULT NULL,
    15   `anonymous_id` varchar(45) NOT NULL,
    16   `content` longtext,
    17   `validated` enum('true','false') NOT NULL DEFAULT 'false',
    18   `validation_date` datetime DEFAULT NULL,
    19   PRIMARY KEY (`id`)
    20 ) DEFAULT CHARSET=utf8
    21 ;");
     9  coa_install();
     10  define('coa_installed', true);
    2211}
    2312
    2413function plugin_activate()
    2514{
    26   global $conf, $prefixeTable;
    27  
    28   if (isset($conf['comments_on_albums']))
     15  if (!defined('coa_installed'))
    2916  {
    30     pwg_query('DELETE FROM '.CONFIG_TABLE.' WHERE param="comments_on_albums" LIMIT 1;');
    31   }
    32  
    33   $query = 'SHOW COLUMNS FROM `' . $prefixeTable . 'comments_categories`;';
    34   $columns = hash_from_query($query, 'Field');
    35   if (!isset($columns['anonymous_id']))
    36   {
    37     pwg_query('ALTER TABLE `' . $prefixeTable . 'comments_categories` ADD `anonymous_id` VARCHAR( 45 ) DEFAULT NULL;');
     17    coa_install();
    3818  }
    3919}
     
    4323  global $prefixeTable;
    4424
    45   pwg_query("DROP TABLE `" . $prefixeTable . "comments_categories`;");
     25  pwg_query('DROP TABLE `' . $prefixeTable . 'comments_categories`;');
    4626}
     27
    4728?>
Note: See TracChangeset for help on using the changeset viewer.