Posted by escore on September 23, 2010 at 10:05pm
I'm looking for a way to keep track of how many times data from a node has been displayed in a view and I suspect the Rules module i sthe way to go. However, I can't find any reference as to how one would do it. Is there a way to hook into the rendering of a view and have Rules update a cck integer field in the displayed node(s)?
I've looked a the Rules and Views Integration module but can't see how it would help me. Documentation is, hrm, sparse. My view already uses a views display plugin (Views accordion), so a display based solution seems awkward.

Comments
What You Need
Hello escore!
I had this same need and ended up paying a programmer to build a module to accomplish it. See http://drupal.org/node/892636
If it's not exactly what you need, maybe you can modify it to do what you want. I'm using 6.x
HTH.
Full nodes or not?
If you're displaying full nodes in the view, it is possible that the core Statistics module will do the trick. (It might even work if you display teasers.) However, if you're displaying fields it won't work.
There are theoretical possibilities to have Rules (or just a custom action) increase a variable on each node when they are listed in Views. The method I would suggest is either to use a extremely specific field template file and include an increment code snippet in it (ugly version), or to code up some kind of new field type or field render style that -- when it is used -- increases its own value by one (prettier version).
HOWEVER, I would highly suggest rethinking the approach. If you want to update a CCK field you will have to carry out node saves for each node displayed. If your view contains 25 nodes, that will be a pretty hefty load on your server. Multiply that by ten visitors that loads the same view at the same time and you can expect to run out of memory (or in any case get very bad response time).
Doing statistics is not an easy thing, since it requires rapid writing of a lot of data. (For example, enabling the core Statistics module would be a sure way to kill any site with decent traffic.)
If you want to continue to explore the possibilities for running statistics like this I would suggest either to write a separate kind of counter, or perhaps to try to implement Voting API and write +1 votes on each view. But I doubt any efforts will make it quicker than the Statistics module, which really isn't fast enough.
(If you really want to explore the possibilities I recommend having a look at implementing a NoSQL database, such as Redis, which can handle rediculous amounts of writes. But that would be a completely different thing.)
Sorry about the bad news. :-/
//Johan Falk, NodeOne, Sweden