You are here

function fb_social_comments_nodeapi in Facebook social plugins integration 6

Implementation of hook_nodeapi().

File

modules/fb_social_comments/fb_social_comments.module, line 83

Code

function fb_social_comments_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
  switch ($op) {
    case 'view':
      if ($node->status && fb_social_comments_type($node->type)) {
        if ($a4) {

          //only in page view
          $output = theme('fb_social_comments_block_comments_view', fb_social_url('node/' . $node->nid));
          $weight = module_exists('content') ? content_extra_field_weight($node->type, 'fb_social_comments_widget') : 20;
          $node->content['fb_social_comments_widget'] = array(
            '#weight' => $weight,
            '#value' => $output,
          );
        }
      }
      break;
  }
}