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.

eZ debug

Timing: Jan 31 2025 05:31:07
Script start
Timing: Jan 31 2025 05:31:07
Module start 'content'
Timing: Jan 31 2025 05:31:07
Module end 'content'
Timing: Jan 31 2025 05:31:07
Script end

Main resources:

Total runtime0.1509 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0065 588.1953180.8047
Module start 'content' 0.00650.0062 769.000098.1016
Module end 'content' 0.01270.1382 867.1016526.0000
Script end 0.1508  1,393.1016 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00322.1308200.0002
Check MTime0.00120.7985200.0001
Mysql Total
Database connection0.00070.434610.0007
Mysqli_queries0.099465.89691410.0007
Looping result0.00140.95721390.0000
Template Total0.137891.310.1378
Template load0.00080.544710.0008
Template processing0.137090.793110.1370
Override
Cache load0.00060.373810.0006
Sytem overhead
Fetch class attribute can translate value0.00050.335410.0005
XML
Image XML parsing0.00020.156210.0002
General
dbfile0.00956.3064200.0005
String conversion0.00000.003330.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/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