You are here

function fb_social_send_nodeapi in Facebook social plugins integration 6

Implementation of hook_nodeapi().

File

modules/fb_social_send/fb_social_send.module, line 43

Code

function fb_social_send_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
  switch ($op) {
    case 'view':
      if ($node->status && fb_social_send_type($node->type) && variable_get('fb_social_send_location', 0)) {
        if ($a4 || !$a3 || variable_get('fb_social_send_display_teasers', 1) && $a3) {
          $output = theme('fb_social_send_widget', fb_social_url('node/' . $node->nid));
          $weight = module_exists('content') ? content_extra_field_weight($node->type, 'fb_social_send_widget') : -10;
          $node->content['fb_social_send_widget'] = array(
            '#weight' => $weight,
            '#value' => $output,
          );
        }
      }
      break;
  }
}