You are here

function adsense_nodeapi in Google AdSense integration 5

Same name and namespace in other branches
  1. 5.3 adsense.module \adsense_nodeapi()
  2. 5.2 adsense.module \adsense_nodeapi()

Implemenation of hook_nodeapi().

File

./adsense.module, line 1469

Code

function adsense_nodeapi(&$node, $op = 'view', $teaser, $page) {
  switch ($op) {
    case 'view':
      if (variable_get(ADSENSE_SECTION_TARGETING, 1)) {
        $node->content['adsense_start'] = array(
          '#value' => ADSENSE_SECTION_START,
          '#weight' => -1,
        );
        $node->content['adsense_end'] = array(
          '#value' => ADSENSE_SECTION_END,
          '#weight' => 1,
        );
      }
      if ($page) {
        adsense_get_client_id();
      }
      else {
        if ($uid = _adsense_check_blog()) {
          adsense_get_client_id();
        }
      }
  }
}