Click Manager 2.2.2 - http://www.aardvarkind.com/?a=cgi&b=clickmanager&c=index
 2001-2002 Aardvark Industries - http://www.aardvarkind.com/
Written by Jeremy Scheff - webmaster@aardvarkind.com



You can redistribute and/or modify this script under the terms of the Aardvark 
Industries License, either version 1.0 or (at your option) any later version 
published by Aardvark Industries.

This program is distributed in the hope that it will be useful, but 
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
FITNESS FOR A PARTICULAR PURPOSE.  See the Aardvark Industries License for 
more details.                                   



/~~~~~~~~~~~~~~~~~~~~~~~~~\
|        _.---._    /\\   |
|     ./'       '--`\//   |
|   ./              o \   |
|  /./\  )______   \__ \  |
| |/  / /\ \   | \ \  \ \ |
|    / /  \ \  | |\ \  \0 |
|     "     "    "  "     |
|~~~~~~~~~~~~~~~~~~~~~~~~~|
|   AARDVARK INDUSTRIES   |
\~~~~~~~~~~~~~~~~~~~~~~~~~/



This script can be used to count the number of times a link is clicked, be it a 
link to an outside site, a download, or anything else.  It can also be used to 
display the number of times a link has been clicked on your site.  It can 
display the number of times one, two, three, etc., or all of the links have been 
clicked, all added together.  This script was written with simplicity in mind, 
and it shows.  There is no admin area and usually no configuration is required, 
but it has plenty of powerful features at your disposal.



----------
WHAT'S NEW
----------

Click Manager 2.2.2 - 2002-07-08
- Now works with = in URL.

Click Manager 2.2.1 - 2002-07-05
- Fixed a stability bug (maybe).
- Took the stats out of clickmanager.cgi and moved them to stats.cgi so it 
  should run a little bit faster.
- Option to have password-protected stats.

Click Manager 2.2.0 - 2002-04-10
- Optimized some code.
- Uses sysopen instead of open for more stable file handling.
- Counts total clicks.
- Keeps the highest clicks in one day.
- Displays the average clicks per day.
- Uses a template to make the stats display custimizable.
- Commented the code for better readability.

Click Manager 2.1
- Rewritten code, now with use strict and cleaner coding.
- New clickmanager.txt format to allow easier use of IDs.
- bar.gif works if you need the script in a cgi-bin.
- Several other small bugs.

Click Manager 2.01
- Script no longer divides by zero if you view the stats before there are any 
  clicks.
- URLs with = are now supported.

Click Manager 2.0
- Completely rewritten code.
- Faster.
- More stats.
- Easy install.
- Shorter URLs.
- Much improved readme.txt.



------
CONFIG
------

Make sure the first line of clickmanager.cgi and stats.cgi is the correct path 
to Perl for your server.

#!/usr/bin/perl is most common and is already there.  If that doesn't work, 
#!/usr/local/bin/perl is what you should try next.  That is the path to Perl on 
Hypermart and many other servers.

If neither one of those work, type whereis Perl in telnet or simply ask your 
host.

If you're on a Windows server, set $dir in clickmanager.cgi and stats.cgi to 
the full path to the directory you're installing the script in.  In stats.cgi 
there are also some other settings you can change if you want.  There are 
comments in there that say what each setting does.



----------
INSTALLING
----------

SEE BELOW FOR UPGRADING

Upload the following files in in ASCII mode.  CHMOD appropriately.
CHMOD 755 clickmanager.cgi
CHMOD 666 clickmanager.txt
CHMOD 666 date.txt
CHMOD 666 total.txt



---------
UPGRADING
---------

UPGRADING FROM 2.2.1
Upload clickmanager.cgi and stats.cgi.
CHMOD 755 clickmanager.cgi and stats.cgi.

UPGRADING FROM 2.2.0
Upload clickmanager.cgi and stats.cgi.
CHMOD 755 clickmanager.cgi and stats.cgi.

UPGRADING FROM 2.1
Upload clickmanager.cgi, stats.cgi and upgrade.cgi in ASCII mode.
CHMOD 755 clickmanager.cgi, stats.cgi and upgrade.cgi.
Go to upgrade.cgi in your browser.  That should do it.



---------
BASIC USE
---------

IMHO, the best thing about this script is that it is very easy to use.  There's 
no settings, there's no admin.  All you need to do is read this section and 
you're ready to go.

-Linking
Let's say you have a link to http://www.aardvarkind.com/ on your site.  You 
want to count how many times that link is clicked.  Instead of using the regular
<a href="http://www.aardvarkind.com/">Aardvark Industries</a>
you would use this
<a href="http://www.you.com/folder/clickmanager.cgi?dl=http://www.aardvarkind.com/">Aardvark Industries</a>

-Viewing stats
Just go to stats.cgi to get all the stats you'll ever want.



------------
ADVANCED USE
------------

IMHO, the second best thing about this script is that it has many powerful 
features.  If you already have the hang of the basic use, read this to learn 
about all the cool stuff this script can do.

-Viewing the number of clicks on one link
Just go to http://www.you.com/clickmanager.cgi?num=http://www.aardvarkind.com/ 
to see how many times people clicked on the link to http://www.aardvarkind.com/.

-Viewing the number of clicks on multiple links
Use the same code as viewing the links, but seperate URL's with |||.  Example:
http://www.you.com/clickmanager.cgi?num=http://www.aardvarkind.com/|||http://www.yahoo.com/
That would show you the total times that your links to http://www.aardvarkind.com/ 
and your link to http://www.yahoo.com/ were clicked.  The number of times each 
link was clicked are added together and the total is shown.  This is helpful if 
you want to see how many hits you sent out to a group of sites or if you have 
different versions of one thing up for download.

-Viewing the total number of clicks for all links
Go to http://www.you.com/clickmanager.cgi?numall=1

-SSI
SSI is a cool way to show people how many times something has been clicked.  It 
will put it right into your site.  Examples:
<!--#include virtual="/folder/clickmanager.cgi?num=http://www.aardvarkind.com/" -->
<!--#include virtual="/folder/clickmanager.cgi?num=http://www.aardvarkind.com/|||http://www.yahoo.com/" -->
<!--#include virtual="/folder/clickmanager.cgi?numall=1" -->

-Shortened URLs
Think it looks ugly to type two whole urls to get one link?  Well, here's the 
solution.  Go to clickmanager.cgi and you'll see the list of links at the 
bottom.  Just take the number from the ID column and it can be used instead of 
a url.  An example would be:
clickmanager.cgi?dl=1 or clickmanager.cgi?dl=22
IDs are automatically assigned when a you go to a new url, so to create one go to 
clickmanager.cgi?dl=http://www.linkedsite.com.

-Password-Protected Stats
Don't want people to see the stats?  Just open stats.cgi in a text editor.  
Set $require_pw to '1' and set $pw to your desired password.  Now when you view 
the stats you will first be prompted for a password.



----
FAQS
----

Q-Can I take the copyright and link off the bottom?
A-No.  If you absolutely must get rid of it, contact me.  I might allow you to 
pay me to remove it.

Q-Can I modify/distribute/whatever the script?
A-You can do so under the terms of the license.  Read license.txt for more 
information.

Q-When will the next version be out?
A-Whenever there is a new feature I want to add or if there is a bug.



-------
SUPPORT
-------

Having trouble?  Post in the support forum at 
http://www.aardvarkind.com/forums/ and I will get back to you quickly.  Don't 
IM me or email me, posting at the forum will get you a much faster answer.



-------
CONTACT
-------

I really like getting feedback.  Post any comments or suggestions you have at 
the forum, http://www.aardvarkind.com/forums/

If you have a private matter that you need to discuss...

AIM: Aardvark Freak
Email: webmaster@aardvarkind.com