You are here

function flag_node::applies_to_content_id_array in Flag 6

Same name and namespace in other branches
  1. 5 flag.inc \flag_node::applies_to_content_id_array()

File

./flag.inc, line 971
Implements various flags. Uses object oriented style inspired by that of Views 2.

Class

flag_node
Implements a node flag.

Code

function applies_to_content_id_array($content_ids) {
  $passed = array();
  $content_ids = implode(',', array_map('intval', $content_ids));
  $placeholders = implode(',', array_fill(0, sizeof($this->types), "'%s'"));
  $result = db_query("SELECT nid FROM {node} WHERE nid IN ({$content_ids}) AND type in ({$placeholders})", $this->types);
  while ($row = db_fetch_object($result)) {
    $passed[$row->nid] = TRUE;
  }
  return $passed;
}