Forums / General / Is it possible to count how many times a specific article was displayed?

Is it possible to count how many times a specific article was displayed?

Author Message

Mieczyslaw Morzonek

Thursday 09 September 2004 6:35:02 am

Is it possible to count how many times a specific article was displayed? Does the eZpublish count the quatnity of articles' displays?

Thanks for any help

Ole Morten Halvorsen

Thursday 09 September 2004 6:48:45 am

No, eZ publish doesnt have support for counting the number of times an article has been displayed. It is possible, but you will have to develop it yourself as I don't know of any contribution which does this.

If anyone have made this kind of functionality, please speak up! :)

Ole M.

Senior Software Engineer - Vision with Technology

http://www.visionwt.com
http://www.omh.cc
http://www.twitter.com/omh

eZ Certified Developer
http://ez.no/certification/verify/358441
http://ez.no/certification/verify/272578

Bård Farstad

Thursday 09 September 2004 7:48:07 am

We actually have support for this by parsing the apache logs, settings for that can be found in settings/logfile.ini.

These numbers are updated by a cron job, updateviewcount, which needs to be configured to run periodically.

--bård

Documentation: http://ez.no/doc

Mieczyslaw Morzonek

Friday 10 September 2004 2:43:38 am

Could you give me more detailed answer (fragment of code) ? How could I turn this module on? Where can I fund more hints about it? How to display the results in the template?

Wenyue Yu

Tuesday 14 September 2004 3:58:33 am

Hi,

Here is some steps to make it work ( I hope it will :) )
1. Configure settings/cronjob.ini
Add the following line:
Scripts[]=updateviewcount.php

2. Configure settings/logfile.ini
[AccessLogFileSettings]
#Where could find the apache log
#Example StorageDir=/var/log/httpd/
StorageDir=
#Example LogFileName=test.ezpublish.no
LogFileName=

Template example of fetch top 10 most popular articles in section 1 ( suppose article class id is 2 )

{let view_list=fetch('content','view_top_list',hash(section_id,1,class_id,2,limit,10,offset,0))}
{section show=$view_list}
{section name=ViewList loop=$view_list sequence=array(bglight,bgdark)}
        <a href={concat("/content/view/full/",$ViewList:item.node_id)|ezurl}>
        {$ViewList:item.name}
        </a><br />
{/section}
{/section}
{/let}

Regards,
wenyue

Mieczyslaw Morzonek

Sunday 26 September 2004 2:52:16 am

Hi Wenyue

Your code doesn`t work :( There`s no result from fetch function. Are there any chances that it will be work?

Mieczyslaw Morzonek

Sunday 24 October 2004 1:31:40 pm

Hi,

This is my output from runcronjobs.php

Running cronjobs/updateviewcount.php
Update content view count ...
Started at Sunday 24 October 2004 10:25:41 pm

Start line:

Finished at Sunday 24 October 2004 10:25:42 pm

View count have been updated!

There`s no results. Settings in logfile.ini are correct.