You are here

function fb_social_share_nodeapi in Facebook social plugins integration 6

Implementation of hook_nodeapi().

File

modules/fb_social_share/fb_social_share.module, line 77

Code

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