You are here

function print_epub_block_view in Printer, email and PDF versions 7.2

Implements hook_block_view().

File

print_epub/print_epub.module, line 105
Displays Printer-friendly versions of Drupal pages.

Code

function print_epub_block_view($delta = 0) {
  $block = array();
  switch ($delta) {
    case 'print_epub-top':
      $block['subject'] = t('Most EPUBd');
      $result = db_query_range("SELECT path FROM {print_epub_page_counter} LEFT JOIN {node} n ON path = CONCAT('node/', n.nid) WHERE status <> 0 OR status IS NULL ORDER BY totalcount DESC", 0, 3)
        ->fetchAll();
      if (count($result)) {
        $items = array();
        foreach ($result as $obj) {
          $items[] = l(_print_get_title($obj->path), $obj->path);
        }
        $block['content'] = theme('item_list', array(
          'items' => $items,
          'type' => 'ul',
        ));
      }
      break;
  }
  return $block;
}