You are here

function newsletter_node_view in Newsletter 7

Implements hook_node_view().

File

./newsletter.module, line 561
Defines menu items for newsletter administration, permissions and basic drupal hooks.

Code

function newsletter_node_view($node, $view_mode, $langcode) {

  // Only add once, since this hook may run many times in a request
  static $i;
  if (isset($_GET['source']) && $_GET['source'] == 'newsletter' && !$i) {
    db_query("UPDATE {newsletter_newsletter}\n      SET clicks = clicks + 1\n      WHERE nnid = :id", array(
      ':id' => $_GET['nnid'],
    ));
    $i++;
  }
}