You are here

function similarterms_handler_argument_node_nid::title_query in Similar By Terms 6.2

Same name and namespace in other branches
  1. 7.2 views/similarterms_handler_argument_node_nid.inc \similarterms_handler_argument_node_nid::title_query()

Override the behavior of title(). Get the title of the node.

File

views/similarterms_handler_argument_node_nid.inc, line 17
Provide node nid argument handler.

Class

similarterms_handler_argument_node_nid
Argument handler to accept a node id. based on node_handler_argument_node_nid except that it doesn't add a where clause to the query

Code

function title_query() {
  $titles = array();
  $placeholders = implode(', ', array_fill(0, sizeof($this->value), '%d'));
  $result = db_query("SELECT n.title FROM {node} n WHERE n.nid IN ({$placeholders})", $this->value);
  while ($term = db_fetch_object($result)) {
    $titles[] = check_plain($term->title);
  }
  return $titles;
}