aboutsummaryrefslogtreecommitdiffstats
path: root/admin/include/functions.php
diff options
context:
space:
mode:
authorz0rglub <z0rglub@piwigo.org>2004-08-29 11:21:21 +0000
committerz0rglub <z0rglub@piwigo.org>2004-08-29 11:21:21 +0000
commit38f7bcd8ac94db8c460fe3913bb7d19c81a2e7dc (patch)
treefee40e989372cb4c1f1f32b9ee8126875162ff98 /admin/include/functions.php
parentc414a9133eea12bf5ccfd8e08d5af0a5ff270cf0 (diff)
simplier display of update result :
- number of new categories - number of new elements - number of deleted categories - number of deleted elements - only errors are fully listed git-svn-id: http://piwigo.org/svn/trunk@498 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--admin/include/functions.php15
1 files changed, 12 insertions, 3 deletions
diff --git a/admin/include/functions.php b/admin/include/functions.php
index 203ef37cf..4a38f9b05 100644
--- a/admin/include/functions.php
+++ b/admin/include/functions.php
@@ -192,6 +192,8 @@ DELETE FROM '.SITES_TABLE.'
// The function works recursively.
function delete_categories($ids)
{
+ global $counts;
+
// destruction of all the related elements
$query = '
SELECT id
@@ -251,8 +253,12 @@ DELETE FROM '.CATEGORIES_TABLE.'
WHERE id IN ('.implode(',', $ids).')
;';
mysql_query($query);
+
+ if (isset($counts['del_categories']))
+ {
+ $counts['del_categories']+= count($ids);
+ }
}
-
// The function delete_elements deletes the elements identified by the
// (numeric) values of the array $ids. It also deletes (in the database) :
@@ -261,7 +267,7 @@ DELETE FROM '.CATEGORIES_TABLE.'
// - all the favorites associated to elements
function delete_elements($ids)
{
- global $count_deleted;
+ global $counts;
// destruction of the comments on the image
$query = '
@@ -295,7 +301,10 @@ DELETE FROM '.IMAGES_TABLE.'
;';
mysql_query($query);
- $count_deleted+= count($ids);
+ if (isset($counts['del_elements']))
+ {
+ $counts['del_elements']+= count($ids);
+ }
}
// The delete_user function delete a user identified by the $user_id