You are here

function _flag_lists_unflag in Flag Lists 6

Same name and namespace in other branches
  1. 7.3 flag_lists.module \_flag_lists_unflag()
  2. 7 flag_lists.module \_flag_lists_unflag()

A low-level method to unflag content.

You probably shouldn't call this raw private method: call the flag_lists_do_flag() function instead.

1 call to _flag_lists_unflag()
flag_lists_do_flag in ./flag_lists.module
Flags, or unflags, an item.

File

./flag_lists.module, line 1068
The Flag Lists module.

Code

function _flag_lists_unflag($flag, $content_id, $uid, $sid) {
  $fcid = db_result(db_query("SELECT fcid FROM {flag_lists_content} WHERE fid = %d AND content_id = %d AND uid = %d AND sid = %d", $flag->fid, $content_id, $uid, $sid));
  if ($fcid) {
    db_query("DELETE FROM {flag_lists_content} WHERE fcid = %d", $fcid);
    _flag_lists_update_count($flag, $content_id);
  }
  return $fcid;
}