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.

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 19 2025 00:25:34
Script start
Timing: Jan 19 2025 00:25:34
Module start 'layout'
Timing: Jan 19 2025 00:25:34
Module start 'content'
Timing: Jan 19 2025 00:25:34
Module end 'content'
Timing: Jan 19 2025 00:25:34
Script end

Main resources:

Total runtime0.0243 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0049 588.3516152.6563
Module start 'layout' 0.00500.0034 741.007839.4922
Module start 'content' 0.00830.0134 780.500093.5234
Module end 'content' 0.02170.0025 874.023438.3047
Script end 0.0242  912.3281 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002811.4155140.0002
Check MTime0.00135.4226140.0001
Mysql Total
Database connection0.00083.392010.0008
Mysqli_queries0.00239.464330.0008
Looping result0.00000.054010.0000
Template Total0.00187.410.0018
Template load0.00104.005410.0010
Template processing0.00083.407710.0008
Override
Cache load0.00072.733410.0007
General
dbfile0.00031.263280.0000
String conversion0.00000.020640.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs