Here's the readme, also included in the zip archive for logLib.php:
Greeting
--------------------------
Greetings!
I hope your install is painless and I hope that you enjoy the software and get good use out of it.
Email me with questions at nathan@ncyoung.com.
WHO WANTS THIS SOFTWARE:
--------------------------
You can use this software if your site uses php. It logs with php function calls so it will require you to modify each php page for which you want to gather statstics.
If you don't use PHP on your site you cannot use this software.
If you already have web server log analytics that you are very happy with, don't bother.
If you've seen the demo below and think it sucks, don't bother.
Demo
-------------------------
View my website at http://ncyoung.com
This software is in action, busily collecting stats on my weblog.
I make the reports generated for my weblog publically available at: http://ncyoung.com/logLib/logView.php
There are 5 easy steps to using this software.
1. gettuing and unzipping the files
1. configuring the database
2. getting the paths right
2.5 uploading the files
3. using the install script
7. collecting data
5. viewing reports
6. authentication for the scripts
Ok there are more than 5 steps. Still they are all very easy I hope. You can call me and scold me if they aren't.
1. getting and unzipping the files
----------------------------------
Download the zip archive from http://ncyoung.com/code/logLib/logLib.zip. Unzip it in a directory of your choosing.
1. configuring the database
----------------------------------
Both the scripts rely on database functionality provided by a little library I wrote. If you are a php developer, check it out, it has some nice little routines. If you really just want to see the reports, just configure it and forget it.
Open the file "db.php" from the directory you unzipped into. At the top of the file you'll see a section of configuration variables. You'll need to fill in mysql server, user, password, and database name. You will find them clearly marked and hopefully easy to edit.
2. getting the paths right
---------------------------------
You can ignore this section unless you move some of the files into different directories.
logLib.php and logView.php both rely on db.php, as mentioned above. I assume that all three files will be in the same directory. If you move one or more files around, they will not be able to find each other. The include statement for db.php is at the top of logLib.php and logView.php. If you move any of the files you can update these includes as necessary.
2.5. uploading the files
---------------------------------
Put the files you edited in the steps above somewhere on your server.
3. using the install script
---------------------------------
Go to the logView.php page. If you have the paths wrong or the database confirguration does not result in a good connection it will try to warn you. If everything is good it will ask you if you'd like to create tables and tell you the names of the tables it wants to create.
7. collecting data
---------------------------------
On every page on your site for which you want to gather statistics, put an include to logLib.php, create a logger, and make a method call to the logEvent method. It's easier than it sounds.
include("logLib/logLib.php");
$log = new userLog();
$log->logEvent("page title here");
Page title is optional but it makes your reports a lot nicer to use (assuming your pages have unique titles).
5. viewing reports
---------------------------------
Go to loglib.php. If it's a slow day on the ol' website and you just can't wait, click around a bit so you have something to look at!!
Most of the reports are self explanatory.
- filtering robots and referers
- custom browser strings
- hiding clickpath sessions
6. authentication for the scripts
---------------------------------
The htaccess files I've included authenticate either for every file in the directory, or ONLY for logView and only for the post method, which will essentially let people look but not touch. You need an apache password file, which you can create using the fine tutorial located here:
http://httpd.apache.org/docs/1.3/howto/auth.html
Once you've created the file, put the path to it into the htaccess file you want to use, rename it .htaccess, and upload it to the directory you want to protect. (You might need to upload it and THEN rename it).
7. extras
---------------------------------
The reporting lets you get set up to ignore robots and referers (if you like me have been the recipient of referer spam).
I will try to make a good starting point for these filters available at some point. or build them into the install. or I can send you an SQL dump of my ignorables.
You can apste in comma seperated lists into the ignore forms.
Here's a start for user agents
msnbot, Jakarta Commons, yahoo, Googlebot, Bloglines, spider, BlogBot, PanopeaBot, voyager, crawler, MagpieRSS, Ask Jeeves, findlinks, Netcraft Web Server Survey, SBIder, NaverBot, heritrix, Java/1.5, Nutch, POE-Component-Client-HTTP, Mediapartners-Google, lwp, HTTrack, Scooter, DownUp2U, WinHttp, MJ12bot, ZyBorg, PEAR HTTP, PHP version tracker, LinkWalker, aipbot, Xenu Link Sleuth, BlogSearch, Snoopy, SurveyBot, Java/1.4, Exabot, Filangy, larbin, Swooglebot
here's a start for referers
hydroco, fiberia.com, bodyworkemporium.com, online-pharmacy, sbn.bz, sexparties, holdem, http://www.datashaping.com/web_rankings.shtml, bigfatcupofcrazy.com, XXX, corbin-fisher.com, casino, poker, sean-cody, http://www.consultademultas.com.br,