mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-07-21 00:53:04 +02:00
fix #357 make orphans photos more obvious
... and easy to delete them all in one click. The orpans, if any, is shown as an entry in the "Photos" menu (link on Batch Manager). In the Batch Manager, new action "delete_orphans" next to prefilter.
This commit is contained in:
@@ -2775,4 +2775,22 @@ SELECT CONCAT(
|
||||
}
|
||||
|
||||
return $keys;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the list of image ids associated to no album
|
||||
*
|
||||
* @return int[] $image_ids
|
||||
*/
|
||||
function get_orphans()
|
||||
{
|
||||
$query = '
|
||||
SELECT
|
||||
id
|
||||
FROM '.IMAGES_TABLE.'
|
||||
LEFT JOIN '.IMAGE_CATEGORY_TABLE.' ON id = image_id
|
||||
WHERE category_id is null
|
||||
;';
|
||||
|
||||
return query2array($query, null, 'id');
|
||||
}
|
||||
Reference in New Issue
Block a user