You are here

function fb_social_comments_block in Facebook social plugins integration 6

Implementation of hook_block

File

modules/fb_social_comments/fb_social_comments.module, line 40

Code

function fb_social_comments_block($op = 'list', $delta = 0, $edit = array()) {
  switch ($op) {
    case 'list':
      $blocks['comments'] = array(
        'info' => t('fb comments'),
      );
      return $blocks;
    case 'view':
      switch ($delta) {
        case 'comments':

          // show the block comment only for nodes
          $node = menu_get_object();
          if (is_object($node) && $node->status && $node->nid && arg(2) != "edit") {
            return array(
              'subject' => t(''),
              'content' => theme('fb_social_comments_block_comments_view', fb_social_url('node/' . $node->nid)),
            );
          }
      }
      break;
  }
}