Tuesday 14 August 2007 12:29:11 pm
Hi, I would like to display the number of time a node has been viewed using view_count. After looking for in the ez.no's forums and documentation parts I did the following:
1°/ In my public siteaccess cronjob.ini.append.php file:
<?php /* #?ini charset="utf-8"?
[CronjobSettings]
Scripts[]=updateviewcount.php
*/ ?>
2°/ In my public siteaccess logfile.ini.append.php file: <?php /* #?ini charset="utf-8"?
[AccessLogFileSettings]
StorageDir=/var/log/apache/
LogFileName=access.log
SitePrefix[]=luxpopuli
SitePrefix[]=luxpopuli_admin
*/ ?>
In this code I tried also to add an escaped slash at the end of the two last lines (according with this post: http://ez.no/community/forum/setup_design/how_to_get_the_popularity_of_a_node#msg119935) 3°/ In my article view template: {$node.view_count}
4°/ I run the runcronjobs.php script:
php runcronjobs.php -c -d -s luxpopuli
Using siteaccess luxpopuli for cronjob
...
...
...
Running cronjobs/updateviewcount.php
Update content view count...
Started at Mardi 14 Août 2007 8:20:20 pm
Start line:
82.67.66.131 - - [14/Aug/2007:20:18:21 +0200] "GET /images/btn-bkgd.gif HTTP/1.1" 404 17165 "http://luxpopuli.fr/ez_publish__1/documentation_ez_publish/reference_reference/objects_objets/ezbinaryfile" "Opera/9.22 (X11; Linux i686; U; en)" "-"
Finished at Mardi 14 Août 2007 8:20:20 pm
View count have been updated!
########### DEBUG ##########
Notice: (eZMySQLDB::query(0.000 ms) query number per page:0)
SET NAMES 'utf8'
...
...
...
Timing: ()
Script cronjobs/updateviewcount.php starting
Timing: ()
Script cronjobs/updateviewcount.php done
Total script time: 1.4071 sec
5°/ I access some articles 6°/ I re-run runcronjobs.php... but the counters on the public pages stay set to 0 Another thing: I can't fing a "view_count" field in any ezcotobjectxxxx tables. So, how does work the updateviewcount.php script ? Pascal
Ce qui embellit le désert c'est qu'il cache un puits... quelque part... (A. de Saint-Exupéry) - http://luxpopuli.fr/eZ-Publish
|