Drupal just stores the day count and the total count. Is there a way to give a week count to the node?

ps: i want to show a node title list.the sort creteria is decending the most viewsd in a week. by defaule Drupal just stores the day count and the total count. there is no week count.

could i use this: i add a node created time in a sql query which where clause is less than time()-24*7 like this where node time created < time()-24*7)then i use the total node count. then descending the result. the node title show will be the same as the week count. am i right? if right, how to put the sql query to views sort creteria .

  • If you have the total number of times the node has been viewed in a day, you can calculate the total number the node has been visited in a week. This question is too generic; you should ask a more specific question if there is something more specific you don't understand. Differently, the question is not Drupal-related.
    – apaderno
    May 19, 2011 at 2:04
  • The "node_counter" table is not used, in Drupal 7; if the code you are writing will be ported to Drupal 7, you should consider this.
    – apaderno
    May 19, 2011 at 2:06

2 Answers 2


You can use this not so well maintained module Statistics Granularity or learn how to do it yourself with this blog post: Advanced statistics for Drupal: most viewed nodes in a week, month, ...


In case you are using views3, you can use the GROUP BY functions and do it via SQL. Alternatively there is a seperate module for views2.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.