# CREDITS
# ========
# Kimmie Dicaire (kdicaire@ipschannel.com)

# LICENSE
# ========
# KR Web Tracker falls under the Artistic License

# A copy of this license is contained in the standard
# KR Web Tracking distribution package in a file called COPYING.
# If you did not recieve this file, please point your Web
# browser to :
#    http://www.activestate.com/corporate/artistic_license.htm


# In terms of Warranty, no warranty is guaranteed or implied.
# If this eats your hard drive, kills your cat, or rotates your
# tires, you have no legal recourse anywhere. None of the authors
# nor users of this code may be held liable, legally or otherwise,
# for any damages or benefits that arise from use of this code.

Homepage for the KR EZ Web Tracker is located at:
Http://matrix.linux-help.org/tracker

Install Note:
We will not go into how to install PostgreSQL or PHP3,
it is assumed that PostgreSQL and PHP3 is already installed and
functioning on your computer.

This INSTALL is split into 3 sections: MAIN/CLICK TRACKER/COUNTER see each
section for installation proceedures.

To Upgrade skip to bottom   

******************MAIN K&R EZ WEB TRACKING INSTALL:*************************

1. Download and untar the source (presumably in your webtree)
  
   tar zxfv kr-ez-tracking-V3.tar.gz

2. Run the Install.sh to create the database user/pass in all files
   
   NOTE: If you decide to run the application as a different user/pass
         after the initial install then run the Change.sh to change
         the user/pass in the files

3. As Your Postgres user do:

   createdb web

4. Install the schema from tracker/postgresql to your postgres database

   psql -e web < tracker.schema

5. Use the adduser script in tracker/postgresql to add the user/pass to the 
   database that you used during the ./Install.sh

    psql -e web < adduser

   NOTE: If you used a user/pass that is already in your postgres database
         then you can skip using the adduser script.

6. Modify krt.php3 for your domain and any ignores you would like. Instructions
   are inside the file clearly marked.

7. Insert the following line in all your .php files that you want to keep track
   of with the tracker.

   <? include ("krt.php3"); ?>
   
   To use in .html files add this to each page.

   <!--#include file="krt.php3" -->

8. Point your browser to /path/to/tracker/front.php3 to begin watching the
   hits and gathering information.

9. You might want to keep your tracker files password protected by placing a
   .htaccess file in the /tracker directory

There is a execuatble in /tracker/report called dailyreport you can modify 
it for your email address and run it to get daily reports of activity on
your site. You may want to cron the file so that reports will be sent
daily to your email address of all activity on your site. A simple cron
might look like :

#Runs the TXT report at 11:50 nightly and emails you the results for the day
50 23 * * *  /full/path/to/tracker/dailyreport > /dev/null 2>&1

*************************CLICK TRACKER ADDITION:*****************************

  1. To use just place the file clicker.php3 in your path                

  2. In your external links and downloads just call the script like:         
    <a href=clicker.php3?url=http://www.somesite.com>Site Name</a>    

******************************COUNTER ADDITION:*******************************

To use the counter addition use the counter.php3 as an include at the bottom
of your page. This counter pulls the grand total of pages hit on site.

   For use in .php3 pages add the following:

   <? include ("counter.php3"); ?>

   To use in .html files add this to each page.

   <!--#include file="counter.php3" -->

***********************************UPGRADE***********************************

1. Backup your current database using pg_dump as the postgres user do

  /usr/local/pgsql/bin/pg_dump web -Dv > web.db

2. Then drop the database

    psql web
    drop database web;

3. Use the tracker schema in the /PostgreSQL directory

    psql -e web <tracker.schema

4. Add your backup database on top of the new schema

    psql -e web <web.db

This will update to the new database schema but the click tracker section
will not hold 100% true as that part of the database had some major changes.
It is best to use this version as a fresh install or not import your old click
tracker portion back into the database.

   
