Forums / Setup & design / Implementing Counters on Exponential
Hermano Correia
Tuesday 22 July 2003 2:59:36 pm
I am new on Exponential. 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
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 Exponential, 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 Exponential 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:officialhttp://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 Exponential, but it does the job.A build in counter in Exponential 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