Yes, it is easy!
Installing this web counter is extremely easy. If you have just a little experience in website creation (html/php and ftp) you are able to pull this job. So here's three Paths to knowing what your visitors do right now.
1. The Quick Path
2. The Path To Understanding
Now you have your counter working, you might want to take a more thorough look at the code. There's a lot of cross referencing going on, so it's all extensively documented in the code itself. If you take your time you should be able to figure it all out. There are a few things i would like to tell you about it.
(read more)
- This Simple Yet Effective PHP Web Counter uses flat file databases to store it's data. These files are marked with the extension .db. Have a good look at the contents to figure out what they do. -> Please do mind that ip.db is the only file not being used to present you any on screen data. It is used by the unique vistor counting routine to avoid double counting.
- The other files are:
index.php (the back end user interface)
sye.css (style sheet for index.php)
cleanup.php (the database-cleaner that is included in index.php)
header.php (the shared headers for both index.php and cleanup.php)
counter.php (the actual counter)
english.php (the file that stores the texts in strings that are used by all other php-files. There are several languages right now: default is English. Dutch, Finnish and Estonian versions (dutch.php etcetera) are also in the distribution. You'll find two references to english.php in header.php and counter.php. If you translate the web counter to your own language, please send me the language file afterwards so I can add it to the archives).
Step by step: what to change in the files?
There are certain parts in the counter that you should adapt to your personal situation to make the system work, lets have a glance.
In counter.php you'll find the following section, replace the directory name count with the name you choose for your installation:
// Files where your data are stored - never ever change the name of the day, because it comes from the jddayofweek() function above
if ($todayis == "Monday") {
$file = 'count/mondaysreferrers.db';
} elseif ($todayis == "Tuesday") {
$file = 'count/tuesdaysreferrers.db';
} elseif ($todayis == "Wednesday") {
$file = 'count/wednesdaysreferrers.db';
} elseif ($todayis == "Thursday") {
$file = 'count/thursdaysreferrers.db';
} elseif ($todayis == "Friday") {
$file = 'count/fridaysreferrers.db';
} elseif ($todayis == "Saturday") {
$file = 'count/saturdaysreferrers.db';
} elseif ($todayis == "Sunday") {
$file = 'count/sundaysreferrers.db';
}
$file2 = 'count/hits.db';
$file3 = 'count/ip.db';
$file4 = 'count/uniques.db';
$file5 = 'count/keywords.db';
Further down in the file, you'll find the line below, replace the filename english.php with the language of your choice (if the file of your choice is included in the distribution, and yes: you are free to make your own translation and submit it back for inclusion!)
include("english.php"); /* translations and color codes to be shared between counter.php and index.php */
To keep your own IP addresses from appearing in the log, change them into yours in the section below (and remove the /* and the closing */ to enable the routine):
/*
////////////// Filter your own IPs from the log so they wont show up in the stats //////////////
/// Disabled by default
if ($ip1 == "127.0.0.1") {
exit();
} elseif ($ip1 == "192.168.1.100") {
exit();
} elseif ($ip1 == "192.168.1.110") {
exit();
} elseif ($ip1 == "192.168.1.120") {
exit();
} elseif ($ip1 == "192.168.1.130") {
exit();
}
Finally, change the word Your-site in your site's name if you would like to use Twitter:
$twitter_data_prepare = "status=" . $readdata . "hits " . $tweet . " | Your-site"; // the string readdata is taken from the hit counter above
What to change in header.php?
Again, change the language of your choice at this line:
include("english.php");
To secure access to your counter management interface, enable this section by removing the line behind /* and fill in your own ip addressess:
/* IP-checking disabled by default, please enable for your security
////////////// Restrict acces to your IP-address only, using hard exit without any information //////////////
$ipaccess=@$REMOTE_ADDR;
if ($ipaccess == "127.0.0.1") { // replace with your own IP-addressses
echo $goodpeople;
} elseif ($ipaccess == "192.168.1.10") {
echo $goodpeople;
} elseif ($ipaccess == "192.168.1.10") {
echo $goodpeople;
} elseif ($ipaccess == "192.168.1.10") {
echo $goodpeople;
} elseif ($ipaccess == "192.168.1.10") {
echo $goodpeople;
} elseif ($ipaccess == "192.168.1.10") {
} else {
header("Location: http://www.yoursite.com/"); // replace with your own site
}
If you want to enable and use the TWITTER update routine, enter the login details of your Twitter counter account in english.php (or the file of your language of choice). Yes, you read it well: to use Twitter you need to open a separate account for the counter. By _following_ that account from your main Twitter account you'll be notified in real time when someone visits your website.
Also for the e-mail routine: change your e-mail details in english.php
Also read about how to customize the web counter's appearance.
3. The Path To Cleanliness
The Simple Yet Effective PHP Web Counter comes with an integrated cleaning interface. This is a php-page (cleanup.php) that makes it possible to maintain your installation. Mainting means: wiping all data from the database files to start counting again. Which is practical, because all data is retained and your db-files will grow, and grow, and grow.
(read more)
If you want to keep all your counting records, just don't touch them. It's your choice! And please do mind: to maintain speed, only the top 5000 characters of every .db file are shown on screen (see the truncating code in index.php, line 139 and below).
Every database file has its own cleaning button, so you can custom clean. Isn't that beautiful? Please explore the possibilities right after installing, it's all pretty straight forward.
All this user friendliness comes with a catch though: cleanup.php can be used by other people to wipe your data. So please secure the complete directory, or use the IP-blocking as provided in header.php (which is included in cleanup.php for safety). If you do not wish to use these cleaning features, it is a good idea to remove the file completely.
Image above: cleaning up is simple, just press the buttons! Click to enlarge.