PHP Classes

File: INSTALL.TXT

Recommend this page to a friend!
  Classes of David Higgins   CCounter   INSTALL.TXT   Download  
File: INSTALL.TXT
Role: Documentation
Content type: text/plain
Description: Install directions ...
Class: CCounter
Simple flat-text file counter
Author: By
Last change:
Date: 21 years ago
Size: 1,786 bytes
 

Contents

Class file image Download
INSTALL.TXT To install and use CCounter, you need to do one of two things ... Either create a file called counter.dat (or whatever you like, just remember to change it in the counter.php and the counter_report.php scripts) and set it to -rw-rw-rw- ... OR ... point the script to a directory where drwxrwxrwx is set ... The script will automatically attempt to generate the counter.dat file if it is not found ... if it tries to do this, it will need write permission in the directory the file is located in ... If you create a new file, be sure to simply touch the file ... the file should be 0 bytes in size after you create it (touch counter.dat from a console, for example). After the counter.php and counter.dat files are setup ... you can display the results of your tracking in any page you wish using the following class functions: class CCounter { function GrandTotal(); function Unique(); function CurrentTotal(); function Visitor(); } GrandTotal is a sum of all the visits to the site ... Unique is a sum of all the unique visits to the site (REMOTE_ADDR based) CurrentTotal is a sum of all the visits by a unique host Visitor is the ID of the unique visitor in the counter.dat file These functions are very basic and simple, they echo the values so you need only call the function ... If you would like the class to -not- echo the values, but rather return them ... simple change the word "echo" to "return" in the class file ... the functions are quite simple ... they are simple lines which do nothing but echo the values ... all the 'hard work' is done in the class constructor ... do not edit the class constructor ... David Higgins -- higginsd@zoulcreations.com / http://zoulcreations.com