You are here

function _advpoll_available_blocks in Advanced Poll 6.3

Retrieve available blocks for block list

1 call to _advpoll_available_blocks()
advpoll_block in ./advpoll.module
Implementation of hook_block().

File

./advpoll.module, line 282
Advanced Poll - a sophisticated polling module for voting, elections, and group decision-making.

Code

function _advpoll_available_blocks() {
  $timestamp = time();
  $result = db_query('SELECT n.nid, n.title FROM {node} n INNER JOIN {advpoll} p ON p.nid = n.nid WHERE n.status = 1
                        AND p.create_view_block = 1 AND p.start_date < %d
                        AND p.end_date > %d', $timestamp, $timestamp);
  $results = array();
  while ($node = db_fetch_object($result)) {
    $results[] = $node;
  }
  return $results;
}