Forums / Setup & design / Implementing Counters on EzPublish

Implementing Counters on EzPublish

Author Message

Hermano Correia

Tuesday 22 July 2003 2:59:36 pm

I am new on EzPublish. I would like to have ideas on how to make a counter hit on the first page of site, to show how many visitours I have received.

Any help will be very welcome.

Thanks

Jan Borsodi

Wednesday 23 July 2003 1:06:58 am

You should create a small script which keeps the visitor count in a database table and include the script in index.php.

You could place the include right before the
include_once( 'kernel/classes/ezsection.php' );
line in index.php.

Ofcourse you would need to know PHP and SQL to do the rest.

--
Amos

Documentation: http://ez.no/ez_publish/documentation
FAQ: http://ez.no/ez_publish/documentation/faq

Hermano Correia

Wednesday 23 July 2003 2:57:29 pm

Thank you for your answer. I know a little from PHP and SQL, but I think I cannot use PHP directly on templates of the eZ publish, or am I wrong? I already have a script I use on plain PHP sites, what should I change to use it with EZ, should I make a module?

Thanks in advance for any help, and forgive me if the questions are too basic.

Bård Farstad

Wednesday 23 July 2003 3:09:21 pm

You could actually also do this using a template opreator. This operator would then be used in pagelayout.tpl. The opreator could e.g. save a number in a file, or database, which would be counted everytime the page is accessed.

-bård

Documentation: http://ez.no/doc

Steve Brown

Saturday 08 January 2005 9:05:56 am

I'm very surprised that eZ publish doesn't include a counter that you can place in a toolbar. It would probably be more useful than the 'user information' tool.

xiao jc

Monday 21 February 2005 7:09:40 pm

has anyone already made such a hit counter?
thanks:)

Łukasz Serwatka

Monday 21 February 2005 10:41:01 pm

http://www.google.pl/search?q=hit+counter&sourceid=mozilla-search&start=0&start=0&ie=utf-8&oe=utf-8&client=firefox-a&rls=org.mozilla:pl-PL:official
http://www.phpfreaks.com/tutorials/6/0.php

;-) Use Amos method if you don`t want build tpl operator

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Nicolas Heiringhoff

Tuesday 22 February 2005 1:05:08 am

This is a good tool:
http://www.phpee.com/index.php?node=21

It is not build into eZ Publish, but it does the job.
A build in counter in eZ Publish would be very nice :-)

http://www.heiringhoff.de

Bung Rudi

Tuesday 22 February 2005 6:43:39 am

i've wrote a module for counter.
you can have it on request. send an email to bungrudi@gmail.com.

anyways, its very easy to implement/write one yourself. basically you just make a table in mysql or make a counter class with only integer attribute in it (and then instantiate a class of it). the script/module should check $_SESSION['counter'] (or define any other session variable if you wish), if it is set to false or !isset() (or any other value u defined), then it will increment the counter value by one and set $_SESSION['counter'] to true. if $_SESSION['counter'] is true, do nothing.

thats all. :)

Heiner Wurbs

Tuesday 22 February 2005 8:26:23 am

Hi,
I'm using a hack since some weeks and uploaded it for this topic into the contribs:

http://www.ez.no/community/contribs/hacks/stats_for_specific_urls

Its quite easy and uses unfortunately no features of ez

Maybe you can improve it and use it for your requirements.

Regards,
Heiner

eZ debug

Timing: Jan 18 2025 10:20:09
Script start
Timing: Jan 18 2025 10:20:09
Module start 'content'
Timing: Jan 18 2025 10:20:09
Module end 'content'
Timing: Jan 18 2025 10:20:10
Script end

Main resources:

Total runtime0.2105 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.0069 588.8516180.8281
Module start 'content' 0.00690.0062 769.6797101.8828
Module end 'content' 0.01310.1973 871.5625529.8281
Script end 0.2104  1,401.3906 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00411.9652200.0002
Check MTime0.00170.8253200.0001
Mysql Total
Database connection0.00080.401810.0008
Mysqli_queries0.154773.48571410.0011
Looping result0.00170.79301390.0000
Template Total0.197093.610.1970
Template load0.00080.391010.0008
Template processing0.196293.190710.1962
Override
Cache load0.00060.293110.0006
Sytem overhead
Fetch class attribute can translate value0.00060.297810.0006
XML
Image XML parsing0.00030.150110.0003
General
dbfile0.00894.2337200.0004
String conversion0.00000.002430.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