Hi all,
I'm developing a little code to put into a computed field.

I need to obtain two values but I don't know the sintax to take it from the system.

Tha values I need are:

- the number of visits of the node (from statistics module)
- I'm using userpoint, so I need the number of points of the user that created that node

Someone can give me the snippets, please?

Thank you

Comments

AtomicTangerine’s picture

a computed field is calculated upon node save, not node view, so you might want to look into some kind of hack with hook_node_view() or something like that, making a value there to count how many views it has. There's probably also a module out there somewhere that counts number of views of a node, seems like a fairly common and reasonable thing to want. Try using Google, and include "Drupal" and "count" and such :)

Also, for future snippets, try browsing around here: http://drupal.org/node/126522

:)