Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By SomebodySysop on
I'm creatng my own node-flexinode-n.tpl.php template to display page and teaser views for flexinode nodes as described here: http://drupal.org/node/45485
I'm successful at creating the page and teaser views. However, I can't seem to get the number of reads (page views count) for the flexinode nodes.
This code does not retrieve the '%count" reads as it should:
$statistics = statistics_get($node->nid);
if ($statistics) {
$reads = 0;
} else {
$reads = $statistics['totalcount'];
}
Can someone help me out here? Thanks.
-ron
Comments
Figured it out
My logic was backwards. Corrected code works as it should: