You are here

function addtoany_nodeapi in AddToAny Share Buttons 6.3

Same name and namespace in other branches
  1. 6.2 addtoany.module \addtoany_nodeapi()

Implementation of hook_nodeapi().

Parameters

object $node:

object $op:

object $a3 [optional]:

object $a4 [optional]:

File

./addtoany.module, line 73
Standalone module file to handle AddToAny button integration

Code

function addtoany_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
  switch ($op) {
    case 'view':

      // Only show comments on the full non-teasered page
      if (!$a3 && $a4) {
        $types = variable_get('addtoany_nodetypes', array());
        $show = !empty($types[$node->type]) && variable_get('addtoany_display_in_nodecont', '0');
        $weight = variable_get('addtoany_display_weight', 40);
        if ($show) {
          $node->content['addtoany'] = array(
            '#value' => _addtoany_create_button($node, FALSE),
            '#weight' => $weight,
          );
        }
      }
      break;
  }
}