| eKstreme.com PHPCounter VII | ||
Back to the index page.
Thank you for downloading PHPCounter 7!
PHPCounter 7 is a real time website counter that can track an unlimited number of pages using a single script. The only requirement for using PHPCounter is that your webserver supports PHP. PHPCounter does not use any database, as all information is stored in text files.
PHPCounter has evolved through previous versions to become a complete real-time logging and analysis tool. It allows a webmaster to view statistics about the tracked pages using different 'plugins'. PHPCounter is written in such a way that you can write your custom plugins to analyse the data as you wish!
PHPCounter comes with a set of 'Core Plugins' that give a thorough analysis in their own right. You can view all hits, the last 10 hits, see which browsers and operating systems your visitors use and more! If you have any suggestions for plugins, please contact me (details below).
PHPCounter has several important features, including:
The lastest version of PHPCounter can always be found at http://ekstreme.com/phplabs/phpcounter.php. Please make sure you are using the latest version as it will contain the latest fixes and features.
Note: If you are upgrading from PHPCounter 5.x, 6.x, or 7.0, please see the notes below.
PHPCounter is very easy to install. The following installation instructions will get PHPCounter installed using the default settings. Please read the Settings section below to learn how to customise PHPCounter.
Your installation is now ready to use!
Using your web browser, browse to the information.php file in the COUNTER directory to get the PHP code you need to start tracking pages. For example, if you installed PHPCounter to http://ekstreme.com/counter/, then browse to PHP code you need to start tracking pages. For example, if you installed PHPCounter to http://ekstreme.com/counter/, then browse to http://ekstreme.com/counter/information.php.
A new more robust settings system was introduced in PHPCounter 7.1. This is not compatible with the PHPCounter 7.0 system. Further, PHPCounter 7.1 saves more information in the log files.
Thus to upgrade from PHPCounter 7.0, do the following:
If you want to upgrade from earlier versions (up to 6.x), then you need to install a fresh installation of PHPCounter 7.1 same directory as your current installation. The old data cannot be transferred, but the counts can be as per the instructions below.
The default settings for PHPCounter allow you to quickly start using PHPCounter without having to edit any files. However, you can customise PHPCounter to suit your needs as follows.
All of the customisable settings are stored in the settings.ini file. To edit settings.ini, use a text editor. You can find my recommendations for text editors on the eKstreme.com Freeware Page.
All of the following code excerpts are for the settings.ini file.
By default, PHPCounter outputs the count as HTML. The default code is:
OutputCountText = TRUE
If you do not want PHPCounter to output the count as HTML, then change the value to FALSE:
OutputCountText = FALSE
PHPCounter can output the count as images. The images can be of ANY file format you want, such as .jpg, .gif, or .png. By default, PHPCounter does NOT output the count as images. PHPCounter comes with a (simple) set of images for you to use, but you can make your own as use them! See the Custom Output Images section below for instructions on how to do this.
If you want PHPCounter to output the count as images, you need to specify 3 things:
OutputCountImage = TRUE
ImagesURL = "http://ekstreme.com/counter7/images/"
OutputCountImageExtension = "jpg"
Firstly, you need to set OutputCountImage to TRUE. Also, you need to specify the URL where the images are stored. Finally, you need to specify what is the file extension (file format) of the image files. The example above states that the images are found in http://ekstreme.com/counter7/images/ and that they are JPG (.jpg) files.
You can use PHPCounter to log your visitors invisibly, i.e., without any output. To do this, just set OutputCountText to FALSE and OutputCountImage to FALSE:
OutputCountText = FALSE
OutputCountImage = FALSE
PHPCounter allows you to ignore multiple hits to the same page from the same visitor. These would include page refreshes. To do this, PHPCounter defines a time span during which any new hits to the same page by the same user are ignored.
This time span is set in seconds, and the default is 300 seconds, which is 5 minutes. The code is as follows:
TrackRecentHits = TRUE
TimeDifference = 300
If you do NOT want PHPCounter to ignore multiple hits, then set TrackRecentHits to FALSE; the setting for TimeDifference is then ignored:
TrackRecentHits = FALSE
If you want to change the time span during which PHPCounter ignores multiple hits, then change the TimeDifference. Remember that it is set in seconds. 1 minute is 60 seconds, 5 minutes is 300 seconds, 10 minutes is 600 seconds, 1 hour is 3600 seconds. For example, to ignore multiple hits for 1 hour:
TimeDifference = 3600
By default, PHPCounter automatically starts fresh log files every week. This time-based automatic log rotation can be customised to occur at defined spans. These time spans (such as the 1 week default) are called Epochs. This means that at the end of each Epoch, PHPCounter starts a new Epoch (called the Dawn of the Epoch) and a fresh (empty) set of log files.
Epochs are defined in seconds. This means that the shortest possible Epoch is 1 second! The default of one week is 604800 seconds.
Epochs are an integral concept of PHPCounter, but some people prefer not automatically rotate log files. To circumvent this, set the Epoch length to be a very large value, such as about 10 years (314496000 seconds).
Epoch lengths are defined with the following code:
EpochLength = 604800
Change the value to whatever you want.
You can also trigger a new Epoch manually by uploading a fresh copy of the dawn.txt file that came with PHPCounter.
By default, PHPCounter saves the hits times' as the server's time. However, PHPCounter can save a time-zone corrected hit time. For example, you can save the hit time in your own time zone.
The time zone correction is defined in hours by:
TimeZoneDifferenceFromServer = 0
If you are East of the server, the time zone correction is positive (larger than zero); for example: 4. If you are West of the server, the time zone correction is negative (less than zero); for example: -4. The default is zero, i.e., the same time zone.
PHPCounter has a powerful system to start the page counts at any count you wish. There are two settings you need to know about.
Firstly, you can set up PHPCounter to start ALL counts at a certain count. THe default is zero (0), but you can change it to any number. To do that, in settings.ini, set the StartCounterAt variable to your base number. The default code is:
StartCounterAt = 0
To make PHPCounter start the count at 1000, change that to:
StartCounterAt = 1000
This makes all new pages start with a count of 1000.
You can also change the start count for a single page as follows: Once you upload the page to your webserver and BEFORE any new hits are registered to the page (i.e., you MUST make sure that you register the very first hit) browse to the webpage, but with this modification. Suppose that the URL to the new webpage is http://ekstreme.com/phplabs/phpcounter.php, browse to:
http://ekstreme.com/phplabs/phpcounter.php?StartCounter=1934
This has the effect of starting the counter at 1934 hits.
These two systems are additive. This means that if StartCounterAt is set to 1000 and you browse to the URL with StartCounter set to 1934, then the page starts with 2934 hits.
For image output, you can use your own custom set of images with PHPCounter. This will allow you to integrate PHPCounter more into your website.
The images should be named as 0, 1, 2,..., 8, 9 with the appropriate file extension. For example, to use a set of GIF files, the file names should be 0.gif, 1.gif, 2.gif,..., 8.gif, 9.gif. Place these somewhere accessible on your webserver, and specify the URL they are located at as per the instructions above.
There is a separate help file for the Data Analysis Plugins that come with PHPCounter.
PHPCounter evolved based on valuable user feedback, for which I am very grateful. I always welcome constructive comments, feedback, and suggestions. If you would like to contact me for whatever reason, please use the contact form on eKstreme.com.
I would very much appreciate if you link back to eKstreme.com from your website. I maintain a set of buttons to use at the eKstreme.com Linkback page. However, a simple text link would do! Thank you very much :)
PHPCounter is free for non-commercial use. If you are using PHPCounter on a commercial website, please donate using these instructions.
Essentially, noncommercial users, including academics, personal websites, charities, etc, get to use PHPCounter for free. All others need to give back something. The instructions above have more details. If you have any questions, please contact me.
Thank you for using PHPCounter. I hope you enjoy it!
Copyright ©2003 Pierre Far. All rights reserved.