From 1d059dc06d24e02c858c43d70eaa70453d51cdff Mon Sep 17 00:00:00 2001 From: mensonge Date: Thu, 11 Sep 2008 16:51:00 +0000 Subject: New Feature: add users admin page with delete function git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@146 b3834d28-1941-0410-a4f8-b48e95affb8f --- services/bookmark2tagservice.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'services/bookmark2tagservice.php') diff --git a/services/bookmark2tagservice.php b/services/bookmark2tagservice.php index 121ba8d..31ae4d2 100644 --- a/services/bookmark2tagservice.php +++ b/services/bookmark2tagservice.php @@ -179,6 +179,26 @@ class Bookmark2TagService { return true; } + /* Allow deletion in admin page */ + function deleteTagsForUser($uId) { + $qmask = 'DELETE FROM %s USING %s, %s WHERE %s.bId = %s.bId AND %s.uId = %d'; + $query = sprintf($qmask, + $this->getTableName(), + $this->getTableName(), + $GLOBALS['tableprefix'].'bookmarks', + $this->getTableName(), + $GLOBALS['tableprefix'].'bookmarks', + $GLOBALS['tableprefix'].'bookmarks', + $uId); + + if (!($dbresult =& $this->db->sql_query($query))) { + message_die(GENERAL_ERROR, 'Could not delete tags', '', __LINE__, __FILE__, $query, $this->db); + return false; + } + + return true; + } + function &getTagsForBookmark($bookmarkid) { if (!is_int($bookmarkid)) { message_die(GENERAL_ERROR, 'Could not get tags (invalid bookmarkid)', '', __LINE__, __FILE__, $query); -- cgit v1.2.3