You are here

function mostpopular_blocks_local in Drupal Most Popular 7

3 calls to mostpopular_blocks_local()
mostpopular_intervals_admin_form in ./mostpopular.intervals.inc
mostpopular_refresh in ./mostpopular.module
Refreshes data from each service by invoking the refresh callback for each service.
mostpopular_services_admin_form in ./mostpopular.services.inc
Renders a form for configuring the blocks and services.

File

./mostpopular.module, line 702
The main file for the Most Popular module.

Code

function mostpopular_blocks_local() {
  $blocks =& drupal_static(__FUNCTION__);
  if (!isset($blocks)) {
    $blocks = db_select('mostpopular_block', 'b')
      ->fields('b')
      ->condition('remote_bid', NULL)
      ->execute()
      ->fetchAllAssoc('bid');
    foreach ($blocks as $b => $block) {
      $blocks[$b]->data = unserialize($block->data);
      if (!$blocks[$b]->data) {
        $blocks[$b]->data = array();
      }
    }
  }
  return $blocks;
}