You are here

function statistics_advanced_link_alter in Statistics Advanced 6

Implementation of hook_link_alter().

Removes the node views counter for certain node types.

File

./statistics_advanced.module, line 46
Adds advanced settings and features for the core Statistics module.

Code

function statistics_advanced_link_alter(&$links, $node) {

  // @todo Remove when http://drupal.org/node/321295 is fixed.
  if (_statistics_advanced_check_link_alter($links, $node)) {
    return;
  }
  if (isset($links['statistics_counter'])) {
    $counter_node_types = statistics_advanced_var('counter_node_types');
    if (isset($counter_node_types[$node->type]) && !$counter_node_types[$node->type]) {
      unset($links['statistics_counter']);
    }
  }
}