Ignore:
Timestamp:
Jun 24, 2012, 1:49:50 PM (12 years ago)
Author:
mistic100
Message:

improve anti-spam system (Piwigo 2.5 feature)

File:
1 edited

Legend:

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

    r14528 r15995  
    1313  `author` varchar(255) DEFAULT NULL,
    1414  `author_id` smallint(5) DEFAULT NULL,
     15  `anonymous_id` varchar(45) NOT NULL,
    1516  `content` longtext,
    1617  `validated` enum('true','false') NOT NULL DEFAULT 'false',
     
    2324function plugin_activate()
    2425{
    25   global $conf;
     26  global $conf, $prefixeTable;
    2627 
    2728  if (isset($conf['comments_on_albums']))
    2829  {
    2930    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;');
    3038  }
    3139}
Note: See TracChangeset for help on using the changeset viewer.