Index: /extensions/SmartAlbums/admin.php =================================================================== --- /extensions/SmartAlbums/admin.php (revision 11380) +++ /extensions/SmartAlbums/admin.php (revision 11381) @@ -11,5 +11,5 @@ { $conf['SmartAlbums'] = array( - 'update_on_upload' => $_POST['update_on_upload'], + 'update_on_upload' => isset($_POST['update_on_upload']), ); Index: /extensions/SmartAlbums/include/functions.inc.php =================================================================== --- /extensions/SmartAlbums/include/functions.inc.php (revision 11380) +++ /extensions/SmartAlbums/include/functions.inc.php (revision 11381) @@ -30,5 +30,5 @@ } - if (!function_exists('set_rendom_representant')) + if (!function_exists('set_random_representant')) { include(PHPWG_ROOT_PATH.'admin/include/functions.php'); @@ -50,5 +50,5 @@ if (!is_array($conf['SmartAlbums'])) $conf['SmartAlbums'] = unserialize($conf['SmartAlbums']); - if ( defined('SMART_NOT_UPDATE') OR $conf['SmartAlbums']['update_on_upload'] == 'false' ) return; + if ( defined('SMART_NOT_UPDATE') OR !$conf['SmartAlbums']['update_on_upload'] ) return; /* get categories with smart filters */ Index: /extensions/SmartAlbums/maintain.inc.php =================================================================== --- /extensions/SmartAlbums/maintain.inc.php (revision 11380) +++ /extensions/SmartAlbums/maintain.inc.php (revision 11381) @@ -25,5 +25,5 @@ \'SmartAlbums\', \''.serialize(array( - 'update_on_upload' => false, + 'update_on_upload' => true, ) ).'\', @@ -35,8 +35,8 @@ function plugin_activate() -{ - global $conf; +{ + $sa_config = pwg_query('SELECT * FROM `' . CONFIG_TABLE . '` WHERE param = \'SmartAlbums\';'); - if (!isset($conf['SmartAlbums'])) + if (!pwg_db_num_rows($sa_config)) { pwg_query(' @@ -45,5 +45,5 @@ \'SmartAlbums\', \''.serialize(array( - 'update_on_upload' => false, + 'update_on_upload' => true, ) ).'\', Index: /extensions/SmartAlbums/template/admin.tpl =================================================================== --- /extensions/SmartAlbums/template/admin.tpl (revision 11380) +++ /extensions/SmartAlbums/template/admin.tpl (revision 11381) @@ -8,7 +8,8 @@