首页 / 帖子
drupal 7 statistics模块

开启了statistics模块,也设置了,如图:

但是我在node.tpl.php中用下列代码输出:

<?php $statistics= statistics_get($node->nid); print $statistics['totalcount'];?>

什么都没有。

我启用了pathauto模块,url设置为x.com/1.html这种格式。

请先不要告诉我用views,views太强大,我目前不会。


1个答案
YOYO
发布于:2014-05-19 20:49

没有记错得话statistics模块默认会有输出的。

通过hook_links的输出,也就是node最底下默认会有一个统计访问。所以你不用自己输出。

如果没有的话你可以看看其他的模块,因为你的对views不熟悉,所以还有一些模块会简单的设置一下就能输出统计。(想当年我也是这么做得)

比如 better_statistics: https://drupal.org/project/better_statistics