Show Page Views

Author Message

DeAndre Johnson

Tuesday 13 October 2009 5:01:26 am

Is there a way to show the number of times article pages have been viewed?

I am, because I choose to be!

Gaetano Giunta

Tuesday 13 October 2009 7:51:23 am

You will need to enable the cronjob that parses the webserver logs and stores that info back into eZP (updateviewcount.php, by default commented in cronjobs.ini in the standard cronjob part).

Then you can use $node.view_count in your node template to display it.

Take care: by deafult, with view cache on, the number will only be increased when the object is edited again, so you will also have to disable the view cache for those nodes where the view count is shown, using something like: {set-block scope=global variable=cache_ttl}86400{/set-block}

Principal Consultant International Business
Member of the Community Project Board

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 18 2025 16:25:35
Script start
Timing: Jan 18 2025 16:25:35
Module start 'layout'
Timing: Jan 18 2025 16:25:35
Module start 'content'
Timing: Jan 18 2025 16:25:36
Module end 'content'
Timing: Jan 18 2025 16:25:36
Script end

Main resources:

Total runtime1.4129 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0144 587.7891152.6094
Module start 'layout' 0.01440.0054 740.398439.4297
Module start 'content' 0.01981.3916 779.8281527.2422
Module end 'content' 1.41140.0014 1,307.07038.1953
Script end 1.4128  1,315.2656 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00390.2744160.0002
Check MTime0.00150.1083160.0001
Mysql Total
Database connection0.00200.140810.0020
Mysqli_queries1.358996.1802540.0252
Looping result0.00050.0369520.0000
Template Total1.348295.420.6741
Template load0.00260.182220.0013
Template processing1.345695.239120.6728
Template load and register function0.00010.007510.0001
states
state_id_array0.00210.148510.0021
state_identifier_array0.00280.201420.0014
Override
Cache load0.00200.1439100.0002
Sytem overhead
Fetch class attribute can translate value0.00080.055020.0004
Fetch class attribute name0.00140.096440.0003
XML
Image XML parsing0.00120.083020.0006
class_abstraction
Instantiating content class attribute0.00000.000540.0000
General
dbfile0.00110.0755220.0000
String conversion0.00000.000840.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
2content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 8
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs