You are here

function img_assist_get_references in Image Assist 6.2

Same name and namespace in other branches
  1. 5.3 img_assist.module \img_assist_get_references()
  2. 5 img_assist.module \img_assist_get_references()
  3. 5.2 img_assist.module \img_assist_get_references()
  4. 6 img_assist.module \img_assist_get_references()

Return a list of node links for a given nid.

Related topics

1 call to img_assist_get_references()
img_assist_block in ./img_assist.module
Implementation of hook_block().

File

./img_assist.module, line 1642
Image Assist module

Code

function img_assist_get_references($nid, $limit = 10) {
  $and_clause = array();
  $images = img_assist_map_load($nid);
  foreach ($images as $id) {
    $and_clause[] = 'n.nid = ' . $id;
  }
  $and_clause = implode(' OR ', $and_clause);
  if ($images) {
    return node_title_list(db_query_range(db_rewrite_sql("SELECT n.nid, n.title FROM {node} n WHERE n.status = 1 AND ({$and_clause}) ORDER BY n.nid DESC"), 0, (int) $limit));
  }
}