aboutsummaryrefslogtreecommitdiffstats
path: root/admin/include
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2011-09-02 08:37:21 +0000
committerplegall <plg@piwigo.org>2011-09-02 08:37:21 +0000
commitbd7f8c0ba2e5686c25152de220f645dc39a72ccd (patch)
tree7acc068fba5b32172a2bb0c7468f44aeea8da76c /admin/include
parent88951a79468fefe8504b79c7a43981bf381cbdf8 (diff)
feature 1078 added: ability to merge tags
git-svn-id: http://piwigo.org/svn/trunk@12032 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--admin/include/functions.php30
1 files changed, 30 insertions, 0 deletions
diff --git a/admin/include/functions.php b/admin/include/functions.php
index f5498ac8b..1d229eea3 100644
--- a/admin/include/functions.php
+++ b/admin/include/functions.php
@@ -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;