You are here

function _ddblock_get_content_array in Dynamic display block 6

Same name and namespace in other branches
  1. 7 ddblock.module \_ddblock_get_content_array()

Get content from a content type for the dynamic display block.

Parameters

$content_type: Content type to get the content from.

$nodes: The nodes to return.

Return value

An array containing the teaser of nodes for the dynamic display block

1 call to _ddblock_get_content_array()
ddblock_content in ./ddblock.module
Get contents of dynamic display block block.

File

./ddblock.module, line 2131
Enables your site to display dynamic content in a block.

Code

function _ddblock_get_content_array($content_type, $nodes, $node_body_teaser) {
  $sql = "SELECT nid " . "FROM {node} " . "WHERE status = 1 " . "AND type = '%s' " . "AND nid = '%s' ";
  $results = db_query($sql, $content_type, $nodes);
  $selected_nodes = array();
  $show_teaser = $node_body_teaser == 'teaser' ? TRUE : FALSE;
  $i = 0;
  while ($obj = db_fetch_object($results)) {
    $node = node_load($obj->nid);

    // show an HTML representation of the themed node teaser.by setting the third parameter to false and dont show links by seting the fourth parameter to FALSE.
    $selected_nodes[$i] = node_view($node, $show_teaser, FALSE, FALSE);
    $i++;
  }
  return $selected_nodes;
}