1

I must use Drupal 5.10 for one project. It's already done, but I am doing some changes, so I must add this line to each node:

Viewed: 3 | Total views: 30

I know I must use the Statistics module, but I cannot find one for Drupal 5. Can anyone help me please?

  • Drupal 5 is SO far out of support now you're not likely to turn much up. However, it does look like statistics.module was in core back then, so you might be able to find some deprecated documentation. – Chapabu Mar 7 '13 at 14:42
4

A quick search turned up this video from DrupalDude: Statistics module in Drupal 5

There's also the documentation for the module for the D5 version on Drupal.org that suggests you should be able to use statistics_get() to get the views for a certain node.

Something like the following would do it:

$stats = statistics_get($nid);

// Total view count
print $stats['totalcount'];
// Current day view count    
print $stats['daycount'];
// Timestamp of last view
print $stats['timestamp'];

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy