aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrub <rub@piwigo.org>2007-04-14 12:34:44 +0000
committerrub <rub@piwigo.org>2007-04-14 12:34:44 +0000
commit8a97ff299e36b1b9a8b555ca91c6e040abd58010 (patch)
treef5dfa3acd0339ea933427062b02e1eb2a8a6c622
parent1d02741910e961986c67216f98b97fce1c315312 (diff)
Merge BSF 1956:1958 into branch-1_7
Small improvement: Random selection of pictures on notifications. Caddie: Fix issue when the are not pictures attached to disassociated categories git-svn-id: http://piwigo.org/svn/branches/branch-1_7@1959 68402e56-0260-453c-a942-63ccdbb3a9ee
-rw-r--r--admin/element_set_global.php3
-rw-r--r--include/functions_notification.inc.php1
2 files changed, 4 insertions, 0 deletions
diff --git a/admin/element_set_global.php b/admin/element_set_global.php
index ad1ff8135..568a37efb 100644
--- a/admin/element_set_global.php
+++ b/admin/element_set_global.php
@@ -114,6 +114,8 @@ SELECT id
;';
$dissociables = array_from_query($query, 'id');
+ if (!empty($dissociables))
+ {
$query = '
DELETE
FROM '.IMAGE_CATEGORY_TABLE.'
@@ -121,6 +123,7 @@ DELETE
AND image_id IN ('.implode(',', $dissociables).')
';
pwg_query($query);
+ }
update_category($_POST['dissociate']);
}
diff --git a/include/functions_notification.inc.php b/include/functions_notification.inc.php
index c744e046b..5462f43e2 100644
--- a/include/functions_notification.inc.php
+++ b/include/functions_notification.inc.php
@@ -478,6 +478,7 @@ SELECT DISTINCT id, path, name, tn_ext, file
'.$where_sql.'
AND date_available="'.$dates[$i]['date_available'].'"
AND tn_ext IS NOT NULL
+ ORDER BY RAND(NOW())
LIMIT 0,'.$max_elements.'
;';
$dates[$i]['elements'] = array();