Site Map

Home Page
 
Latest News
Recent Updates
Notes
Frequently Asked Questions
Details Wanted
Links
Site Map
About The Enya Discography
 
Albums
 
Enya
Watermark
Shepherd Moons
The Celts
The Memory Of Trees
Paint The Sky With Stars
A Day Without Rain
 
Singles
 
I Want Tomorrow
Orinoco Flow (1988)
Evening Falls...
Storms In Africa
6 Tracks
Oíche Chiún (Silent Night)
3 Tracks EP
Exile
Caribbean Blue
How Can I Keep From Singing?
Book Of Days
The Celts
Marble Halls
The Christmas EP
Anywhere Is
On My Way Home
Only If...
Orinoco Flow (1998)
Only Time
Wild Child
Only Time (Remix)
May It Be
Videos
 
Moonshadows
The Video Collection
 
Collections
 
Shepherd Moons & Moonshadows
Watermark & Shepherd Moons
The Enya Collection
A Box Of Dreams
Only Time - The Collection
 
Soundtracks
 
The Frog Prince
The Celts
Far And Away
Toys
Calmi Cuori Appassionati
The Lord Of The Rings:
The Fellowship Of The Ring
 
Interviews
 
Interview Picture Disc
In Conversation
 
Promotional
 
Miscellaneous
 
Travel
Crann Ull
Mhorag 's na horo Gheallaidh
Fuaim
Ceol Aduaidh
Ordinary Man
The Lion And The Cobra
The Driver
Celtic Folk Festival
Portrait of Ireland
 
Books
 
Tracks
 
E-mail
 
#!/usr/local/bin/perl use strict; ########################################################## # MKCounter 1.3.1 # # by Michael Kelly # # http://www.jedimike.net # # Last modified on: 05/23/02 # ########################################################## # Configurations: # If MKCounter doens't work correctly, modify these settings as needed. # If your server supports file locking, leave this as it is. If you # get errors concerning "flock()" or "flocking", set this to 0. my $flock = 1; # The name of the counter file. This is where the actual counts # are stored. It stores the count for all pages. This file must be # in the same folder as MKCounter.cgi. Note that changing this will # wipe your existing hit counts, unless you move your current counter # file to the new location. my $counter_file = 'MKCount.txt'; # Is your server using a proxy? # Set the number to 1 if it is, 0 if it isn't. # Turn this on if all the IP addresses in the log file are the same, # and you know different people have visited the site. my $proxy = 0; # That's it! ########################################################## ####### Don't mess with anything below this line ######### ########################################################## my $vernum = '1.3.1'; # HTTP 1.0 compat print "Content-type:text/html\n\n"; # use the default value for $counter_file if it's been left blank if ($counter_file eq ''){ $counter_file = 'MKCount.txt'; } # watch for missing %ENV stuff. it shouldn't happen, but I'm just covering my back $ENV{'HTTP_USER_AGENT'} = '' unless(defined($ENV{'HTTP_USER_AGENT'})); $ENV{'REMOTE_ADDR'} = '' unless(defined($ENV{'REMOTE_ADDR'})); $ENV{'QUERY_STRING'} = '' unless(defined($ENV{'QUERY_STRING'})); # get the arguments from the query string. # CGI.pm is too big for a simple job like this, imo. my %args = split(/=|&/,$ENV{'QUERY_STRING'}); # assign default values $args{'id'} = 'dftpage' unless (defined($args{'id'})); $args{'log'} = 0 unless (defined($args{'log'})); $args{'hidden'} = 0 unless (defined($args{'hidden'})); # now assign the hash values to scalars my ($counter_id, $hidden, $log) = ($args{'id'}, $args{'hidden'}, $args{'log'}); my %tally = (); # open up the counter file for reading if (-e $counter_file){ # if it already exists, read it. open(COUNTERREAD, "<$counter_file") or (print "

Cannot open $counter_file: $!\n

", die "

Cannot open $counter_file: $!\n

"); if ($flock){ flock (COUNTERREAD, 1) } read(COUNTERREAD,my $buffer, -s $counter_file,0); if ($flock){ flock (COUNTERREAD, 8) } close(COUNTERREAD); %tally = split(/=|\n/,$buffer); } # if a total for this ID doesn't already exist, make one $tally{$counter_id} = 0 unless (defined($tally{$counter_id})); # the heart of the script :) $tally{$counter_id}++; if ($hidden != 2){ print "\n"; print '' if ($hidden); } # open the counter file for writing open(COUNTERWRITE, ">$counter_file") or (print "

Cannot open $counter_file: $!\n

", die "

Cannot open $counter_file: $!\n

"); if ($flock){ flock (COUNTERWRITE, 2) } # print the hash back into the counter file foreach my $key (keys %tally){ print COUNTERWRITE "$key=$tally{$key}\n"; } if ($flock){ flock (COUNTERWRITE, 8) } close(COUNTERWRITE); # log this hit. if ($log){ my ($ip, $time, $logname); # if there's a proxy, use 'HTTP_X_FORWARDED_FOR'. Otherwise use REMOTE_ADDR. Hopefully one will work. if ($proxy){ $ip = $ENV{'HTTP_X_FORWARDED_FOR'}; } else{ $ip = $ENV{'REMOTE_ADDR'}; } $time = localtime(time()); $logname = $counter_id . '_log.txt'; open(LOGFILE,">>$logname") or (print "

Cannot open $logname: $!\n

", die "

Cannot open $logname: $!\n

"); if ($flock){ flock (LOGFILE, 2) } print LOGFILE <<_LOG_; -------------------- Time: $time IP Address: $ip User-Agent: $ENV{'HTTP_USER_AGENT'} _LOG_ if ($flock){ flock (LOGFILE, 8) } close(LOGFILE); } # the end!