Ignore:
Timestamp:
Dec 16, 2012, 3:21:10 PM (11 years ago)
Author:
mistic100
Message:
  • add regex for phot name, author
  • add dimensions filter
  • rewrite javascript algorithms
  • add auto update on timeout (default 3 days)
  • display photos count on plugin albums list
File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/SmartAlbums/include/install.inc.php

    r17716 r19446  
    1111    $smart_default_config = serialize(array(
    1212      'update_on_upload' => false,
     13      'update_on_date' => true,
     14      'update_timeout' => 3,
    1315      'show_list_messages' => true,
    1416      'smart_is_forbidden' => true,
     17      'last_update' => 0,
    1518      ));
    1619   
     
    2528    {
    2629      $new_conf['smart_is_forbidden'] = true;
    27       conf_update_param('SmartAlbums', serialize($new_conf));
    28       $conf['SmartAlbums'] = serialize($new_conf);
    2930    }
     31    // new params in 2.1.0
     32    if (!isset($new_conf['update_on_date']))
     33    {
     34      $new_conf['update_on_date'] = true;
     35      $new_conf['update_timeout'] = 3;
     36      $new_conf['last_update'] = 0;
     37    }
     38    conf_update_param('SmartAlbums', serialize($new_conf));
     39    $conf['SmartAlbums'] = serialize($new_conf);
    3040  }
    3141 
     
    4555  {     
    4656    pwg_query('ALTER TABLE `' . IMAGE_CATEGORY_TABLE . '` ADD `smart` ENUM(\'true\', \'false\') NOT NULL DEFAULT \'false\';');
     57  }
     58 
     59  // new column on category table
     60  $result = pwg_query('SHOW COLUMNS FROM `' . CATEGORIES_TABLE . '` LIKE "smart_update";');
     61  if (!pwg_db_num_rows($result))
     62  {     
     63    pwg_query('ALTER TABLE `' . CATEGORIES_TABLE . '` ADD `smart_update` DATETIME NOT NULL;');
    4764  }
    4865 
     
    6885    foreach ($name_changes as $old => $new)
    6986    {
    70       pwg_query('UPDATE `' . $prefixeTable . 'category_filters` SET cond = "'.$new.'" WHERE cond = "'.$old.'";');
     87      pwg_query('UPDATE `' . $prefixeTable . 'category_filters` SET cond = "'.$new.'" WHERE type = "date" AND cond = "'.$old.'";');
    7188    }
    7289  }
Note: See TracChangeset for help on using the changeset viewer.