Changeset 21658 for extensions/SmartAlbums
- Timestamp:
- Mar 17, 2013, 8:32:17 PM (11 years ago)
- Location:
- extensions/SmartAlbums
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/SmartAlbums/admin/cat_list.php
r21358 r21658 21 21 permalink, 22 22 dir, 23 smart_update23 cf.updated 24 24 FROM '.CATEGORIES_TABLE.' AS cat 25 25 INNER JOIN '.CATEGORY_FILTERS_TABLE.' AS cf 26 26 ON cf.category_id = cat.id 27 GROUP BY id 27 28 ORDER BY global_rank ASC 28 29 ;'; … … 146 147 'ID' => $category['id'], 147 148 'IMG_COUNT' => !empty($categories_count_images[ $category['id'] ]) ? $categories_count_images[ $category['id'] ] : 0, 148 'LAST_UPDATE' => format_date($category[' smart_update'], true),149 'LAST_UPDATE' => format_date($category['updated'], true), 149 150 150 151 'U_JUMPTO' => make_index_url(array('category' => $category)), -
extensions/SmartAlbums/include/functions.inc.php
r19722 r21658 52 52 53 53 $query = ' 54 UPDATE '.CATEGOR IES_TABLE.'55 SET smart_update= NOW()56 WHERE id = '.$cat_id.'54 UPDATE '.CATEGORY_FILTERS_TABLE.' 55 SET updated = NOW() 56 WHERE category_id = '.$cat_id.' 57 57 ;'; 58 58 pwg_query($query); … … 689 689 INNER JOIN '.CATEGORY_FILTERS_TABLE.' AS cf 690 690 ON c.id = cf.category_id 691 WHERE smart_update< DATE_SUB(NOW(), INTERVAL '.$conf['SmartAlbums']['update_timeout'].' DAY)691 WHERE updated < DATE_SUB(NOW(), INTERVAL '.$conf['SmartAlbums']['update_timeout'].' DAY) 692 692 ;'; 693 693 -
extensions/SmartAlbums/include/install.inc.php
r21358 r21658 46 46 `type` varchar(16) NOT NULL, 47 47 `cond` varchar(16) NULL, 48 `value` text 48 `value` text NULL, 49 `updated` DATETIME NOT NULL DEFAULT "1970-01-01 00:00:00" 49 50 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 50 51 ;'); … … 57 58 } 58 59 59 // new column on categorytable60 // remove column on category table, moved to category filters table 60 61 $result = pwg_query('SHOW COLUMNS FROM `' . CATEGORIES_TABLE . '` LIKE "smart_update";'); 62 if (pwg_db_num_rows($result)) 63 { 64 pwg_query('UPDATE `' . $prefixeTable . 'category_filters` AS f SET updated = ( SELECT smart_update FROM `' . CATEGORIES_TABLE . '` AS c WHERE c.id = f.category_id );'); 65 pwg_query('ALTER TABLE `' . CATEGORIES_TABLE . '` DROP `smart_update`;'); 66 } 67 68 // new column on category filters table 69 $result = pwg_query('SHOW COLUMNS FROM `' . $prefixeTable . 'category_filters` LIKE "updated";'); 61 70 if (!pwg_db_num_rows($result)) 62 71 { 63 pwg_query('ALTER TABLE `' . CATEGORIES_TABLE . '` ADD `smart_update` DATETIME NOT NULL;');72 pwg_query('ALTER TABLE `' . $prefixeTable . 'category_filters` ADD `updated` DATETIME NOT NULL DEFAULT "1970-01-01 00:00:00"'); 64 73 } 65 74 -
extensions/SmartAlbums/maintain.inc.php
r19446 r21658 24 24 pwg_query('DROP TABLE `' . $prefixeTable . 'category_filters`;'); 25 25 pwg_query('ALTER TABLE `' . IMAGE_CATEGORY_TABLE . '` DROP `smart`;'); 26 pwg_query('ALTER TABLE `' . CATEGORIES_TABLE . '` DROP `smart_update`;');27 26 pwg_query('DELETE FROM `' . CONFIG_TABLE . '` WHERE param = \'SmartAlbums\' LIMIT 1;'); 28 27 }
Note: See TracChangeset
for help on using the changeset viewer.