You are here

function shoutbox_block in Shoutbox 6.2

Same name and namespace in other branches
  1. 5 shoutbox.module \shoutbox_block()
  2. 6 shoutbox.module \shoutbox_block()

Implementation of hook_block()

File

./shoutbox.module, line 96
Shout box module displays a block for users to create short messages for the whole site. Uses AHAH to update the database and display content.

Code

function shoutbox_block($op = 'list', $delta = 0, $edit = array()) {
  switch ($op) {
    case 'list':
      $blocks[0]['info'] = t('Shout box');
      return $blocks;
      break;
    case 'view':
      switch ($delta) {
        case 0:
          if (user_access('view shouts')) {

            // Prevent block from showing on shout box pages
            if (arg(0) != 'shoutbox') {

              // Load block data
              $block['subject'] = t('Shout box');
              $block['content'] = shoutbox_view(TRUE);
              return $block;
            }
          }
      }
  }
}