aboutsummaryrefslogtreecommitdiffstats
path: root/admin/element_set.php
diff options
context:
space:
mode:
authorvdigital <vdigital@piwigo.org>2007-01-02 09:02:39 +0000
committervdigital <vdigital@piwigo.org>2007-01-02 09:02:39 +0000
commit0f2b554608c15cf92e3619dadfff188257f4f8e1 (patch)
treeeb487507bb7c22132e39355cbe04a8011ddd08a9 /admin/element_set.php
parent9c914a2b6659c58b5648fbd05c6fcedb2f2a808e (diff)
Physical duplicate files in Admin Advanced Functions
git-svn-id: http://piwigo.org/svn/trunk@1688 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'admin/element_set.php')
-rw-r--r--admin/element_set.php29
1 files changed, 27 insertions, 2 deletions
diff --git a/admin/element_set.php b/admin/element_set.php
index 583777ae9..530bbd5f5 100644
--- a/admin/element_set.php
+++ b/admin/element_set.php
@@ -137,7 +137,7 @@ SELECT element_id
}
else if ('not_linked' == $_GET['cat'])
{
- $page['title'] = 'elements not linked to any virtual categories';
+ $page['title'] = l10n('Elements_not_linked');
// we are searching elements not linked to any virtual category
$query = '
@@ -162,7 +162,32 @@ SELECT DISTINCT(image_id)
$page['cat_elements_id'] = array_diff($all_elements, $linked_to_virtual);
}
+else if ('duplicates' == $_GET['cat'])
+{
+ $page['title'] = l10n('Duplicates');
+
+ // we are searching related elements twice or more to physical categories
+ // 1 - Retrieve Files
+ $query = '
+SELECT DISTINCT(file)
+ FROM '.IMAGES_TABLE.'
+ GROUP BY file
+HAVING COUNT(DISTINCT storage_category_id) > 1
+;';
+
+ $duplicate_files = array_from_query($query, 'file');
+ $duplicate_files[]='Nofiles';
+ // 2 - Retrives related picture ids
+ $query = '
+SELECT id, file
+ FROM '.IMAGES_TABLE.'
+WHERE file IN (\''.implode("','", $duplicate_files).'\')
+ORDER BY file, id
+;';
+ $page['cat_elements_id'] = array_from_query($query, 'id');
+ $page['cat_elements_id'][] = 0;
+}
// +-----------------------------------------------------------------------+
// | first element to display |
// +-----------------------------------------------------------------------+
@@ -202,4 +227,4 @@ switch ($_GET['mode'])
break;
}
}
-?> \ No newline at end of file
+?>