Same name and namespace in other branches
  1. 4.6.x modules/statistics.module \statistics_link()
  2. 4.7.x modules/statistics.module \statistics_link()
  3. 5.x modules/statistics/statistics.module \statistics_link()

Implementation of hook_link().

File

modules/statistics/statistics.module, line 77
Logs access statistics for your site.

Code

function statistics_link($type, $node = NULL, $teaser = FALSE) {
  global $id;
  $links = array();
  if ($type == 'node' && user_access('view post access counter')) {
    $statistics = statistics_get($node->nid);
    if ($statistics) {
      $links['statistics_counter']['title'] = format_plural($statistics['totalcount'], '1 read', '@count reads');
    }
  }
  return $links;
}