added tagging the search results

This commit is contained in:
SJ
2012-03-10 14:52:50 +01:00
parent ee9c2af1b2
commit 99848614e8
13 changed files with 163 additions and 16 deletions

View File

@ -415,6 +415,18 @@ class ModelSearchMessage extends Model {
}
public function bulk_add_message_tag($ids = array(), $uid = 0, $tag = '', $q = '') {
$arr = array_merge(array($uid), $ids);
$query = $this->db->query("DELETE FROM " . TABLE_TAG . " WHERE uid=? AND id IN ($q)", $arr);
if($tag) {
foreach ($ids as $id) {
$query = $this->db->query("INSERT INTO " . TABLE_TAG . " (id, uid, tag) VALUES(?,?,?)", array($id, $uid, $tag));
}
}
}
}
?>