Page Counter

This page has been accessed times.

The counter program that I use myself was written by Frans van Hoesel and modified by a number of people including Dan Rich, Michael Nelson, Mike Morse, Karen Nakamura and finally myself. It includes the following features:

 

 

Installation instructions for CMGM users

If you are an organization or individual at Stanford that already has an account on CMGM (aka cmgm.stanford.edu), you can easily add an access count to your page because count2.xbm is already installed.

  1. Create the directory "logs" (in your home directory):
     mkdir ~/logs 
  2. Make sure access permissions are set correctly and give temporary world-write permissions to "logs":
     
    		chmod a+x ~/.
    		chmod a+x ~/logs
    		chmod a+w ~/logs 
    	

    You could also make the "logs" directory owned by "nobody". This is a bit safer since this will keep you and other folks from saving lots of stuff in your subdirectory, or editing your page counts. Ask the System Manager to do this for you.

     

  3. For each page in your public_html/ directory add the following lines:
    <a href="http://cmgm.stanford.edu/wusage7.0/usage">
    <IMG SRC="http://cmgm.stanford.edu/cgi-bin/count2.xbm/MYDIRECTORY/MYACCOUNT/
    logs/MYPAGENAME" ALT="[Count not available in text mode]">
    </a>
       
  4. MYDIRECTORY is either /pmgm for PMGM, or /b for Biochemistry, or /d for DevBio or /h for HHMI (there are some other combinations). You can find out what your directory is by logging into CMGM, typing pwd and that will give you your full directory pathname of your account.

     

  5. Replacing, of course, MYACCOUNT with your user account name and MYPAGENAME with the name of the page that is accessing it, minus the ".html" suffix. For example: MYACCOUNT="kozar" and MYPAGENAME="index". Please note that the line that begins with IMG SRC... is all one line and should not have any breaks or spaces in the "http.....MYPAGENAME" area.

The line that begins <A HREF=....> is only if you want to link, to the page that shows the overall CMGM statistics for the week ... you can put anything there, or just use the IMG SRC without any other fussy stuff. It does give the counter a nice blue border though... The following files will be automatically created: (from the example above)

 

       ~/logs/mypage.log
       ~/logs/mypage.count

When the home page is displayed, Web clients will retrieve the in-line bitmap. This will invoke this script, which responds with a bitmap it builds on the fly, that looks like an automobile odometer. If you include the A HREF, the odometer will be surrounded by a border (and look better), and users can click the odometer to get some other information.