feature 1078 added: ability to merge tags

git-svn-id: http://piwigo.org/svn/trunk@12032 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
plegall
2011-09-02 08:37:21 +00:00
parent 88951a7946
commit bd7f8c0ba2
6 changed files with 197 additions and 16 deletions

View File

@@ -1394,6 +1394,36 @@ DELETE
);
}
/**
*
*/
function delete_tags($tag_ids)
{
if (is_numeric($tag_ids))
{
$tag_ids = array($tag_ids);
}
if (!is_array($tag_ids))
{
return false;
}
$query = '
DELETE
FROM '.IMAGE_TAG_TABLE.'
WHERE tag_id IN ('.implode(',', $tag_ids).')
;';
pwg_query($query);
$query = '
DELETE
FROM '.TAGS_TABLE.'
WHERE id IN ('.implode(',', $tag_ids).')
;';
pwg_query($query);
}
function tag_id_from_tag_name($tag_name)
{
global $page;