cgi++
|
@ -0,0 +1,25 @@
|
||||||
|
mv HIT.CFG hit.cfg
|
||||||
|
mv HIT.CNT hit.cnt
|
||||||
|
mv HIT.FLK hit.flk
|
||||||
|
mv HIT.XBM hit.xbm
|
||||||
|
mv HIT1.DAT hit1.dat
|
||||||
|
mv HIT1.LOG hit1.log
|
||||||
|
mv HIT10.DAT hit10.dat
|
||||||
|
mv HIT11.DAT hit11.dat
|
||||||
|
mv HIT12.DAT hit12.dat
|
||||||
|
mv HIT2.DAT hit2.dat
|
||||||
|
mv HIT2.LOG hit2.log
|
||||||
|
mv HIT3.DAT hit3.dat
|
||||||
|
mv HIT4.DAT hit4.dat
|
||||||
|
mv HIT5.DAT hit5.dat
|
||||||
|
mv HIT6.DAT hit6.dat
|
||||||
|
mv HIT7.DAT hit7.dat
|
||||||
|
mv HIT8.DAT hit8.dat
|
||||||
|
mv HIT9.DAT hit9.dat
|
||||||
|
mv HITCFG.PL hitcfg.pl
|
||||||
|
mv HITMAN.PL hitman.pl
|
||||||
|
mv HITMAT.CGI hitmat.cgi
|
||||||
|
mv HITMAT.PWD hitmat.pwd
|
||||||
|
mv HITXBM.PL hitxbm.pl
|
||||||
|
mv HOW2HIT.TXT how2hit.txt
|
||||||
|
mv SINCE.XBM since.xbm
|
|
@ -0,0 +1 @@
|
||||||
|
1|1|1|N|
|
|
@ -0,0 +1,4 @@
|
||||||
|
#define hit_width 1
|
||||||
|
#define hit_height 1
|
||||||
|
static char hit_bits[] = {
|
||||||
|
0x00};
|
|
@ -0,0 +1,215 @@
|
||||||
|
#! /usr/local/bin/perl
|
||||||
|
#
|
||||||
|
# HITCFG.PL
|
||||||
|
# File maintenance module required by HITMATIC
|
||||||
|
#
|
||||||
|
# Filename: hitcfg.pl
|
||||||
|
# Last revised: July 08, 1998
|
||||||
|
# Copyright: 1997,1998 by Joe DePasquale
|
||||||
|
# E-Mail: crypt@getcruising.com
|
||||||
|
# Website: http://www.GetCruising.com
|
||||||
|
#
|
||||||
|
########################################################################
|
||||||
|
# #
|
||||||
|
# This script and accompanying files may be distributed freely #
|
||||||
|
# and modified, provided this header with my name, E-Mail address and #
|
||||||
|
# this notice remain intact. Ownership rights remain with me. You may #
|
||||||
|
# not sell this script without my approval. #
|
||||||
|
# #
|
||||||
|
# This script comes with no guarantee or warranty except for my good #
|
||||||
|
# intentions. By using this code you agree to indemnify me from any #
|
||||||
|
# liability that might arise from it's use. #
|
||||||
|
# #
|
||||||
|
# There is no technical support for this script, neither am I a #
|
||||||
|
# professional programmer. Refer to 'HELPME.TXT' for further guidance. #
|
||||||
|
# #
|
||||||
|
########################################################################
|
||||||
|
|
||||||
|
sub checkCfg # Maintain hit.log, hitx.dat and hit.cfg
|
||||||
|
{
|
||||||
|
open (CFG,"+<$HITCFG") || &endIt;
|
||||||
|
flock (CFG,2); seek (CFG,0,0);
|
||||||
|
$cfgFile = <CFG>;
|
||||||
|
($logDay,$datMonth,$cntMonth,$cntFlag,$eol) = split (/\|/,$cfgFile);
|
||||||
|
|
||||||
|
# If not done since midnight ...
|
||||||
|
|
||||||
|
# If new day, add daily hits to month file
|
||||||
|
if ($logDay != $dayStamp)
|
||||||
|
{ &newDay;
|
||||||
|
}
|
||||||
|
# If new month, empty last year's month file and update cfg
|
||||||
|
if ($datMonth+0 != $month)
|
||||||
|
{ &newMonth;
|
||||||
|
}
|
||||||
|
# If new count, recount hits since cntMonth
|
||||||
|
if ($cntFlag eq 'Y')
|
||||||
|
{ require "./hitxbm.pl";
|
||||||
|
&newCount;
|
||||||
|
}
|
||||||
|
close (CFG);
|
||||||
|
} # end checkCfg
|
||||||
|
|
||||||
|
sub newDay
|
||||||
|
{
|
||||||
|
$HITDAT = "$HITMON$datMonth.dat";
|
||||||
|
@dyinMon = (0,31,28,31,30,31,30,31,31,30,31,30,31);
|
||||||
|
$dyinMon = $dyinMon[$datMonth];
|
||||||
|
|
||||||
|
open (DAT,"+<$HITDAT") || &endIt;
|
||||||
|
flock (DAT,2); seek (DAT,0,0);
|
||||||
|
@hitDat = <DAT>;
|
||||||
|
|
||||||
|
# Backup monthly data if trigger
|
||||||
|
if ($bakFlag eq 'Y' && ($jDate % $bakTime ==0) && !-e $HITBAK)
|
||||||
|
{ &backUp (@hitDat);
|
||||||
|
}
|
||||||
|
|
||||||
|
# add this month's hits to Tbl hash
|
||||||
|
foreach $hitLine (@hitDat)
|
||||||
|
{ @hits = split (/\|/,$hitLine);
|
||||||
|
$page = $hits[0];
|
||||||
|
|
||||||
|
$Tbl{$page}[0] = $page;
|
||||||
|
for $day (1..$dyinMon)
|
||||||
|
{ $Tbl{$page}[$day] += $hits[$day];
|
||||||
|
}
|
||||||
|
$Index{$page} = 'Y';
|
||||||
|
}
|
||||||
|
|
||||||
|
# Read log file
|
||||||
|
open (LOG1,"+<$HITLOG1") || &endIt;
|
||||||
|
flock (LOG1,2); seek (LOG1,0,0);
|
||||||
|
@logFile = <LOG1>;
|
||||||
|
|
||||||
|
# add yesterday's hits to Tbl hash
|
||||||
|
foreach $logLine (@logFile)
|
||||||
|
{ @log = split (/\|/,$logLine,3);
|
||||||
|
$page = $log[1];
|
||||||
|
|
||||||
|
# must create new line if no previous hits
|
||||||
|
if (!$Tbl{$page}[0])
|
||||||
|
{ $Tbl{$page}[0] = $page;
|
||||||
|
for $day (1..$dyinMon)
|
||||||
|
{ $Tbl{$page}[$day] +=0;
|
||||||
|
}
|
||||||
|
$Index{$page} = 'Y';
|
||||||
|
}
|
||||||
|
$Tbl{$page}[$logDay]++;
|
||||||
|
|
||||||
|
# Count unique ip visitors per group on logday
|
||||||
|
# $group,$foo = split (/\+/,$page);
|
||||||
|
# if (!$Ip{$ENV{'REMOTE_ADDR'}}{$group}
|
||||||
|
# { $Ip{$ENV{'REMOTE_ADDR'}}{$group} = 'Y';
|
||||||
|
# $Tbl{"~IP\+$group"}[$logDay] ++;
|
||||||
|
# }
|
||||||
|
#
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
# write updated Tbl back to file
|
||||||
|
seek (DAT,0,0);
|
||||||
|
|
||||||
|
foreach $page (sort {uc($a) cmp uc($b)} keys %Index)
|
||||||
|
{ $line = '';
|
||||||
|
for $day (0..$dyinMon)
|
||||||
|
{ $line .= "$Tbl{$page}[$day]\|";
|
||||||
|
}
|
||||||
|
print DAT "$line\n";
|
||||||
|
}
|
||||||
|
truncate (DAT,tell(DAT)); close (DAT);
|
||||||
|
|
||||||
|
open (LOG2,">$HITLOG2") || &endIt;
|
||||||
|
flock (LOG2,2); seek (LOG2,0,0);
|
||||||
|
print (LOG2 @logFile);
|
||||||
|
truncate (LOG2,tell(LOG2)); close (LOG2);
|
||||||
|
|
||||||
|
truncate (LOG1,0); close (LOG1);
|
||||||
|
|
||||||
|
$logDay = $dayStamp;
|
||||||
|
&changeCfg;
|
||||||
|
|
||||||
|
} # end newDay
|
||||||
|
|
||||||
|
sub newMonth
|
||||||
|
{
|
||||||
|
# Empty last year's month file and update cfg if new month
|
||||||
|
$datMonth = $month;
|
||||||
|
$HITDAT = "$HITMON$datMonth.dat";
|
||||||
|
|
||||||
|
open (DAT,">$HITDAT") || &endIt;
|
||||||
|
flock (DAT,2);
|
||||||
|
truncate (DAT,0); close (DAT);
|
||||||
|
&changeCfg;
|
||||||
|
|
||||||
|
} # end newMonth
|
||||||
|
|
||||||
|
sub newCount
|
||||||
|
{
|
||||||
|
foreach $x (1..12)
|
||||||
|
{ if (($cntMonth <= $monthStamp && $x >= $cntMonth && $x <= $monthStamp)
|
||||||
|
|| ($cntMonth > $monthStamp && ($x <= $monthStamp || $x >= $cntMonth)))
|
||||||
|
{
|
||||||
|
$HITDAT = "$HITMON$x.dat";
|
||||||
|
open (DAT,"<$HITDAT") || &endIt;
|
||||||
|
flock (DAT,1); seek (DAT,0,0);
|
||||||
|
while ($hitLine = <DAT>)
|
||||||
|
{ @hits = split (/\|/,$hitLine);
|
||||||
|
$page = $hits[0];
|
||||||
|
foreach $day (1..31)
|
||||||
|
{ $PageTtl{$page} += $hits[$day];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
close (DAT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
# Create a new hit.cnt file with this data
|
||||||
|
while (($pagecode,$pagecount) = each %PageTtl)
|
||||||
|
{ $addLine = join ("\|",$pagecount,$pagecode,"\n");
|
||||||
|
push @inFile, $addLine;
|
||||||
|
}
|
||||||
|
@outFile = sort {($b =~ /(\d+)/)[0] <=> ($a =~ /(\d+)/)[0]} @inFile;
|
||||||
|
|
||||||
|
open (CNT,">$HITCNT") || &endIt;
|
||||||
|
flock (CNT,2); seek (CNT,0,0);
|
||||||
|
print (CNT @outFile);
|
||||||
|
truncate (CNT,tell(CNT));
|
||||||
|
close (CNT);
|
||||||
|
|
||||||
|
if ($monthStamp >= $cntMonth)
|
||||||
|
{ $year = $yearStamp +0;
|
||||||
|
} else
|
||||||
|
{ $year = $yearStamp -1;
|
||||||
|
}
|
||||||
|
&makeXbm ("$cntMonth".substr("$year",2,2),4,"$hitmatDir/$SINCEXBM");
|
||||||
|
|
||||||
|
$cntFlag = '';
|
||||||
|
&changeCfg;
|
||||||
|
} # end newCount
|
||||||
|
|
||||||
|
sub changeCfg # update hit cfg file
|
||||||
|
{
|
||||||
|
$cfgFile = join ("\|",$logDay,$datMonth,$cntMonth,$cntFlag,$eol);
|
||||||
|
seek (CFG,0,0);
|
||||||
|
print (CFG $cfgFile);
|
||||||
|
truncate (CFG,tell(CFG));
|
||||||
|
} # end changeCfg
|
||||||
|
|
||||||
|
sub backUp # Backup data and delete old backups
|
||||||
|
{
|
||||||
|
@bakData = @_;
|
||||||
|
open (BAK,">$HITBAK") || &endIt;
|
||||||
|
print (BAK @bakData);
|
||||||
|
close (BAK);
|
||||||
|
chmod 0666, $HITBAK;
|
||||||
|
|
||||||
|
opendir (BAKDIR,$bakDir);
|
||||||
|
@bakFiles = grep (/hit\d{3}\.bak/, readdir(BAKDIR));
|
||||||
|
closedir (BAKDIR);
|
||||||
|
|
||||||
|
foreach $bakFile (@bakFiles)
|
||||||
|
{ if (-M "$bakDir/$bakFile" > $bakMax) { unlink "$bakDir/$bakFile"; }
|
||||||
|
}
|
||||||
|
} # end backup
|
||||||
|
|
||||||
|
1; # return true
|
|
@ -0,0 +1,435 @@
|
||||||
|
#! /usr/local/bin/perl
|
||||||
|
#
|
||||||
|
# HITMAN - The HITMATIC Manager
|
||||||
|
# Displays and reports various hit count statistics.
|
||||||
|
#
|
||||||
|
# Filename: hitman.pl
|
||||||
|
# Last revised: March 15, 1998
|
||||||
|
# Copyright: 1997,1998 by Joe DePasquale
|
||||||
|
# E-Mail: crypt@getcruising.com
|
||||||
|
# Website: http://www.GetCruising.com
|
||||||
|
#
|
||||||
|
########################################################################
|
||||||
|
# #
|
||||||
|
# This script and accompanying files may be distributed freely #
|
||||||
|
# and modified, provided this header with my name, E-Mail address and #
|
||||||
|
# this notice remain intact. Ownership rights remain with me. You may #
|
||||||
|
# not sell this script without my approval. #
|
||||||
|
# #
|
||||||
|
# This script comes with no guarantee or warranty except for my good #
|
||||||
|
# intentions. By using this code you agree to indemnify me from any #
|
||||||
|
# liability that might arise from it's use. #
|
||||||
|
# #
|
||||||
|
# There is no technical support for this script, neither am I a #
|
||||||
|
# professional programmer. Refer to 'HELPME.TXT' for further guidance. #
|
||||||
|
# #
|
||||||
|
########################################################################
|
||||||
|
|
||||||
|
sub hitman {
|
||||||
|
|
||||||
|
@labels = ('Foo','Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');
|
||||||
|
@dyinMon = (0,31,28,31,30,31,30,31,31,30,31,30,31);
|
||||||
|
|
||||||
|
# Parse form input
|
||||||
|
read (STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
|
||||||
|
@cgiPairs = split(/&/,$buffer);
|
||||||
|
foreach $cgiPair (@cgiPairs)
|
||||||
|
{
|
||||||
|
($name, $value) = split(/=/,$cgiPair);
|
||||||
|
$name =~ s/\+/ /g; $value =~ s/\+/ /g;
|
||||||
|
$name =~ s/%(..)/pack("c",hex($1))/ge;
|
||||||
|
$value =~ s/%(..)/pack("c",hex($1))/ge;
|
||||||
|
$Form{$name} .= "\0" if (defined($Form{$name}));
|
||||||
|
$Form{$name} .= "$value";
|
||||||
|
}
|
||||||
|
undef $name; undef $value;
|
||||||
|
|
||||||
|
print "Content-type: text/html\n\n";
|
||||||
|
print "<html>\n<head><title>$headTitle</title></head>\n";
|
||||||
|
print "$bodyTag\n$bodyTitle<p>\n";
|
||||||
|
|
||||||
|
&passtest ($HITPWD);
|
||||||
|
print qq|<form action="$scriptUrl" method=POST>\n|;
|
||||||
|
print qq|<input type=hidden name=password value="$Form{'password'}">\n|;
|
||||||
|
|
||||||
|
########################################################################
|
||||||
|
# Case: View Hit stats by year
|
||||||
|
|
||||||
|
if ($Form{'hittable'})
|
||||||
|
{
|
||||||
|
if ($Form{'detail'} && $Form{'detail'} =~ /^(M|G|P)\|(.+)/)
|
||||||
|
{
|
||||||
|
if ($1 eq "M") # month
|
||||||
|
{ $month = $2;
|
||||||
|
print "<font size=4><b>Hits By MONTH for: $labels[$month] ";
|
||||||
|
if ($monthStamp >= $month) {$year = $yearStamp +0;} else {$year = $yearStamp -1;}
|
||||||
|
print "$year</b></font><br>\n";
|
||||||
|
if ($year %4 == 0) { $dyinMon[2] = 29; }
|
||||||
|
|
||||||
|
# Read all data into hashes
|
||||||
|
$total = 0;
|
||||||
|
|
||||||
|
$HITDAT = "$HITMON$month.dat";
|
||||||
|
open (DAT,"<$HITDAT") || &endMan ("Read: $HITDAT");
|
||||||
|
flock (DAT,1); seek (DAT,0,0);
|
||||||
|
|
||||||
|
while ($line = <DAT>)
|
||||||
|
{ @hits = split (/\|/,$line);
|
||||||
|
$page = $hits[0];
|
||||||
|
if ($page =~ /(.+)\+(.+)/) { $group =$1; }
|
||||||
|
|
||||||
|
foreach $day (1..$dyinMon[$month])
|
||||||
|
{ $Tbl{$page}{$day} += $hits[$day];
|
||||||
|
$PageTtl{$page} += $hits[$day];
|
||||||
|
if ($group)
|
||||||
|
{ $Tbl{$group}{$day} += $hits[$day];
|
||||||
|
$GroupTtl{$group} += $hits[$day];
|
||||||
|
}
|
||||||
|
$DayTtl{$day} += $hits[$day];
|
||||||
|
}
|
||||||
|
$total += $PageTtl{$page};
|
||||||
|
}
|
||||||
|
close (DAT);
|
||||||
|
|
||||||
|
@pages = sort {$PageTtl{$b} <=> $PageTtl{$a}} keys %PageTtl;
|
||||||
|
@groups = sort {$GroupTtl{$b} <=> $GroupTtl{$a}} keys %GroupTtl;
|
||||||
|
|
||||||
|
print qq|<table border=$border width=50%><tr align=center>\n|;
|
||||||
|
print qq|<td align=left><input type=reset value="RESET"><br><font color="#009900"><b>Days:</b></font></td>\n|;
|
||||||
|
|
||||||
|
foreach $day (1..$dyinMon[$month]) { print qq|<td><font color="#009900"><b>$day</b></font></td>|; }
|
||||||
|
print qq|<td><font color="#0000FF"><b>Group<br>/Page<br>Totals</b></font></td>|;
|
||||||
|
|
||||||
|
# print group hit rows
|
||||||
|
print qq|\n</tr><tr>\n<td><b>GROUPS:</b></td><td colspan=|,($dyinMon[$month]-1),qq|></td>|;
|
||||||
|
|
||||||
|
foreach $group (@groups)
|
||||||
|
{ print qq|\n</tr><tr align=right>\n<td align=left> <input type=radio name=detail value="G\|$group"><font color="#0000FF">$group</font></td>|;
|
||||||
|
foreach $day (1..$dyinMon[$month]) { print qq|<td>$Tbl{$group}{$day}</td>|; }
|
||||||
|
print qq|<td>$GroupTtl{$group}</td>|;
|
||||||
|
}
|
||||||
|
# print page hit rows
|
||||||
|
print qq|\n</tr><tr>\n<td><b>PAGES:</b></td><td colspan=|,($dyinMon[$month]-1),qq|></td>|;
|
||||||
|
|
||||||
|
foreach $page (@pages)
|
||||||
|
{ print qq|\n</tr><tr align=right>\n<td align=left> <input type=radio name=detail value="P\|$page"><font color="#0000FF">$page</font></td>|;
|
||||||
|
foreach $day (1..$dyinMon[$month]) { print qq|<td>$Tbl{$page}{$day}</td>|; }
|
||||||
|
print qq|<td>$PageTtl{$page}</td>|;
|
||||||
|
}
|
||||||
|
print qq|\n</tr><tr align=right>\n<td nowrap align=center><font color="#009900"><b>Day Totals</b></font></td>|;
|
||||||
|
|
||||||
|
foreach $day (1..$dyinMon[$month]) { print qq|<td>$DayTtl{$day}</td>|; }
|
||||||
|
print qq|<th>$total</th>|;
|
||||||
|
print qq|\n</tr></table><br>Completed on $timeStamp\n<p>\n|;
|
||||||
|
}
|
||||||
|
else # group or page
|
||||||
|
{
|
||||||
|
print "<font size=4><b>Hits By ";
|
||||||
|
if ($1 eq "G")
|
||||||
|
{ $group = $2;
|
||||||
|
print "GROUP for "$group"";
|
||||||
|
} else
|
||||||
|
{ $page = $2;
|
||||||
|
print "PAGE for "$page"";
|
||||||
|
}
|
||||||
|
print "</b></font><br>\n";
|
||||||
|
|
||||||
|
# Read all data into hashes
|
||||||
|
$total = 0;
|
||||||
|
|
||||||
|
foreach $month (1..12)
|
||||||
|
{ $MonthTtl{$month} =0;
|
||||||
|
$HITDAT = "$HITMON$month.dat";
|
||||||
|
open (DAT,"<$HITDAT") || &endMan ("Read: $HITDAT");
|
||||||
|
flock (DAT,1); seek (DAT,0,0);
|
||||||
|
while ($line = <DAT>)
|
||||||
|
{ @hits = split (/\|/,$line);
|
||||||
|
if ($hits[0] eq $page || $hits[0] =~ /^$group\+/)
|
||||||
|
{ foreach $day (1..31)
|
||||||
|
{ $Tbl{$month}{$day} += $hits[$day];
|
||||||
|
$DayTtl{$day} += $hits[$day];
|
||||||
|
$MonthTtl{$month} += $Tbl{$month}{$day};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
close (DAT);
|
||||||
|
$total += $MonthTtl{$month};
|
||||||
|
}
|
||||||
|
print "<table border=$border><tr align=center>\n";
|
||||||
|
print "<td align=left><input type=reset value=\"RESET\"><br><font color=\"#009900\"><b>Months:</b></font></td>\n";
|
||||||
|
|
||||||
|
# Print col headers and order the months
|
||||||
|
$month = $monthStamp;
|
||||||
|
do
|
||||||
|
{ if ($month == 12) {$month =1;} else {$month++;}
|
||||||
|
print "<td><input type=radio name=detail value=\"M\|$month\"><br><font color=\"#009900\"><b>$labels[$month]</b><br>";
|
||||||
|
if ($month > $monthStamp) {$year = $yearStamp -1;} else {$year = $yearStamp +0;}
|
||||||
|
print "$year</font></td>\n";
|
||||||
|
push @monthCol, $month;
|
||||||
|
} until ($month == $monthStamp);
|
||||||
|
print "<td><font color=\"#0000FF\"><b>Day<br>Totals</b></font></td>";
|
||||||
|
|
||||||
|
foreach $day (1..31)
|
||||||
|
{ print "\n</tr><tr align=right>\n<td><font color=\"#0000FF\"><b>$day</b></font></td>";
|
||||||
|
foreach $month (@monthCol) { print "<td>$Tbl{$month}{$day}</td>"; }
|
||||||
|
print "<td>$DayTtl{$day}</td>";
|
||||||
|
}
|
||||||
|
print "\n</tr><tr align=right>\n<td nowrap align=center><font color=\"#009900\"><b>Month Totals</b></font></td>";
|
||||||
|
|
||||||
|
foreach $month (@monthCol) { print "<td>$MonthTtl{$month}</td>"; }
|
||||||
|
print "<th>$total</th>";
|
||||||
|
print "\n</tr></table><br>Completed on $timeStamp\n<p>\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else # default by year
|
||||||
|
{
|
||||||
|
print "<font size=4><b>Hits By YEAR as of $timeStamp</b></font><br>\n";
|
||||||
|
# Read all data into hashes
|
||||||
|
$total = 0;
|
||||||
|
foreach $month (1..12)
|
||||||
|
{ $MonthTtl{$month} =0;
|
||||||
|
|
||||||
|
$HITDAT = "$HITMON$month.dat";
|
||||||
|
open (DAT,"<$HITDAT") || &endMan ("Read: $HITDAT");
|
||||||
|
flock (DAT,1); seek (DAT,0,0);
|
||||||
|
while ($line = <DAT>)
|
||||||
|
{ @hits = split (/\|/,$line);
|
||||||
|
$page = $hits[0];
|
||||||
|
if ($page =~ /(.+)\+(.+)/) { $group =$1; }
|
||||||
|
$Tbl{$month}{$page} =0;
|
||||||
|
|
||||||
|
foreach $day (1..31)
|
||||||
|
{ $Tbl{$month}{$page} += $hits[$day];
|
||||||
|
}
|
||||||
|
$PageTtl{$page} += $Tbl{$month}{$page};
|
||||||
|
$MonthTtl{$month} += $Tbl{$month}{$page};
|
||||||
|
|
||||||
|
if ($group)
|
||||||
|
{ $Tbl{$month}{$group} += $Tbl{$month}{$page};
|
||||||
|
$GroupTtl{$group} += $Tbl{$month}{$page};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
close (DAT);
|
||||||
|
$total += $MonthTtl{$month};
|
||||||
|
}
|
||||||
|
# Sort by descending page total
|
||||||
|
@pages = sort {$PageTtl{$b} <=> $PageTtl{$a}} keys %PageTtl;
|
||||||
|
@groups = sort {$GroupTtl{$b} <=> $GroupTtl{$a}} keys %GroupTtl;
|
||||||
|
|
||||||
|
print "<table border=$border><tr align=center>\n";
|
||||||
|
print "<td align=left><input type=reset value=\"RESET\"><br><font color=\"#009900\"><b>Months:</b></font></td>\n";
|
||||||
|
|
||||||
|
# Print col headers and order the months
|
||||||
|
$month = $monthStamp;
|
||||||
|
do
|
||||||
|
{ if ($month == 12) {$month =1;} else {$month++;}
|
||||||
|
print "<td><input type=radio name=detail value=\"M\|$month\"><br><font color=\"#009900\"><b>$labels[$month]</b><br>";
|
||||||
|
if ($month > $monthStamp) {$year = $yearStamp -1;} else {$year = $yearStamp +0;}
|
||||||
|
print "$year</font></td>\n";
|
||||||
|
push @monthCol, $month;
|
||||||
|
} until ($month == $monthStamp);
|
||||||
|
print "<td><font color=\"#0000FF\"><b>Group<br>/Page<br>Totals</b></font></td>";
|
||||||
|
|
||||||
|
# print group hit rows
|
||||||
|
print "\n</tr><tr>\n<td><b>GROUPS:</b></td><td colspan=13></td>";
|
||||||
|
foreach $group (@groups)
|
||||||
|
{ print "\n</tr><tr align=right>\n<td align=left><input type=radio name=detail value=\"G\|$group\"><font color=\"#0000FF\">$group</font></td>";
|
||||||
|
foreach $month (@monthCol) { print "<td>$Tbl{$month}{$group}</td>"; }
|
||||||
|
print "<td>$GroupTtl{$group}</td>";
|
||||||
|
}
|
||||||
|
|
||||||
|
# print page hit rows
|
||||||
|
print "\n</tr><tr>\n<td><b>PAGES:</b></td><td colspan=13></td>";
|
||||||
|
foreach $page (@pages)
|
||||||
|
{ print "\n</tr><tr align=right>\n<td align=left><input type=radio name=detail value=\"P\|$page\"><font color=\"#0000FF\">$page</font></td>";
|
||||||
|
foreach $month (@monthCol) { print "<td>$Tbl{$month}{$page}</td>"; }
|
||||||
|
print "<td>$PageTtl{$page}</td>";
|
||||||
|
}
|
||||||
|
# print month subtotal row
|
||||||
|
print "\n</tr><tr align=right>\n<td nowrap align=center><font color=\"#009900\"><b>Month Totals</b></font></td>";
|
||||||
|
|
||||||
|
foreach $month (@monthCol) { print "<td>$MonthTtl{$month}</td>"; }
|
||||||
|
print "<th>$total</th>";
|
||||||
|
print "\n</tr></table><p>\n";
|
||||||
|
} # end default by year
|
||||||
|
|
||||||
|
print <<__HITFORM;
|
||||||
|
<table border=0 width=300>
|
||||||
|
<tr><td><font color="#0000FF" size=5><b>Hit Tables</b></font></td></tr>
|
||||||
|
<tr><td>For more detail select any <b>MONTH, GROUP or PAGE</b> button above, then..</td></tr>
|
||||||
|
<tr><td>PRESS: <input type=submit name=hittable value=" HIT TABLES "></td></tr>
|
||||||
|
<tr><td><font color="#0000FF" size=5><b>Hit Counter</b></font></td></tr>
|
||||||
|
<tr><td>For the count <b>DISPLAYED</b> to users or to <b>RESET</b> counter date..</td></tr>
|
||||||
|
<tr><td>PRESS: <input type=submit value="HIT COUNTER"></td></tr>
|
||||||
|
</table>
|
||||||
|
__HITFORM
|
||||||
|
&manFooter;
|
||||||
|
} # end case hittable
|
||||||
|
|
||||||
|
########################################################################
|
||||||
|
# Case: Flag to reset hitcount at next daily maintenance
|
||||||
|
|
||||||
|
elsif ($Form{'resetcount'})
|
||||||
|
{
|
||||||
|
open (LOCK,">$HITFLK") || &endMan ("Write: $HITFLK");
|
||||||
|
if (!flock (LOCK,2)) { &endMan ("Lock: $HITFLK"); }
|
||||||
|
|
||||||
|
# Write new cnt date to CFG
|
||||||
|
open (CFG,"+<$HITCFG") || &endMan ("Read\/Write: $HITCFG");
|
||||||
|
flock (CFG,2); seek (CFG,0,0);
|
||||||
|
$cfgFile = <CFG>;
|
||||||
|
($logDay,$datMonth,$cntMonth,$cntFlag,$eol) = split (/\|/,$cfgFile);
|
||||||
|
|
||||||
|
$cntMonth = $Form{'setmonth'} +0;
|
||||||
|
$cntFlag = 'Y';
|
||||||
|
$cfgFile = join ("\|",$logDay,$datMonth,$cntMonth,$cntFlag,$eol);
|
||||||
|
|
||||||
|
seek (CFG,0,0);
|
||||||
|
print (CFG $cfgFile);
|
||||||
|
truncate (CFG,tell(CFG)); close (CFG);
|
||||||
|
close (LOCK);
|
||||||
|
|
||||||
|
print "<b>Hit Counter</b> will be reset at next daily maintenance<br>\n to <b>$labels[$cntMonth] 1, $year</b>\n<p>\n";
|
||||||
|
|
||||||
|
&hitCount;
|
||||||
|
&manFooter;
|
||||||
|
} # end resetcount
|
||||||
|
|
||||||
|
########################################################################
|
||||||
|
# Default Case: Display hitcount
|
||||||
|
|
||||||
|
else
|
||||||
|
{ &hitCount;
|
||||||
|
&manFooter;
|
||||||
|
} # end default
|
||||||
|
} # end hitman
|
||||||
|
|
||||||
|
########################################################################
|
||||||
|
|
||||||
|
sub hitCount # Display hitcount
|
||||||
|
{
|
||||||
|
open (CNT,"<$HITCNT") || &endMan ("Read: $HITCNT");
|
||||||
|
flock (CNT,1); seek (CNT,0,0);
|
||||||
|
@hitFile = <CNT>;
|
||||||
|
close (CNT);
|
||||||
|
|
||||||
|
print "<table border=$border><tr>\n<th>HITS</th><th>by PAGECODE</th>\n";
|
||||||
|
$hitTtl =0;
|
||||||
|
for ($x=0; $x<=$#hitFile; $x++)
|
||||||
|
{ print "\n</tr><tr>\n";
|
||||||
|
($count,$code,$eol) = split (/\|/,$hitFile[$x]);
|
||||||
|
if ($code =~/\+/)
|
||||||
|
{ ($group,$page) = split (/\+/,$code);
|
||||||
|
$GroupTtl{$group} += $count;
|
||||||
|
}
|
||||||
|
print "<td align=right>$count</td><td>$code</td>";
|
||||||
|
$hitTtl = $hitTtl + $count;
|
||||||
|
}
|
||||||
|
print "\n</tr></table><p>\n";
|
||||||
|
|
||||||
|
if ($group)
|
||||||
|
{ print "<table border=$border><tr>\n<th>HITS</th><th>by GROUP</th>\n";
|
||||||
|
@groups = sort {$GroupTtl{$b} <=> $GroupTtl{$a}} keys %GroupTtl;
|
||||||
|
foreach $group (@groups)
|
||||||
|
{ print "\n</tr><tr>\n";
|
||||||
|
print "<td align=right>$GroupTtl{$group}</td><td>$group</td>";
|
||||||
|
}
|
||||||
|
print "\n</tr></table><p>\n";
|
||||||
|
}
|
||||||
|
open (CFG,"<$HITCFG") || &endMan ("Read: $HITCNT");
|
||||||
|
flock (CFG,1); seek (CFG,0,0);
|
||||||
|
$cfgFile = <CFG>;
|
||||||
|
close (CFG);
|
||||||
|
|
||||||
|
($logDay,$datMonth,$cntMonth,$cntFlag,$eol) = split (/\|/,$cfgFile);
|
||||||
|
|
||||||
|
print "<b>Total: $hitTtl hits for $x pages since $labels[$cntMonth] 1, ";
|
||||||
|
if ($monthStamp >= $cntMonth) {$year = $yearStamp +0;} else {$year = $yearStamp -1;}
|
||||||
|
print "$year</b>\n<br>Completed at $timeStamp\n<p>\n";
|
||||||
|
|
||||||
|
print qq|<table border=0 width=300>\n<tr><td><font color="#0000FF"><font size=5><b>Hit Counter</b></font></font></td</tr>\n|;
|
||||||
|
print qq|<tr><td>To reset the counter and starting date, select a starting <b>MONTH</b> and press <b>CHANGE</b>. A new image of the <b>SINCE</b> date will also be created.</td></tr>\n|;
|
||||||
|
print qq|<tr><td>SINCE: <select name=setmonth size=1>\n|;
|
||||||
|
for $x (1..12)
|
||||||
|
{ if ($x == $cntMonth)
|
||||||
|
{ print "<option value=$x selected>$labels[$x]\n";
|
||||||
|
} else
|
||||||
|
{ print "<option value=$x>$labels[$x]\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
print qq|</select> \n<input type=submit name=resetcount value="CHANGE"> \n|;
|
||||||
|
print qq|<input type=submit value=" CLEAR "></td></tr>\n|;
|
||||||
|
|
||||||
|
print qq|<tr><td><font color="#0000FF"><font size=5><b>Hit Tables</b></font></font></td></tr>\n|;
|
||||||
|
print qq|<tr><td>For ALL hits by <b>MONTH, GROUP or PAGE</b></td></tr>\n|;
|
||||||
|
print qq|<tr><td>PRESS: <input type=submit name=hittable value=" HIT TABLES "></td></tr>\n</table>\n|;
|
||||||
|
} # end hitCount
|
||||||
|
|
||||||
|
sub manFooter # print hitman footer
|
||||||
|
{
|
||||||
|
print qq|</form><p>\n<a href="$exitUrl">Exit $headTitle</a>\n|;
|
||||||
|
print qq|<p><font size=2><i><b>HITMATIC</b> is one of <a href="http://www.GetCruising.com/crypt" target="_top">Joe's CGI Scripts From The Crypt!</a></i></font>\n|;
|
||||||
|
print qq|<p>\n</body></html>\n|;
|
||||||
|
} # end manFooter
|
||||||
|
|
||||||
|
sub passtest # password routines
|
||||||
|
{
|
||||||
|
$PASSFILE = $_[0];
|
||||||
|
if (-s $PASSFILE)
|
||||||
|
{ if ($Form{'password'})
|
||||||
|
{ open (PASS,"<$PASSFILE");
|
||||||
|
$passcode = <PASS>;
|
||||||
|
close (PASS);
|
||||||
|
chop ($passcode) if $passcode =~ /\n$/;
|
||||||
|
$lp = length $Form{'password'};
|
||||||
|
$salt = substr($Form{'password'},$lp-2,1).substr($Form{'password'},1,1);
|
||||||
|
if ($passcode eq crypt ($Form{'password'},$salt))
|
||||||
|
{ if ($Form{'newpassword'})
|
||||||
|
{ $lp = length $Form{'newpassword'};
|
||||||
|
if ($Form{'newpassword'} =~ /^\w{$lp}\b/)
|
||||||
|
{ $Form{'password'} = $Form{'newpassword'};
|
||||||
|
$salt = substr($Form{'password'},$lp-2,1).substr($Form{'password'},1,1);
|
||||||
|
$passcode = crypt ($Form{'password'},$salt);
|
||||||
|
open (PASS,">$PASSFILE");
|
||||||
|
print PASS "$passcode";
|
||||||
|
close (PASS);
|
||||||
|
} else
|
||||||
|
{ &passbox ("Bad choice, Creep!!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
{ &passbox ("Wrong, Creep!!");
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
{ &passbox ("What's the Password, Creep?");
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
{ &endMan ("Password File $PASSFILE Not Found");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
sub passbox
|
||||||
|
{
|
||||||
|
print <<__PASSBOX;
|
||||||
|
<form action="$scriptUrl" method="POST">
|
||||||
|
<input type=hidden name=manager value=1><table border=4>
|
||||||
|
<tr><th colspan=2><font color="#FF0000"><b><blink>$_[0]</blink></b></font></th></tr>
|
||||||
|
<tr><th> Enter Password:</td><th><input type=password name=password size=12 maxlength=12></th></tr>
|
||||||
|
<tr><th>Change Password:</td><th><input type=text name=newpassword size=12 maxlength=12></th></tr>
|
||||||
|
<th colspan=2><input type=submit value=" DO IT! "><input type=reset value=" CLEAR "></th></tr>
|
||||||
|
</table><br>
|
||||||
|
Password must be 4 to 12 alpha-numeric characters.</form>
|
||||||
|
<p></body></html>
|
||||||
|
__PASSBOX
|
||||||
|
exit;
|
||||||
|
} # end passbox
|
||||||
|
|
||||||
|
sub endMan # Error handling for manager scripts
|
||||||
|
{
|
||||||
|
print "<font color=\"#FF0000\"><b>ERROR:</font><br>$_[0]</b>\n<p>";
|
||||||
|
if ($!) { print "Server made a Boo-Boo! $!\n"; }
|
||||||
|
else { print "Use your browser's [BACK] button and try again.\n"; }
|
||||||
|
print "<p></body></html>\n";
|
||||||
|
exit;
|
||||||
|
} # end endMan
|
||||||
|
|
||||||
|
1; # return true
|
|
@ -0,0 +1,223 @@
|
||||||
|
#! /usr/local/bin/perl -w
|
||||||
|
#
|
||||||
|
# HITMATIC
|
||||||
|
# Maintains counts for a page or all pages and logs accesses.
|
||||||
|
# Can optionally output the count to the browser.
|
||||||
|
#
|
||||||
|
# Filename: hitmat.cgi
|
||||||
|
# Last revised: July 08, 1998
|
||||||
|
# Copyright: 1996-1998 by Joe DePasquale
|
||||||
|
# E-Mail: crypt@getcruising.com
|
||||||
|
# Website: http://www.GetCruising.com
|
||||||
|
#
|
||||||
|
########################################################################
|
||||||
|
# #
|
||||||
|
# This script and accompanying files may be distributed freely #
|
||||||
|
# and modified, provided this header with my name, E-Mail address and #
|
||||||
|
# this notice remain intact. Ownership rights remain with me. You may #
|
||||||
|
# not sell this script without my approval. #
|
||||||
|
# #
|
||||||
|
# This script comes with no guarantee or warranty except for my good #
|
||||||
|
# intentions. By using this code you agree to indemnify me from any #
|
||||||
|
# liability that might arise from it's use. #
|
||||||
|
# #
|
||||||
|
# There is no technical support for this script, neither am I a #
|
||||||
|
# professional programmer. Refer to 'HELPME.TXT' for further guidance. #
|
||||||
|
# #
|
||||||
|
########################################################################
|
||||||
|
#
|
||||||
|
# 2. CONFIGURE SCRIPT -
|
||||||
|
#
|
||||||
|
# Change these sample paths to the actual paths on your server:
|
||||||
|
|
||||||
|
# Your Unix system date command
|
||||||
|
$dateCmd = '/bin/date';
|
||||||
|
|
||||||
|
# Unix path to hitmat directory
|
||||||
|
$hitmatDir = '/users/largo1/czo/cvslargo/www/cgi-bin/czo/hit';
|
||||||
|
|
||||||
|
# URL path to hitmat.cgi
|
||||||
|
$scriptUrl = 'http://asim.lip6.fr/cgi-bin/czo/hit/hitmat.cgi';
|
||||||
|
|
||||||
|
# URL path to hitmat directory
|
||||||
|
$hitmatUrl = 'http://asim.lip6.fr/cgi-bin/czo/hit/';
|
||||||
|
|
||||||
|
# Go to this URL when exiting manager
|
||||||
|
$exitUrl = 'http://asim.lip6.fr/';
|
||||||
|
|
||||||
|
# Log will record hit but exclude domain names matching this tail
|
||||||
|
$myTail = '.li.fr';
|
||||||
|
|
||||||
|
# OPTIONAL - You can edit these variables if desired:
|
||||||
|
|
||||||
|
# File Maintenance is triggered each day when the FIRST HIT between
|
||||||
|
# midnight and $trigHour is received. This will 1) swap 'hit1.log' and
|
||||||
|
# 'hit2.log' and 2) initialize a 'hitx.dat' file on the first day of a
|
||||||
|
# month. You can use any 24-hour time from 1 (1 AM) to 23 (11 PM).
|
||||||
|
$trigHour = 06;
|
||||||
|
|
||||||
|
$headTitle = "HITMATIC Website Counter System";
|
||||||
|
$bodyTag = qq|<body bgcolor="#FFFFFF" text="#000099" link="#0000FF" alink="#FFFF00" vlink="#990000">|;
|
||||||
|
$bodyTitle = qq|i><b><font size=5><font color="#0000FF">HIT</font><font color="#FF9900">MATIC</font></font></b></i>|;
|
||||||
|
|
||||||
|
# Change the table border size? (0 = no border)
|
||||||
|
$border = 0;
|
||||||
|
|
||||||
|
# If you DON'T want to backup the hit*.dat files, set $bakFlag to 'N',
|
||||||
|
# otherwise set the correct values in the 'if' loop ..
|
||||||
|
$bakFlag = 'Y';
|
||||||
|
|
||||||
|
if ($bakFlag eq 'Y')
|
||||||
|
{ $bakTime = 1; # days btwn backups
|
||||||
|
$bakMax = 7; # days to keep backups
|
||||||
|
|
||||||
|
# Unix path to backup directory
|
||||||
|
$bakDir = '/usr/home/you/htdocs/bak';
|
||||||
|
|
||||||
|
# END OF INSTALLATION - SHOULD NOT CHANGE STUFF BELOW THIS LINE
|
||||||
|
########################################################################
|
||||||
|
|
||||||
|
chop ($jDate = `$dateCmd +"%j"`);
|
||||||
|
$HITBAK = "$bakDir/hit$jDate.bak";
|
||||||
|
}
|
||||||
|
chop ($dayStamp = `$dateCmd +"%e"`); $dayStamp =~ s/\s*//g;
|
||||||
|
chop ($hourStamp = `$dateCmd +"%H"`);
|
||||||
|
chop ($timeStamp = `$dateCmd +"%a %D %H%M%Z"`);
|
||||||
|
chop ($dateStamp = `$dateCmd +"%Y%m%d"`);
|
||||||
|
$yearStamp = substr ($dateStamp,0,4);
|
||||||
|
$monthStamp = substr ($dateStamp,4,2);
|
||||||
|
$month = $monthStamp +0;
|
||||||
|
|
||||||
|
$HITCFG = "$hitmatDir/hit.cfg";
|
||||||
|
$HITCNT = "$hitmatDir/hit.cnt";
|
||||||
|
$HITDAT = "$hitmatDir/hit$month.dat";
|
||||||
|
$HITFLK = "$hitmatDir/hit.flk";
|
||||||
|
$HITLOG1 = "$hitmatDir/hit1.log";
|
||||||
|
$HITLOG2 = "$hitmatDir/hit2.log";
|
||||||
|
$HITMON = "$hitmatDir/hit";
|
||||||
|
$HITXBM = "$hitmatDir/hit.xbm";
|
||||||
|
$SINCEXBM = "since.xbm";
|
||||||
|
|
||||||
|
########################################################################
|
||||||
|
# Read GET or POST input and setup stuff
|
||||||
|
|
||||||
|
if (-e "./referer.pl")
|
||||||
|
{ require "./referer.pl";
|
||||||
|
&referer;
|
||||||
|
}
|
||||||
|
if ($ENV{'QUERY_STRING'} eq 'manager' || $ENV{'REQUEST_METHOD'} eq 'POST')
|
||||||
|
{ require "./hitman.pl";
|
||||||
|
require "./hitxbm.pl";
|
||||||
|
$HITPWD = "$hitmatDir/hitmat.pwd";
|
||||||
|
&hitman;
|
||||||
|
exit;
|
||||||
|
} elsif ($ENV{'QUERY_STRING'} =~ /(\S+?)(\+(\S))?=(\S+?)(&.*|$)/)
|
||||||
|
{ $pagecode =$1; $group =$3; $command =$4;
|
||||||
|
if ($group) { $pagecode = "$group\+$pagecode"; }
|
||||||
|
} else
|
||||||
|
{ &endIt;
|
||||||
|
}
|
||||||
|
|
||||||
|
open (LOCK,">$HITFLK") || &endIt;
|
||||||
|
if (!flock (LOCK,2)) { &endIt; }
|
||||||
|
|
||||||
|
# Daily maintenance if trigger time
|
||||||
|
if ($hourStamp < $trigHour)
|
||||||
|
{ require "./hitcfg.pl";
|
||||||
|
&checkCfg;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Add hit to main counter
|
||||||
|
open (CNT,"+<$HITCNT") || &endIt;
|
||||||
|
flock (CNT,2); seek (CNT,0,0);
|
||||||
|
@inFile = <CNT>;
|
||||||
|
$recNbr = 0; $foundFlag = 'N';
|
||||||
|
|
||||||
|
while (($recNbr <= $#inFile) && ($foundFlag eq 'N'))
|
||||||
|
{ ($count,$code,$eol) = split(/\|/,$inFile[$recNbr]);
|
||||||
|
if ($code eq $pagecode)
|
||||||
|
{ if ($count < 999999) {$count++;} else {$count =1;}
|
||||||
|
$inFile[$recNbr] = join ("\|",$count,$pagecode,"\n");
|
||||||
|
$foundFlag = 'Y';
|
||||||
|
}
|
||||||
|
$recNbr++;
|
||||||
|
}
|
||||||
|
if ($foundFlag eq 'N') # new page
|
||||||
|
{ $count =1;
|
||||||
|
$addLine = join ("\|",$count,$pagecode,"\n");
|
||||||
|
push @inFile, $addLine;
|
||||||
|
}
|
||||||
|
@outFile = sort {($b =~ /(\d+)/)[0] <=> ($a =~ /(\d+)/)[0]} @inFile;
|
||||||
|
|
||||||
|
seek (CNT,0,0);
|
||||||
|
print (CNT @outFile);
|
||||||
|
truncate (CNT,tell(CNT)); close (CNT);
|
||||||
|
|
||||||
|
# Make the XBM image according to COMMAND
|
||||||
|
if ($command eq "PAGE")
|
||||||
|
{ require "./hitxbm.pl";
|
||||||
|
&makeXbm ($count,6,$HITXBM);
|
||||||
|
}
|
||||||
|
elsif ($command eq "GROUP")
|
||||||
|
{ require "./hitxbm.pl";
|
||||||
|
open (CNT,"<$HITCNT") || &endIt;
|
||||||
|
flock (CNT,1); seek (CNT,0,0);
|
||||||
|
@inFile = <CNT>;
|
||||||
|
close (CNT);
|
||||||
|
$groupTtl = 0;
|
||||||
|
foreach $inLine (@inFile)
|
||||||
|
{ if ($inLine =~ /^\d+\|$group\+/)
|
||||||
|
{ ($count,$code,$eol,) = split(/\|/,$inLine);
|
||||||
|
$groupTtl += $count;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&makeXbm ($groupTtl,6,$HITXBM);
|
||||||
|
}
|
||||||
|
elsif ($command eq "SITE")
|
||||||
|
{ require "./hitxbm.pl";
|
||||||
|
open (CNT,"<$HITCNT") || &endIt;
|
||||||
|
flock (CNT,1); seek (CNT,0,0);
|
||||||
|
@inFile = <CNT>;
|
||||||
|
close (CNT);
|
||||||
|
$siteTtl = 0;
|
||||||
|
foreach $inLine (@inFile)
|
||||||
|
{ ($count,$code,$eol,) = split(/\|/,$inLine);
|
||||||
|
$siteTtl += $count;
|
||||||
|
}
|
||||||
|
&makeXbm ($siteTtl,6,$HITXBM);
|
||||||
|
}
|
||||||
|
elsif ($command eq "NONE")
|
||||||
|
{ open (XBM,">$HITXBM");
|
||||||
|
flock (XBM,2); seek (XBM,0,0);
|
||||||
|
print (XBM "#define hit_width 1\n");
|
||||||
|
print (XBM "#define hit_height 1\n");
|
||||||
|
print (XBM "static char hit_bits[] = { 0x00 };\n");
|
||||||
|
truncate (XBM,tell(XBM));
|
||||||
|
close (XBM);
|
||||||
|
}
|
||||||
|
# Send the XBM image to Stdout
|
||||||
|
if ($command ne "IMG")
|
||||||
|
{ print "Content-type: image/x-xbitmap\n\n";
|
||||||
|
print `cat $HITXBM`;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Record hit in the log
|
||||||
|
$hitLine = join ("\|",$timeStamp,$pagecode,$command,$banNbr,$ENV{'REMOTE_HOST'},$ENV{'HTTP_USER_AGENT'});
|
||||||
|
if ($ENV{'HTTP_REFERER'} !~ /$myTail/i)
|
||||||
|
{ $hitLine .= "\|$ENV{'HTTP_REFERER'}";
|
||||||
|
}
|
||||||
|
if (open (LOG,">>$HITLOG1"))
|
||||||
|
{ flock (LOG,2); seek (LOG,0,2);
|
||||||
|
print (LOG "$hitLine\n");
|
||||||
|
close (LOG);
|
||||||
|
}
|
||||||
|
close (LOCK);
|
||||||
|
exit;
|
||||||
|
|
||||||
|
# end main program
|
||||||
|
######################################################################
|
||||||
|
|
||||||
|
sub endIt # exit on error
|
||||||
|
{ exit;
|
||||||
|
} # end endIt
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
raPko.wpxNfW2
|
|
@ -0,0 +1,72 @@
|
||||||
|
#! /usr/local/bin/perl
|
||||||
|
#
|
||||||
|
# HITXBM.PL - Module required by hitmat.cgi
|
||||||
|
#
|
||||||
|
# Copyright: 1996,1997,1998 by Joe DePasquale
|
||||||
|
# Last revised: January 28, 1997
|
||||||
|
# E-Mail: crypt@getcruising.com
|
||||||
|
# Website: http://www.GetCruising.com
|
||||||
|
#
|
||||||
|
###########################################################################
|
||||||
|
# The bitmap data file @gened is used with the author's permission.
|
||||||
|
# number.xbm (C) 1994 Eugene E. Devereaux <gened@halcyon.com>
|
||||||
|
# Adapted for UUNET (NCSA httpd) by David MacKenzie <djm@va.pubnix.com>
|
||||||
|
###########################################################################
|
||||||
|
|
||||||
|
# Sub: Make an x-bitmap image of the count
|
||||||
|
|
||||||
|
sub makeXbm
|
||||||
|
{
|
||||||
|
($printTtl,$digits,$XBM) = @_;
|
||||||
|
|
||||||
|
$printTtl = substr ($printTtl,0);
|
||||||
|
$pad = $digits - length ($printTtl);
|
||||||
|
$xbmWidth = $digits * 16;
|
||||||
|
|
||||||
|
for ($x=0; $x<$digits; $x++)
|
||||||
|
{ if ($x<$pad) { $printTtl = "0".$printTtl; }
|
||||||
|
push @xbmNbr, substr ($printTtl,$x,1);
|
||||||
|
}
|
||||||
|
|
||||||
|
# assign bitmap byte octals for numbers 0..9 to list of lists
|
||||||
|
@gened = (
|
||||||
|
['00','00','e0','07','f0','0f','30','0c','30','0c','30','0c','30','0c','30','0c',
|
||||||
|
'30','0c','30','0c','30','0c','30','0c','30','0c','f0','0f','e0','07','00','00'],
|
||||||
|
['00','00','80','01','c0','01','e0','01','80','01','80','01','80','01','80','01',
|
||||||
|
'80','01','80','01','80','01','80','01','80','01','e0','07','e0','07','00','00'],
|
||||||
|
['00','00','e0','07','f8','1f','18','18','18','18','18','1c','00','0e','00','07',
|
||||||
|
'80','03','c0','01','e0','00','70','00','38','00','f8','1f','f8','1f','00','00'],
|
||||||
|
['00','00','f0','07','f0','0f','30','0c','00','0c','00','0c','00','0c','c0','0f',
|
||||||
|
'c0','0f','00','0c','00','0c','00','0c','30','0c','f0','0f','f0','07','00','00'],
|
||||||
|
['00','00','00','06','00','0f','80','0f','c0','0d','e0','0c','70','0c','f0','0f',
|
||||||
|
'f0','0f','00','0c','00','0c','00','0c','00','0c','00','0c','00','0c','00','00'],
|
||||||
|
['00','00','e0','0f','f0','0f','30','00','30','00','30','00','30','00','f0','07',
|
||||||
|
'e0','0f','00','0c','00','0c','00','0c','30','0c','f0','07','e0','03','00','00'],
|
||||||
|
['00','00','20','00','30','00','30','00','30','00','30','00','30','00','f0','07',
|
||||||
|
'f0','0f','30','0c','30','0c','30','0c','30','0c','f0','0f','e0','0f','00','00'],
|
||||||
|
['00','00','f0','0f','f0','0f','30','0c','30','0c','00','06','00','03','00','03',
|
||||||
|
'80','01','80','01','c0','00','c0','00','60','00','60','00','60','00','00','00'],
|
||||||
|
['00','00','e0','07','f0','0f','30','0c','30','0c','30','0c','60','06','c0','03',
|
||||||
|
'c0','03','60','06','30','0c','30','0c','30','0c','f0','0f','e0','07','00','00'],
|
||||||
|
['00','00','e0','07','f0','0f','30','0c','30','0c','30','0c','e0','0f','c0','0f',
|
||||||
|
'00','0e','00','0e','00','07','80','03','c0','01','e0','00','60','00','00','00'],
|
||||||
|
);
|
||||||
|
|
||||||
|
# create image file of printTtl
|
||||||
|
open (XBM,">$XBM");
|
||||||
|
flock (XBM,2); seek (XBM,0,0);
|
||||||
|
print (XBM "#define hit_width $xbmWidth\n");
|
||||||
|
print (XBM "#define hit_height 16\n");
|
||||||
|
print (XBM "static char hit_bits[] = {\n");
|
||||||
|
|
||||||
|
for ($y=0; $y<=30; $y=$y+2)
|
||||||
|
{ foreach $x (@xbmNbr)
|
||||||
|
{ print (XBM "0x$gened[$x][$y],0x$gened[$x][$y+1],");
|
||||||
|
}
|
||||||
|
print (XBM "\n");
|
||||||
|
}
|
||||||
|
print (XBM "};\n");
|
||||||
|
truncate (XBM,tell(XBM)); close (XBM);
|
||||||
|
} # end makeXbm
|
||||||
|
|
||||||
|
1; # return true
|
|
@ -0,0 +1,185 @@
|
||||||
|
Installation and Usage
|
||||||
|
for HITMATIC Website Hit Statistics System
|
||||||
|
|
||||||
|
This copy of HITMAT.ZIP contains the latest revised
|
||||||
|
edition with all required files for a complete installation.
|
||||||
|
|
||||||
|
Revision Date: hitmat.zip - July 8, 1998
|
||||||
|
Copyright: 1996,1997,1998 by Joe DePasquale
|
||||||
|
E-Mail: crypt@getcruising.com
|
||||||
|
Website: http://www.GetCruising.com
|
||||||
|
|
||||||
|
========================================================================
|
||||||
|
This application is for Unix web servers running Perl 5.0 or higher.
|
||||||
|
|
||||||
|
Additional documentation is available at http://www.GetCruising/crypt
|
||||||
|
helpme.txt - How to install Perl scripts on a Unix server.
|
||||||
|
whatsnew.txt - Revision history for all 'CGI Scripts from the Crypt'.
|
||||||
|
|
||||||
|
Also visit the "Users' Self-Support Forum" to post questions and
|
||||||
|
answers, especially if you have some extra time, knowledge and
|
||||||
|
a desire to help some other poor lost souls!
|
||||||
|
|
||||||
|
THERE IS *NO* FREE *NOR* FEE-BASED TECHNICAL SUPPORT FOR THESE SCRIPTS!
|
||||||
|
Due to extremely limited time, E-Mail with technical support
|
||||||
|
questions WILL NOT BE ANSWERED! Please use the available resources
|
||||||
|
here and elsewhere on the WWW to solve problems.
|
||||||
|
E-Mail genuine bug reports to: crypt@getcruising.com
|
||||||
|
|
||||||
|
========================================================================
|
||||||
|
|
||||||
|
WHAT IT DOES:
|
||||||
|
|
||||||
|
HITMATIC can become as complex and valuable as you wish. At its simplest,
|
||||||
|
it can display the hitcount for a page to your visitors. At your option,
|
||||||
|
it can also be configured for complete website tracking and analysis.
|
||||||
|
|
||||||
|
Input to the script comes from special image tags that you place on each
|
||||||
|
web page that you want included in the system. When a browser loads
|
||||||
|
one of these pages it expects to receive a graphic from the URL in the
|
||||||
|
tag. Instead, the URL runs HITMATIC which counts and categorizes the hit,
|
||||||
|
does some maintenance stuff and finally creates the graphic (an X-Bitmap)
|
||||||
|
and outputs it to the browser.
|
||||||
|
|
||||||
|
Why X-Bitmap? Of the 3 standard image formats that web browsers can
|
||||||
|
display (.jpg, .gif and .xbm) this is the only one that uses an ASCII
|
||||||
|
file format and can be created by simple math. The overhead of having
|
||||||
|
to include a compiled jpg or gif generator is avoided, and HITMATIC
|
||||||
|
uses resources to calculate stats rather than displays pretty fonts.
|
||||||
|
|
||||||
|
To learn more about X-Bitmaps, read the comments in 'hitxbm.pl'.
|
||||||
|
|
||||||
|
'hit1.log' and 'hit2.log' save todays' and yesterday's hit data with
|
||||||
|
one line per hit (date, time, $pagecode, $command, user's IP address,
|
||||||
|
cookies and referring page). 'hitcfg.pl' runs daily file maintenance,
|
||||||
|
'hitxbm.pl' creates the XBM-BITMAP images of the hitcounts.
|
||||||
|
|
||||||
|
Twelve files numbered hit1.dat - hit12.dat which each hold hit
|
||||||
|
counts by day and pagecode for one month.
|
||||||
|
|
||||||
|
The manager module (hitman.pl) gives you a choice of statistical tables
|
||||||
|
showing counts by month, by page, by group or full year.
|
||||||
|
|
||||||
|
The 'By YEAR' table starts 12 months ago and ends at the end of current
|
||||||
|
month. The grid shows the total hits by month for each group and each
|
||||||
|
page, ranked most to least popular. 'By MONTH' shows the hits for one
|
||||||
|
month on a daily basis. 'By PAGE' shows the hits for one page on a yearly
|
||||||
|
basis.
|
||||||
|
|
||||||
|
The HIT COUNTER shows the current hit count for each page since last
|
||||||
|
reset. You can reset the counter to any month in the pop-up box, and
|
||||||
|
HITMATIC will recalculate hits from data in the monthly hit files also
|
||||||
|
making a new 'since.xbm' image of the month and date which can be
|
||||||
|
displayed.
|
||||||
|
|
||||||
|
Daily file maintenance is run when the first visitor of the day causes
|
||||||
|
HITMATIC to run. Several things happen: 'hit1.log' is read and all hits
|
||||||
|
for the previous day are added to the monthly data files. If it's the
|
||||||
|
first day of a new month, last year's month file is emptied. 'hit1.log'
|
||||||
|
is renamed 'hit2.log', yesterday's 'hit2.log' is emptied and renamed
|
||||||
|
'hit1.log'. Finally, if a new hit count was requested since the last
|
||||||
|
maintenance, the 'hit.cnt' file is recalculated.
|
||||||
|
|
||||||
|
HITMATIC uses the Perl 'flock' function to prevent simultaneous
|
||||||
|
changes (corruption) of data files.
|
||||||
|
|
||||||
|
========================================================================
|
||||||
|
|
||||||
|
INSTALLATION:
|
||||||
|
|
||||||
|
1. SETUP YOUR FILES -
|
||||||
|
|
||||||
|
Open 'hit.cfg' in a text editor. The default file is '1|1|1|N|'. Change
|
||||||
|
the first '1' to current day-of-month (1-31), the second '1' to current
|
||||||
|
month (1-12). Leave the other fields as is and save the file. Hereafter,
|
||||||
|
these values will be read, changed and written by the script(s) so no
|
||||||
|
further editing should be required.
|
||||||
|
|
||||||
|
Add a reference to each HTML page to be counted, following this example:
|
||||||
|
<img
|
||||||
|
src="http://yourserver.com/path/to/cgi-bin/hitmat.cgi?PAGECODE+GROUPCODE=COMMAND">
|
||||||
|
|
||||||
|
You will need to make these substitutions --
|
||||||
|
|
||||||
|
'PAGECODE' is a unique name (with NO SPACES) for the page being counted.
|
||||||
|
It can be real or symbolic (albert/home.html, links, page1, etc.).
|
||||||
|
|
||||||
|
'GROUPCODE' is optional but you can subdivide your hitcounts into
|
||||||
|
subject areas. Use a SINGLE letter or number for each group.
|
||||||
|
|
||||||
|
'COMMAND' tells the script which count to output on the page --
|
||||||
|
'SITE' - display total hits to website,
|
||||||
|
'GROUP' - display hits for a group,
|
||||||
|
'PAGE' - display hits for a page, or
|
||||||
|
'NONE' - display nothing, i.e. sends a null bitmap image.
|
||||||
|
|
||||||
|
Example of a full site hitcount displayed on my 'index.html' page:
|
||||||
|
|
||||||
|
<img src="./cgi-bin/hitmat.cgi?index+G=SITE" width=96 height=16
|
||||||
|
align=top border=0> Pages Served Since <img src="./hit/since.xbm"
|
||||||
|
width=64 height=16 border=0 align=top alt="Last Reset">
|
||||||
|
|
||||||
|
Note the PAGECODE is 'index', GROUPCODE is 'G' and COMMAND is 'SITE'.
|
||||||
|
|
||||||
|
As in the example, you can include an image tag for 'since.xbm'
|
||||||
|
to display the date (MMYY) when counter was last reset.
|
||||||
|
|
||||||
|
Adding width and height tags allows the page to load quicker --
|
||||||
|
For 'SITE, 'GROUP' and 'PAGE' use 'width=96 height=16',
|
||||||
|
For 'NONE' use 'width=0 height=0',
|
||||||
|
For 'since.xbm' use 'width=64 height=16'.
|
||||||
|
|
||||||
|
|
||||||
|
2. CONFIGURE THE SCRIPT -
|
||||||
|
|
||||||
|
Open the main script file 'hitmat.cgi' in a text editor and change
|
||||||
|
the sample paths in the "CONFIGURE THE SCRIPT" section,
|
||||||
|
following the instructions found there.
|
||||||
|
|
||||||
|
|
||||||
|
3. UPLOAD FILES AND SET (CHMOD) PERMISSIONS -
|
||||||
|
|
||||||
|
All files should be uploaded in ASCII mode (yes even the .xbm's).
|
||||||
|
|
||||||
|
Place 'hitmat.cgi' (755), 'hitcfg.pl' (644), 'hitman.pl' (644)
|
||||||
|
and 'hitxbm.pl' (644) into your main cgi directory.
|
||||||
|
|
||||||
|
Create a directory named 'hitmat' (755) and place 'hit.cfg' (666),
|
||||||
|
'hit.cnt' (666), 'hit.flk' (666), 'hit1.log' (666), 'hit2.log' (666),
|
||||||
|
'hit.xbm' (666), 'hitmat.pwd' (666) plus the 12 files 'hit1.dat'
|
||||||
|
thru 'hit12.dat' (666) there.
|
||||||
|
|
||||||
|
If you enable the back-up option, create an empty directory named
|
||||||
|
'bak' (777) which can be shared with my other scripts that make
|
||||||
|
back-up files. This directory MUST be world-writeable!
|
||||||
|
|
||||||
|
========================================================================
|
||||||
|
|
||||||
|
HOW TO USE IT:
|
||||||
|
|
||||||
|
If set up correctly (!) just sit back and watch (?) as the script
|
||||||
|
and your visitors do all the work.
|
||||||
|
|
||||||
|
To RUN HITMATIC MANAGER, use 'manager' as a query-string.
|
||||||
|
|
||||||
|
Examples -
|
||||||
|
http://www.GetCruising.com/cgibin/hitmat.cgi?manager
|
||||||
|
|
||||||
|
The response should be the password authorization form. The
|
||||||
|
initial password is 'password'. Of course you should change it soon
|
||||||
|
to something unique by entering a new password in the
|
||||||
|
'Change Password' box.
|
||||||
|
|
||||||
|
The default HIT TABLE is 'By YEAR' starting 12 months ago and ending at
|
||||||
|
the end of current month. To switch to detailed displays 'By MONTH',
|
||||||
|
'By GROUP' or 'By PAGE', select a radio button and press 'HIT TABLES'.
|
||||||
|
You can switch between displays in the same way.
|
||||||
|
|
||||||
|
Select 'HIT COUNTER' for a list of current hit count for each page
|
||||||
|
since last reset. To reset the counter to the beginning of a month,
|
||||||
|
select a starting month in the pop-up box, then press 'CHANGE'.
|
||||||
|
|
||||||
|
========================================================================
|
||||||
|
|
||||||
|
What are you reading this for? DO IT!
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
#define hit_width 64
|
||||||
|
#define hit_height 16
|
||||||
|
static char hit_bits[] = {
|
||||||
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||||
|
0xe0,0x07,0xf0,0x07,0xe0,0x07,0xf0,0x0f,
|
||||||
|
0xf0,0x0f,0xf0,0x0f,0xf0,0x0f,0xf0,0x0f,
|
||||||
|
0x30,0x0c,0x30,0x0c,0x30,0x0c,0x30,0x0c,
|
||||||
|
0x30,0x0c,0x00,0x0c,0x30,0x0c,0x30,0x0c,
|
||||||
|
0x30,0x0c,0x00,0x0c,0x30,0x0c,0x00,0x06,
|
||||||
|
0x30,0x0c,0x00,0x0c,0xe0,0x0f,0x00,0x03,
|
||||||
|
0x30,0x0c,0xc0,0x0f,0xc0,0x0f,0x00,0x03,
|
||||||
|
0x30,0x0c,0xc0,0x0f,0x00,0x0e,0x80,0x01,
|
||||||
|
0x30,0x0c,0x00,0x0c,0x00,0x0e,0x80,0x01,
|
||||||
|
0x30,0x0c,0x00,0x0c,0x00,0x07,0xc0,0x00,
|
||||||
|
0x30,0x0c,0x00,0x0c,0x80,0x03,0xc0,0x00,
|
||||||
|
0x30,0x0c,0x30,0x0c,0xc0,0x01,0x60,0x00,
|
||||||
|
0xf0,0x0f,0xf0,0x0f,0xe0,0x00,0x60,0x00,
|
||||||
|
0xe0,0x07,0xf0,0x07,0x60,0x00,0x60,0x00,
|
||||||
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||||
|
};
|
After Width: | Height: | Size: 71 B |
After Width: | Height: | Size: 82 B |
After Width: | Height: | Size: 76 B |
After Width: | Height: | Size: 79 B |
After Width: | Height: | Size: 77 B |
After Width: | Height: | Size: 81 B |
After Width: | Height: | Size: 80 B |
After Width: | Height: | Size: 81 B |
After Width: | Height: | Size: 78 B |
After Width: | Height: | Size: 83 B |
After Width: | Height: | Size: 82 B |
After Width: | Height: | Size: 80 B |
|
@ -0,0 +1,30 @@
|
||||||
|
#LogCount v3.8 link count and redirect
|
||||||
|
sub do_link {
|
||||||
|
($scrap, $lnkNumb) = split(/\=/,$query_string);
|
||||||
|
if (!open (COUNT, "+<$log_path$lnks_name")) {$err = "Links File Access"; &err_log;}
|
||||||
|
eval"flock(COUNT,2)";
|
||||||
|
@lns = <COUNT>;
|
||||||
|
$cnts = 0;
|
||||||
|
foreach $ln (@lns){
|
||||||
|
@TL = split(/\|/,$ln);
|
||||||
|
if ($TL[0] eq $lnkNumb) {
|
||||||
|
$the_link = $TL[1];
|
||||||
|
if ($pn eq "l") {
|
||||||
|
$TL[2]++;
|
||||||
|
$lns[$cnts] = "$TL[0]|$TL[1]|$TL[2]\n";
|
||||||
|
seek(COUNT,0,0);
|
||||||
|
print COUNT @lns;
|
||||||
|
last;
|
||||||
|
} }
|
||||||
|
$cnts++;
|
||||||
|
}
|
||||||
|
eval"flock(COUNT,8)";
|
||||||
|
close(COUNT);
|
||||||
|
if (!($the_link eq "")) {print "Location: $the_link\n\n";}
|
||||||
|
else {
|
||||||
|
print "Content-type: text/html\n\n"; print qq~<html><head><meta name="author" content="Ron F Woolley 1998-99 - www.dtp-aus.com"><meta HTTP-EQUIV="Pragma" CONTENT="no-cache"><title>Error Response</title></head><body bgcolor="#FFFFFD" text="#333333" link="#0000CC"><center><p> </p><table cellpadding="1" cellspacing="3" border="0"><tr bgcolor="#F5F5FF"><td><b><font face="verdana,arial,geneva,helvetica" size="3"> Link <font color="#CC0000">Error Response</font></font></b></td></tr><tr><td align=center bgcolor="#F5F5F5"><font size="2" face="arial,helvetica,geneva"><p><strong> <br>The link you requested cannot be found.</strong></p><p> Please report this error to the <a href="$webmstr">webmaster</a>. <em>Thank you </em></p></font></td></tr><tr bgcolor="#666666"><td align=center><font size="2" face="arial,helvetica,geneva"><em><font color="#FFFFFF"><b>return with your</b></font></em><font color="#FFFFFF"><b> Back Arrow</b></font></font></td></tr></table></center></body></html>~;
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
1; #line must remain last and as is
|
|
@ -0,0 +1,19 @@
|
||||||
|
# LogCount v3.8 error logging
|
||||||
|
sub err_logs {
|
||||||
|
if ((-e "$log_path"."$ENV{'REMOTE_ADDR'}.tf") || (-s "$log_path$badlog_name") > 2000000 || !open (LOG, ">>$log_path$badlog_name")) {exit;}
|
||||||
|
open (LOGG, ">$log_path"."$ENV{'REMOTE_ADDR'}.tf") || exit;
|
||||||
|
eval"flock(LOG, 2)";
|
||||||
|
my $trim = date_time(1)."|$err|$ENV{'HTTP_REFERER'}|$ENV{'REMOTE_ADDR'}";
|
||||||
|
$trim = substr($trim,0,150);
|
||||||
|
print LOG "$trim\n";
|
||||||
|
eval"flock(LOG, 8)";
|
||||||
|
close(LOG);
|
||||||
|
close(LOGG);
|
||||||
|
if (!($pn eq "l")) {&sendFile($img_url."trans.gif", "image/gif");}
|
||||||
|
else {print "Content-type: text/html\n\n";
|
||||||
|
print "Pages are copyright. Remote link access refused!<br>Please link via the actual on-site page\n";}
|
||||||
|
sleep 10;
|
||||||
|
unlink ("$log_path"."$ENV{'REMOTE_ADDR'}.tf");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
1; #line must remain last and as is
|
|
@ -0,0 +1,42 @@
|
||||||
|
#### adding/subtracting zeros alters length of visible counters ---#
|
||||||
|
$iszeros = "000000";
|
||||||
|
|
||||||
|
#### Select British ("0"), US ("1"), Internat ("2") date pattern --#
|
||||||
|
$dtUS = "2";
|
||||||
|
|
||||||
|
#### An array of accepted referers domain names / IP#s ------------#
|
||||||
|
@referers = ('armandino.free.fr','www-asim.lip6.fr', );
|
||||||
|
|
||||||
|
#### An array of rejected domain names / IP#s ---------------------#
|
||||||
|
$rjct = "|myfoobars.com|000.000.000.000|wallies.edu.ca/~bloggs|";
|
||||||
|
|
||||||
|
#### Path to Records and Counter Images, SEE readme.txt file ------#
|
||||||
|
$gmt_pth = "$log_path/gmtset.pl";
|
||||||
|
#$log_path = "counters/"; # - with forward slash
|
||||||
|
$count_name = "hitcount.t";
|
||||||
|
$log_name = "hitlog.t";
|
||||||
|
$lnks_name = "hitlnk.t";
|
||||||
|
$badlog_name = "hitbadlog.t";
|
||||||
|
$def_pge = "index";
|
||||||
|
$iwid = 13;
|
||||||
|
$ihgt = 17;
|
||||||
|
$ssi_zro = 1;
|
||||||
|
|
||||||
|
#### PATH OR URL to NON SSI img display images --------------------#
|
||||||
|
#-- this can be the same as the $ssi_url value! (see readme)
|
||||||
|
# $img_url = "counters/"; # PATH - with forward slash
|
||||||
|
#$img_url = "http://yourdomain.name/ssi_img/"; # URL - with forward slash
|
||||||
|
|
||||||
|
#### URL to the images for SSI img display (see readme) -----------#
|
||||||
|
$ssi_url = "http://www-asim.lip6.fr/ssi/img/"; # - with forward slash
|
||||||
|
|
||||||
|
#### SSI Output (0 = hidden (blank), 1 = Text, 2 = Images ---------#
|
||||||
|
$ssi_img = 1;
|
||||||
|
|
||||||
|
#### E-Mail address of the Webmaster ------------------------------#
|
||||||
|
$webmstr = "mailto:Olivier.Sirol\@lip6.fr?subject=Link_Error";
|
||||||
|
|
||||||
|
#### Show Referer Domain Names, SEE readme.txt file ---------------#
|
||||||
|
$showDoms = "1";
|
||||||
|
|
||||||
|
1; # this line MUST remain in all 'require' files.
|
|
@ -0,0 +1,6 @@
|
||||||
|
#### value = GMT at your locality, in seconds (cen setup via admin!)--------#
|
||||||
|
#### ie (5hrs AHEAD) = 5X60X60 = 18000, (3.5hrs BEHIND) = -3.5X60X60 = -12600
|
||||||
|
|
||||||
|
$gmtPlusMinus = 7200;
|
||||||
|
|
||||||
|
1; # this line must remain in all 'require' files.
|
|
@ -0,0 +1,17 @@
|
||||||
|
2000/05/26 15:06:52|bad referrer, off-site access denied||132.227.103.10
|
||||||
|
2000/05/26 15:07:36|bad referrer, off-site access denied||132.227.103.10
|
||||||
|
2000/05/26 15:09:31|bad referrer, off-site access denied||132.227.103.10
|
||||||
|
2000/05/26 15:09:31|bad referrer, off-site access denied||132.227.103.10
|
||||||
|
2000/05/26 15:09:41|bad referrer, off-site access denied||132.227.103.10
|
||||||
|
2000/05/26 15:09:54|bad referrer, off-site access denied||132.227.103.10
|
||||||
|
2000/05/26 15:10:48|bad referrer, off-site access denied||132.227.103.10
|
||||||
|
2000/05/26 15:10:48|bad referrer, off-site access denied||132.227.103.10
|
||||||
|
2000/05/26 15:10:58|bad referrer, off-site access denied||132.227.103.10
|
||||||
|
2000/06/05 12:12:40|bad referrer, off-site access denied||132.227.103.10
|
||||||
|
2000/06/05 12:13:27|bad referrer, off-site access denied||132.227.103.10
|
||||||
|
2000/06/05 13:44:28|bad referrer, off-site access denied||132.227.103.10
|
||||||
|
2000/06/05 14:42:45|bad referrer, off-site access denied||132.227.103.10
|
||||||
|
2000/06/05 14:43:23|bad referrer, off-site access denied||132.227.103.10
|
||||||
|
2000/06/05 14:43:38|bad referrer, off-site access denied||132.227.103.10
|
||||||
|
2000/06/05 14:44:24|bad referrer, off-site access denied||132.227.103.10
|
||||||
|
2000/06/05 14:45:02|bad referrer, off-site access denied||132.227.103.10
|
|
@ -0,0 +1 @@
|
||||||
|
10
|
|
@ -0,0 +1 @@
|
||||||
|
widgets|http://www.widgetstuff.net/|345
|
|
@ -0,0 +1,10 @@
|
||||||
|
2000/05/26 14:42:39, 132.227.103.10, /, Mozilla/4.7 [en] (WinNT; I), chantaco
|
||||||
|
2000/05/26 15:01:38, 132.227.103.10, /, Mozilla/4.7 [en] (WinNT; I), chantaco
|
||||||
|
2000/05/26 15:02:39, 132.227.103.10, /, Mozilla/4.7 [en] (WinNT; I), chantaco
|
||||||
|
2000/05/26 15:11:25, 132.227.103.10, /, Mozilla/4.7 [en] (WinNT; I), chantaco
|
||||||
|
2000/05/26 16:09:38, 132.227.103.10, /, Mozilla/4.7 [en] (WinNT; I), chantaco
|
||||||
|
2000/05/26 16:11:14, 132.227.103.10, /, Mozilla/4.7 [en] (WinNT; I), chantaco
|
||||||
|
2000/05/26 16:20:05, 132.227.103.10, /, Mozilla/4.7 [en] (WinNT; I), chantaco
|
||||||
|
2000/05/27 12:05:15, 212.27.40.168, /, Mozilla/4.7 [en] (WinNT; I), paris11-nas1-40-168.dial.proxad.net
|
||||||
|
2000/06/05 14:46:26, 132.227.103.10, /, Mozilla/4.7 [en] (WinNT; I), chantaco
|
||||||
|
2000/06/05 14:46:29, 132.227.103.10, /, Mozilla/4.7 [en] (WinNT; I), chantaco
|
|
@ -0,0 +1 @@
|
||||||
|
a.M5r8pTqIbSw
|
|
@ -0,0 +1,23 @@
|
||||||
|
#### Path to Records and Counter Images, SEE readme.txt file ------#
|
||||||
|
$lookcfg_pth = "$log_path/lookcnfg.pl";
|
||||||
|
$pwrd_name = "look.pwd";
|
||||||
|
|
||||||
|
$grf1_url = "$ssi_url"."grf0.gif";
|
||||||
|
$grf0_url = "$ssi_url"."grf1.gif";
|
||||||
|
|
||||||
|
#### URL of the prefered return page (Home) -----------------------#
|
||||||
|
$hm_url = "http://armandino.free.fr/";
|
||||||
|
|
||||||
|
#### URL of the LOGLOOK.CGI log viewer script ---------------------#
|
||||||
|
$logScrpt = "http://www-asim.lip6.fr/cgi-bin/czo/lc/cgi-bin/loglook.cgi";
|
||||||
|
|
||||||
|
#### URL of the LOGCNT.CGI counter script -------------------------#
|
||||||
|
$countScrpt = "http://www-asim.lip6.fr/cgi-bin/czo/lc/cgi-bin/logcnt.cgi";
|
||||||
|
|
||||||
|
#### Enable display of last 7 days ("1") --------------------------#
|
||||||
|
$shwDays7 = "1";
|
||||||
|
|
||||||
|
#### Enter a Password or leave blank(""), SEE readme.txt file -----#
|
||||||
|
$theword = "log";
|
||||||
|
|
||||||
|
1; # this line MUST remain in all 'require' files.
|
After Width: | Height: | Size: 81 B |
After Width: | Height: | Size: 43 B |
After Width: | Height: | Size: 71 B |
After Width: | Height: | Size: 82 B |
After Width: | Height: | Size: 76 B |
After Width: | Height: | Size: 79 B |
After Width: | Height: | Size: 77 B |
After Width: | Height: | Size: 81 B |
After Width: | Height: | Size: 80 B |
After Width: | Height: | Size: 81 B |
After Width: | Height: | Size: 78 B |
After Width: | Height: | Size: 83 B |
After Width: | Height: | Size: 82 B |
After Width: | Height: | Size: 80 B |
|
@ -0,0 +1,30 @@
|
||||||
|
#LogCount v3.8 link count and redirect
|
||||||
|
sub do_link {
|
||||||
|
($scrap, $lnkNumb) = split(/\=/,$query_string);
|
||||||
|
if (!open (COUNT, "+<$log_path$lnks_name")) {$err = "Links File Access"; &err_log;}
|
||||||
|
eval"flock(COUNT,2)";
|
||||||
|
@lns = <COUNT>;
|
||||||
|
$cnts = 0;
|
||||||
|
foreach $ln (@lns){
|
||||||
|
@TL = split(/\|/,$ln);
|
||||||
|
if ($TL[0] eq $lnkNumb) {
|
||||||
|
$the_link = $TL[1];
|
||||||
|
if ($pn eq "l") {
|
||||||
|
$TL[2]++;
|
||||||
|
$lns[$cnts] = "$TL[0]|$TL[1]|$TL[2]\n";
|
||||||
|
seek(COUNT,0,0);
|
||||||
|
print COUNT @lns;
|
||||||
|
last;
|
||||||
|
} }
|
||||||
|
$cnts++;
|
||||||
|
}
|
||||||
|
eval"flock(COUNT,8)";
|
||||||
|
close(COUNT);
|
||||||
|
if (!($the_link eq "")) {print "Location: $the_link\n\n";}
|
||||||
|
else {
|
||||||
|
print "Content-type: text/html\n\n"; print qq~<html><head><meta name="author" content="Ron F Woolley 1998-99 - www.dtp-aus.com"><meta HTTP-EQUIV="Pragma" CONTENT="no-cache"><title>Error Response</title></head><body bgcolor="#FFFFFD" text="#333333" link="#0000CC"><center><p> </p><table cellpadding="1" cellspacing="3" border="0"><tr bgcolor="#F5F5FF"><td><b><font face="verdana,arial,geneva,helvetica" size="3"> Link <font color="#CC0000">Error Response</font></font></b></td></tr><tr><td align=center bgcolor="#F5F5F5"><font size="2" face="arial,helvetica,geneva"><p><strong> <br>The link you requested cannot be found.</strong></p><p> Please report this error to the <a href="$webmstr">webmaster</a>. <em>Thank you </em></p></font></td></tr><tr bgcolor="#666666"><td align=center><font size="2" face="arial,helvetica,geneva"><em><font color="#FFFFFF"><b>return with your</b></font></em><font color="#FFFFFF"><b> Back Arrow</b></font></font></td></tr></table></center></body></html>~;
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
1; #line must remain last and as is
|
|
@ -0,0 +1,19 @@
|
||||||
|
# LogCount v3.8 error logging
|
||||||
|
sub err_logs {
|
||||||
|
if ((-e "$log_path"."$ENV{'REMOTE_ADDR'}.tf") || (-s "$log_path$badlog_name") > 2000000 || !open (LOG, ">>$log_path$badlog_name")) {exit;}
|
||||||
|
open (LOGG, ">$log_path"."$ENV{'REMOTE_ADDR'}.tf") || exit;
|
||||||
|
eval"flock(LOG, 2)";
|
||||||
|
my $trim = date_time(1)."|$err|$ENV{'HTTP_REFERER'}|$ENV{'REMOTE_ADDR'}";
|
||||||
|
$trim = substr($trim,0,150);
|
||||||
|
print LOG "$trim\n";
|
||||||
|
eval"flock(LOG, 8)";
|
||||||
|
close(LOG);
|
||||||
|
close(LOGG);
|
||||||
|
if (!($pn eq "l")) {&sendFile($img_url."trans.gif", "image/gif");}
|
||||||
|
else {print "Content-type: text/html\n\n";
|
||||||
|
print "Pages are copyright. Remote link access refused!<br>Please link via the actual on-site page\n";}
|
||||||
|
sleep 10;
|
||||||
|
unlink ("$log_path"."$ENV{'REMOTE_ADDR'}.tf");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
1; #line must remain last and as is
|
|
@ -0,0 +1,42 @@
|
||||||
|
#### adding/subtracting zeros alters length of visible counters ---#
|
||||||
|
$iszeros = "000000";
|
||||||
|
|
||||||
|
#### Select British ("0"), US ("1"), Internat ("2") date pattern --#
|
||||||
|
$dtUS = "2";
|
||||||
|
|
||||||
|
#### An array of accepted referers domain names / IP#s ------------#
|
||||||
|
@referers = ('asim.lip6.fr','www-asim.lip6.fr', 'chantaco.lip6.fr', );
|
||||||
|
|
||||||
|
#### An array of rejected domain names / IP#s ---------------------#
|
||||||
|
$rjct = "|myfoobars.com|000.000.000.000|wallies.edu.ca/~bloggs|";
|
||||||
|
|
||||||
|
#### Path to Records and Counter Images, SEE readme.txt file ------#
|
||||||
|
$gmt_pth = "$log_path/gmtset.pl";
|
||||||
|
#$log_path = "counters/"; # - with forward slash
|
||||||
|
$count_name = "hitcount.t";
|
||||||
|
$log_name = "hitlog.t";
|
||||||
|
$lnks_name = "hitlnk.t";
|
||||||
|
$badlog_name = "hitbadlog.t";
|
||||||
|
$def_pge = "index";
|
||||||
|
$iwid = 13;
|
||||||
|
$ihgt = 17;
|
||||||
|
$ssi_zro = 1;
|
||||||
|
|
||||||
|
#### PATH OR URL to NON SSI img display images --------------------#
|
||||||
|
#-- this can be the same as the $ssi_url value! (see readme)
|
||||||
|
# $img_url = "counters/"; # PATH - with forward slash
|
||||||
|
#$img_url = "http://yourdomain.name/ssi_img/"; # URL - with forward slash
|
||||||
|
|
||||||
|
#### URL to the images for SSI img display (see readme) -----------#
|
||||||
|
$ssi_url = "http://www-asim.lip6.fr/ssi/img/"; # - with forward slash
|
||||||
|
|
||||||
|
#### SSI Output (0 = hidden (blank), 1 = Text, 2 = Images ---------#
|
||||||
|
$ssi_img = 1;
|
||||||
|
|
||||||
|
#### E-Mail address of the Webmaster ------------------------------#
|
||||||
|
$webmstr = "mailto:Olivier.Sirol\@lip6.fr?subject=Link_Error";
|
||||||
|
|
||||||
|
#### Show Referer Domain Names, SEE readme.txt file ---------------#
|
||||||
|
$showDoms = "1";
|
||||||
|
|
||||||
|
1; # this line MUST remain in all 'require' files.
|
|
@ -0,0 +1,6 @@
|
||||||
|
#### value = GMT at your locality, in seconds (cen setup via admin!)--------#
|
||||||
|
#### ie (5hrs AHEAD) = 5X60X60 = 18000, (3.5hrs BEHIND) = -3.5X60X60 = -12600
|
||||||
|
|
||||||
|
$gmtPlusMinus = 7200;
|
||||||
|
|
||||||
|
1; # this line must remain in all 'require' files.
|
|
@ -0,0 +1,5 @@
|
||||||
|
2000/05/0024 16:01:27|bad referrer, off-site access denied||132.227.103.10
|
||||||
|
2000/05/0024 16:23:36|illegal method||
|
||||||
|
2000/05/0025 12:42:00|bad query_string||
|
||||||
|
2000/05/0025 12:55:38|illegal method||
|
||||||
|
2000/05/28 13:51:14|bad referrer, off-site access denied||208.185.131.219
|
|
@ -0,0 +1 @@
|
||||||
|
20642
|
|
@ -0,0 +1,3 @@
|
||||||
|
3451|../samp.htm|3387
|
||||||
|
dtp|http://www.dtp-aus.com/index.html|97
|
||||||
|
widgets|http://www.widgetstuff.net/|345
|
|
@ -0,0 +1 @@
|
||||||
|
a.M5r8pTqIbSw
|
|
@ -0,0 +1,23 @@
|
||||||
|
#### Path to Records and Counter Images, SEE readme.txt file ------#
|
||||||
|
$lookcfg_pth = "$log_path/lookcnfg.pl";
|
||||||
|
$pwrd_name = "look.pwd";
|
||||||
|
|
||||||
|
$grf1_url = "$ssi_url"."grf0.gif";
|
||||||
|
$grf0_url = "$ssi_url"."grf1.gif";
|
||||||
|
|
||||||
|
#### URL of the prefered return page (Home) -----------------------#
|
||||||
|
$hm_url = "http://www-asim.lip6.fr/";
|
||||||
|
|
||||||
|
#### URL of the LOGLOOK.CGI log viewer script ---------------------#
|
||||||
|
$logScrpt = "http://www-asim.lip6.fr/cgi-bin/czo/lc/cgi-bin/loglook.cgi";
|
||||||
|
|
||||||
|
#### URL of the LOGCNT.CGI counter script -------------------------#
|
||||||
|
$countScrpt = "http://www-asim.lip6.fr/cgi-bin/czo/lc/cgi-bin/logcnt.cgi";
|
||||||
|
|
||||||
|
#### Enable display of last 7 days ("1") --------------------------#
|
||||||
|
$shwDays7 = "1";
|
||||||
|
|
||||||
|
#### Enter a Password or leave blank(""), SEE readme.txt file -----#
|
||||||
|
$theword = "log";
|
||||||
|
|
||||||
|
1; # this line MUST remain in all 'require' files.
|
After Width: | Height: | Size: 81 B |
After Width: | Height: | Size: 43 B |
After Width: | Height: | Size: 71 B |
After Width: | Height: | Size: 82 B |
After Width: | Height: | Size: 76 B |
After Width: | Height: | Size: 79 B |
After Width: | Height: | Size: 77 B |
After Width: | Height: | Size: 81 B |
After Width: | Height: | Size: 80 B |
After Width: | Height: | Size: 81 B |
After Width: | Height: | Size: 78 B |
After Width: | Height: | Size: 83 B |
After Width: | Height: | Size: 82 B |
After Width: | Height: | Size: 80 B |
|
@ -0,0 +1,30 @@
|
||||||
|
#LogCount v3.8 link count and redirect
|
||||||
|
sub do_link {
|
||||||
|
($scrap, $lnkNumb) = split(/\=/,$query_string);
|
||||||
|
if (!open (COUNT, "+<$log_path$lnks_name")) {$err = "Links File Access"; &err_log;}
|
||||||
|
eval"flock(COUNT,2)";
|
||||||
|
@lns = <COUNT>;
|
||||||
|
$cnts = 0;
|
||||||
|
foreach $ln (@lns){
|
||||||
|
@TL = split(/\|/,$ln);
|
||||||
|
if ($TL[0] eq $lnkNumb) {
|
||||||
|
$the_link = $TL[1];
|
||||||
|
if ($pn eq "l") {
|
||||||
|
$TL[2]++;
|
||||||
|
$lns[$cnts] = "$TL[0]|$TL[1]|$TL[2]\n";
|
||||||
|
seek(COUNT,0,0);
|
||||||
|
print COUNT @lns;
|
||||||
|
last;
|
||||||
|
} }
|
||||||
|
$cnts++;
|
||||||
|
}
|
||||||
|
eval"flock(COUNT,8)";
|
||||||
|
close(COUNT);
|
||||||
|
if (!($the_link eq "")) {print "Location: $the_link\n\n";}
|
||||||
|
else {
|
||||||
|
print "Content-type: text/html\n\n"; print qq~<html><head><meta name="author" content="Ron F Woolley 1998-99 - www.dtp-aus.com"><meta HTTP-EQUIV="Pragma" CONTENT="no-cache"><title>Error Response</title></head><body bgcolor="#FFFFFD" text="#333333" link="#0000CC"><center><p> </p><table cellpadding="1" cellspacing="3" border="0"><tr bgcolor="#F5F5FF"><td><b><font face="verdana,arial,geneva,helvetica" size="3"> Link <font color="#CC0000">Error Response</font></font></b></td></tr><tr><td align=center bgcolor="#F5F5F5"><font size="2" face="arial,helvetica,geneva"><p><strong> <br>The link you requested cannot be found.</strong></p><p> Please report this error to the <a href="$webmstr">webmaster</a>. <em>Thank you </em></p></font></td></tr><tr bgcolor="#666666"><td align=center><font size="2" face="arial,helvetica,geneva"><em><font color="#FFFFFF"><b>return with your</b></font></em><font color="#FFFFFF"><b> Back Arrow</b></font></font></td></tr></table></center></body></html>~;
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
1; #line must remain last and as is
|
|
@ -0,0 +1,19 @@
|
||||||
|
# LogCount v3.8 error logging
|
||||||
|
sub err_logs {
|
||||||
|
if ((-e "$log_path"."$ENV{'REMOTE_ADDR'}.tf") || (-s "$log_path$badlog_name") > 2000000 || !open (LOG, ">>$log_path$badlog_name")) {exit;}
|
||||||
|
open (LOGG, ">$log_path"."$ENV{'REMOTE_ADDR'}.tf") || exit;
|
||||||
|
eval"flock(LOG, 2)";
|
||||||
|
my $trim = date_time(1)."|$err|$ENV{'HTTP_REFERER'}|$ENV{'REMOTE_ADDR'}";
|
||||||
|
$trim = substr($trim,0,150);
|
||||||
|
print LOG "$trim\n";
|
||||||
|
eval"flock(LOG, 8)";
|
||||||
|
close(LOG);
|
||||||
|
close(LOGG);
|
||||||
|
if (!($pn eq "l")) {&sendFile($img_url."trans.gif", "image/gif");}
|
||||||
|
else {print "Content-type: text/html\n\n";
|
||||||
|
print "Pages are copyright. Remote link access refused!<br>Please link via the actual on-site page\n";}
|
||||||
|
sleep 10;
|
||||||
|
unlink ("$log_path"."$ENV{'REMOTE_ADDR'}.tf");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
1; #line must remain last and as is
|
|
@ -0,0 +1,42 @@
|
||||||
|
#### adding/subtracting zeros alters length of visible counters ---#
|
||||||
|
$iszeros = "000000";
|
||||||
|
|
||||||
|
#### Select British ("0"), US ("1"), Internat ("2") date pattern --#
|
||||||
|
$dtUS = "2";
|
||||||
|
|
||||||
|
#### An array of accepted referers domain names / IP#s ------------#
|
||||||
|
@referers = ('neptune.ufr-info-p6.jussieu.fr','www-asim.lip6.fr', );
|
||||||
|
|
||||||
|
#### An array of rejected domain names / IP#s ---------------------#
|
||||||
|
$rjct = "|myfoobars.com|000.000.000.000|wallies.edu.ca/~bloggs|";
|
||||||
|
|
||||||
|
#### Path to Records and Counter Images, SEE readme.txt file ------#
|
||||||
|
$gmt_pth = "$log_path/gmtset.pl";
|
||||||
|
#$log_path = "counters/"; # - with forward slash
|
||||||
|
$count_name = "hitcount.t";
|
||||||
|
$log_name = "hitlog.t";
|
||||||
|
$lnks_name = "hitlnk.t";
|
||||||
|
$badlog_name = "hitbadlog.t";
|
||||||
|
$def_pge = "index";
|
||||||
|
$iwid = 13;
|
||||||
|
$ihgt = 17;
|
||||||
|
$ssi_zro = 1;
|
||||||
|
|
||||||
|
#### PATH OR URL to NON SSI img display images --------------------#
|
||||||
|
#-- this can be the same as the $ssi_url value! (see readme)
|
||||||
|
# $img_url = "counters/"; # PATH - with forward slash
|
||||||
|
#$img_url = "http://yourdomain.name/ssi_img/"; # URL - with forward slash
|
||||||
|
|
||||||
|
#### URL to the images for SSI img display (see readme) -----------#
|
||||||
|
$ssi_url = "http://www-asim.lip6.fr/ssi/img/"; # - with forward slash
|
||||||
|
|
||||||
|
#### SSI Output (0 = hidden (blank), 1 = Text, 2 = Images ---------#
|
||||||
|
$ssi_img = 1;
|
||||||
|
|
||||||
|
#### E-Mail address of the Webmaster ------------------------------#
|
||||||
|
$webmstr = "mailto:Olivier.Sirol\@lip6.fr?subject=Link_Error";
|
||||||
|
|
||||||
|
#### Show Referer Domain Names, SEE readme.txt file ---------------#
|
||||||
|
$showDoms = "1";
|
||||||
|
|
||||||
|
1; # this line MUST remain in all 'require' files.
|
|
@ -0,0 +1,6 @@
|
||||||
|
#### value = GMT at your locality, in seconds (cen setup via admin!)--------#
|
||||||
|
#### ie (5hrs AHEAD) = 5X60X60 = 18000, (3.5hrs BEHIND) = -3.5X60X60 = -12600
|
||||||
|
|
||||||
|
$gmtPlusMinus = 7200;
|
||||||
|
|
||||||
|
1; # this line must remain in all 'require' files.
|
|
@ -0,0 +1,8 @@
|
||||||
|
2000/05/26 17:00:05|bad referrer, off-site access denied||134.157.252.132
|
||||||
|
2000/05/26 17:00:34|bad referrer, off-site access denied||134.157.252.132
|
||||||
|
2000/05/26 17:00:34|bad referrer, off-site access denied||134.157.252.132
|
||||||
|
2000/05/26 17:00:34|bad referrer, off-site access denied||134.157.252.132
|
||||||
|
2000/05/26 17:00:48|bad referrer, off-site access denied||134.157.252.132
|
||||||
|
2000/05/26 17:01:19|bad referrer, off-site access denied||134.157.252.132
|
||||||
|
2000/05/29 17:03:37|bad referrer, off-site access denied||134.157.252.132
|
||||||
|
2000/05/30 12:26:09|bad referrer, off-site access denied||134.157.252.132
|
|
@ -0,0 +1 @@
|
||||||
|
16
|
|
@ -0,0 +1,16 @@
|
||||||
|
2000/05/26 17:01:30, 132.227.65.52, /menu.html, Mozilla/4.61 [en] (X11; I; Linux 2.2.5-15epona0 i586), epona.edite-de-paris.com.fr
|
||||||
|
2000/05/26 17:01:43, 132.227.65.52, /menu.html, Mozilla/4.61 [en] (X11; I; Linux 2.2.5-15epona0 i586), epona.edite-de-paris.com.fr
|
||||||
|
2000/05/26 17:01:50, 132.227.65.52, /menu.html, Mozilla/4.61 [en] (X11; I; Linux 2.2.5-15epona0 i586), epona.edite-de-paris.com.fr
|
||||||
|
2000/05/26 17:44:23, 132.227.65.52, /menu.html, Mozilla/4.61 [en] (X11; I; Linux 2.2.5-15epona0 i586), epona.edite-de-paris.com.fr
|
||||||
|
2000/05/29 12:48:08, 134.157.252.132, /menu.html, Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt), wwwcache.jussieu.fr
|
||||||
|
2000/05/29 17:29:05, 132.227.65.52, /menu.html, Mozilla/4.61 [en] (X11; I; Linux 2.2.5-15epona0 i586), epona.edite-de-paris.com.fr
|
||||||
|
2000/05/29 17:30:03, 132.227.65.23, /menu.html, Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt), mercure.edite-de-paris.com.fr
|
||||||
|
2000/05/30 10:53:31, 132.227.65.52, /menu.html, Mozilla/4.61 [en] (X11; I; Linux 2.2.5-15epona0 i586), epona.edite-de-paris.com.fr
|
||||||
|
2000/05/30 11:23:27, 132.227.68.5, /menu.html, ÊMozilla/3.0 (compatible; MSIE 3.01; Mac_PowerPC; Mac OS8), mac-isabelle-azam.ufr-info-p6.jussieu.fr
|
||||||
|
2000/05/30 12:00:08, 134.157.252.132, /menu.html, Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt), wwwcache.jussieu.fr
|
||||||
|
2000/05/30 14:39:37, 132.227.65.52, /menu.html, Mozilla/4.61 [en] (X11; I; Linux 2.2.5-15epona0 i586), epona.edite-de-paris.com.fr
|
||||||
|
2000/05/30 15:00:32, 134.157.252.131, /menu.html, Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt), wwwcache.jussieu.fr
|
||||||
|
2000/05/30 15:45:31, 132.227.68.5, /menu.html, ÊMozilla/3.0 (compatible; MSIE 3.01; Mac_PowerPC; Mac OS8), mac-isabelle-azam.ufr-info-p6.jussieu.fr
|
||||||
|
2000/05/30 15:59:36, 134.157.252.131, /menu.html, Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt), wwwcache.jussieu.fr
|
||||||
|
2000/05/30 17:38:43, 132.227.65.52, /menu.html, Mozilla/4.61 [en] (X11; I; Linux 2.2.5-15epona0 i586), epona.edite-de-paris.com.fr
|
||||||
|
2000/05/31 10:35:39, 132.227.205.102, /menu.html, Mozilla/4.0 (compatible; MSIE 4.5; Mac_PowerPC), mac-ghislaine.lip6.fr
|
|
@ -0,0 +1 @@
|
||||||
|
a.M5r8pTqIbSw
|
|
@ -0,0 +1,23 @@
|
||||||
|
#### Path to Records and Counter Images, SEE readme.txt file ------#
|
||||||
|
$lookcfg_pth = "$log_path/lookcnfg.pl";
|
||||||
|
$pwrd_name = "look.pwd";
|
||||||
|
|
||||||
|
$grf1_url = "$ssi_url"."grf0.gif";
|
||||||
|
$grf0_url = "$ssi_url"."grf1.gif";
|
||||||
|
|
||||||
|
#### URL of the prefered return page (Home) -----------------------#
|
||||||
|
$hm_url = "http://armandino.free.fr/";
|
||||||
|
|
||||||
|
#### URL of the LOGLOOK.CGI log viewer script ---------------------#
|
||||||
|
$logScrpt = "http://www-asim.lip6.fr/cgi-bin/czo/lc/cgi-bin/loglook.cgi";
|
||||||
|
|
||||||
|
#### URL of the LOGCNT.CGI counter script -------------------------#
|
||||||
|
$countScrpt = "http://www-asim.lip6.fr/cgi-bin/czo/lc/cgi-bin/logcnt.cgi";
|
||||||
|
|
||||||
|
#### Enable display of last 7 days ("1") --------------------------#
|
||||||
|
$shwDays7 = "1";
|
||||||
|
|
||||||
|
#### Enter a Password or leave blank(""), SEE readme.txt file -----#
|
||||||
|
$theword = "log";
|
||||||
|
|
||||||
|
1; # this line MUST remain in all 'require' files.
|
After Width: | Height: | Size: 81 B |
After Width: | Height: | Size: 43 B |
|
@ -0,0 +1,225 @@
|
||||||
|
#!/usr/local/bin/perl -w
|
||||||
|
|
||||||
|
# Czo : 2000/05/25
|
||||||
|
#
|
||||||
|
|
||||||
|
use CGI;
|
||||||
|
$query = new CGI;
|
||||||
|
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
# An IMG SRC, SSI and A HREF(links) called script that saves to common #
|
||||||
|
# log files also used by the Loglook.cgi log viewer and SSI count viewers #
|
||||||
|
# DO NOT use this script without first reading the accompanying README #
|
||||||
|
# installation and help page IN DETAIL. #
|
||||||
|
##############################################################################
|
||||||
|
# The script "LOGCNT.CGI" was written (c) by Ron F Woolley, Melbourne #
|
||||||
|
# Australia. Copyright 1998'99 2000. This script can be altered for personal #
|
||||||
|
# site use or commercial site use EXCEPT THAT: #
|
||||||
|
# ALL COPYRIGHT NOTICES must remain in the code, visible on all output pages,#
|
||||||
|
# AND ALL of the header notices MUST REMAIN intact as is, #
|
||||||
|
# AND using the script without first reading the README.HTM, is prohibited. #
|
||||||
|
# #
|
||||||
|
# Australian copyright is recognised/supported in over 130 countries... #
|
||||||
|
# per the Berne Convention and other treaties. (including USA!) #
|
||||||
|
# #
|
||||||
|
# The scripts and associated files REMAIN the property of Ron F Woolley. #
|
||||||
|
# NO PROFIT what so ever is to be gained from users of these scripts by #
|
||||||
|
# installation of these scripts, except that a reasonable minimal charge #
|
||||||
|
# for installation MAY be allowed. Supply, per installation, is directly #
|
||||||
|
# from dtp-aus.com ONLY. Remote hosting of this program is strictly #
|
||||||
|
# not allowed. #
|
||||||
|
# #
|
||||||
|
# Ron Woolley, the author, MUST be notified via the addresses/URLs below #
|
||||||
|
# if any gain is to be made for the installation of these scripts. #
|
||||||
|
# #
|
||||||
|
##############################################################################
|
||||||
|
# NOTE: If you use these files, you do so entirely at your own risk, and #
|
||||||
|
# take on full responsibility for the consequences of using the described #
|
||||||
|
# files. You must first agree that Ron Woolley / HostingNet, the only #
|
||||||
|
# permitted supplier of this and/or accompanying files is exempt from any #
|
||||||
|
# responsibility for all or any resulting problems, losses or costs caused #
|
||||||
|
# by your using these or any associated files. If you disagree with ANY of #
|
||||||
|
# the included requirements, you must IMMEDIATELY DESTROY ALL FILES. #
|
||||||
|
##############################################################################
|
||||||
|
# This program script is free to use Copyright notices must remain #
|
||||||
|
##############################################################################
|
||||||
|
# These program scripts are free-to-use, but if you use them, a donation to #
|
||||||
|
# the author would be appreciated and help in continuing support for #
|
||||||
|
# LogCount and the creation of other scripts for users of the internet. #
|
||||||
|
# An on-line Visa / MasterCard payment cart is available for support #
|
||||||
|
# donations and low cost program installations. #
|
||||||
|
##############################################################################
|
||||||
|
# HELP/ADVICE page at: #
|
||||||
|
# http://www.dtp-aus.com/cgiscript/scrpthlp.htm #
|
||||||
|
# Files from: #
|
||||||
|
# http://www.dtp-aus.com/cgiscript/cntscrpt.shtml #
|
||||||
|
##############################################################################
|
||||||
|
# THESE FILES can only be obtained via the above web addresses,and MUST #
|
||||||
|
# NOT BE PASSED ON TO OTHERS in any form by any means what so ever. This #
|
||||||
|
# DOES NOT contradict any other statements above. #
|
||||||
|
# EACH USER SITE MUST OBTAIN THESE FILES from URL above. #
|
||||||
|
##############################################################################
|
||||||
|
# VERSION 3.8 Februrary 2000 #
|
||||||
|
|
||||||
|
#--- Alter these two paths only, if needed! ---------------------#
|
||||||
|
|
||||||
|
$log_path = "counters/"; # - with forward slash
|
||||||
|
$img_url = "counters/"; # PATH - with forward slash
|
||||||
|
|
||||||
|
$sitename = $query->param('site');
|
||||||
|
if ( $sitename eq "" )
|
||||||
|
{$sitename="asim";}
|
||||||
|
|
||||||
|
$log_path = $log_path . "$sitename/";
|
||||||
|
$img_url = $img_url . "$sitename/";
|
||||||
|
|
||||||
|
if (-s "$log_path/gmtset.pl") {require "$log_path/gmtset.pl";} else {print "Content-type: text/html\n\n"; print "Missing/Bad Path to GMTime file\n"; exit;}
|
||||||
|
if (-s "$log_path/cntcnfg.pl") {require "$log_path/cntcnfg.pl";} else {print "Content-type: text/html\n\n"; print "Missing/Bad Path to Config file\n"; exit;}
|
||||||
|
|
||||||
|
|
||||||
|
#--- Do Not make any changes below this line. -------------------#
|
||||||
|
|
||||||
|
sub logged_as {
|
||||||
|
$pnm = $ENV{'HTTP_REFERER'};
|
||||||
|
$pnm =~ s/\#.*$//g ;
|
||||||
|
$pnm =~ s/\?.*$//g;
|
||||||
|
$pid = $pnm ;
|
||||||
|
if ($pid =~ /https?:\/\/.*\/([^\/]*.*\/[^\.].*\..*)$/i) {$pid = $1;}
|
||||||
|
elsif ($pid =~ /https?:\/\/.*(\/[^\.].*\..*)$/i) {$pid = $1;}
|
||||||
|
elsif ($pid =~ /https?:\/\/.*\/(.*\/)$/) {$pid = $1;}
|
||||||
|
elsif ($pid =~ /https?:\/\/.*(\/.*)$/) {$pid = $1;}
|
||||||
|
else {$pid = "/$def_pge" if !$ENV{'DOCUMENT_URI'};}
|
||||||
|
$pid =~ s/^\.+//;
|
||||||
|
}
|
||||||
|
sub sg_count {
|
||||||
|
&do_count($log_path.$count_name);
|
||||||
|
my $tmp;
|
||||||
|
if ($pn eq "p" && (-s "$pnm")) {
|
||||||
|
($tmp = $pid) =~ s/\./-/g;
|
||||||
|
$tmp =~ s/\//_/g;
|
||||||
|
&do_count($log_path.$tmp) }
|
||||||
|
$cnb = (substr($iszeros,1,length($iszeros) - length($cnb)).$cnb);
|
||||||
|
}
|
||||||
|
sub do_count {
|
||||||
|
my $fle = shift;
|
||||||
|
if (!(-e "$fle")) {if (!open (COUNT, ">$fle")) {$err = "creating new count file"; &err_log;} close (COUNT);}
|
||||||
|
if (!open (COUNT, "+<$fle")) {$err = "count file access"; &err_log;}
|
||||||
|
eval"flock(COUNT,2)";
|
||||||
|
$cnb = <COUNT>;
|
||||||
|
if ( $pn eq "0" || $pn eq "t" || $pn eq "c" || substr($query_string,0,2) eq "p0" || $ENV{'DOCUMENT_URI'} ) {
|
||||||
|
if ($rjct !~ /(\|$ENV{'REMOTE_HOST'}\||\|$ENV{'REMOTE_ADDR'}\|)/i) {$cnb = $cnb + 1;}
|
||||||
|
seek (COUNT, 0, 0);
|
||||||
|
print COUNT $cnb;
|
||||||
|
}
|
||||||
|
eval"flock(COUNT,8)";
|
||||||
|
close (COUNT);
|
||||||
|
chomp($cnb);
|
||||||
|
}
|
||||||
|
sub do_log {
|
||||||
|
if ($rjct =~ /(\|$ENV{'REMOTE_HOST'}\||\|$ENV{'REMOTE_ADDR'}\|)/i) {return;}
|
||||||
|
if (($ENV{'REMOTE_ADDR'} eq $ENV{'REMOTE_HOST'} || !$ENV{'REMOTE_HOST'}) && $ENV{'REMOTE_ADDR'} =~ /(\d+)\.(\d+)\.(\d+)\.(\d+)/) {
|
||||||
|
$pk = pack('C4', $1, $2, $3, $4);
|
||||||
|
$cnvrt = (gethostbyaddr($pk, 2))[0];
|
||||||
|
if ($cnvrt) {$ENV{'REMOTE_HOST'} = $cnvrt;}
|
||||||
|
}
|
||||||
|
if (!open (MLOG, ">>$log_path$log_name")) {$err = "log file access"; &err_log;}
|
||||||
|
eval"flock(MLOG,2)";
|
||||||
|
print MLOG date_time(1).", $ENV{'REMOTE_ADDR'}, $pid, $ENV{'HTTP_USER_AGENT'}, $ENV{'REMOTE_HOST'}\n";
|
||||||
|
eval"flock(MLOG,8)";
|
||||||
|
close(MLOG);
|
||||||
|
}
|
||||||
|
sub sendFile {
|
||||||
|
if ($img_url eq $ssi_url) {print "Location: $_[0]\n\n";}
|
||||||
|
else {
|
||||||
|
die("$0: sendFile called w/o File\n") unless my $File = $_[0];
|
||||||
|
die("$0: sendFile called on $File, no type\n") unless my $type = $_[1];
|
||||||
|
my $size = 0;
|
||||||
|
if ( open(FILE, $File)) {
|
||||||
|
$size = ( -s $File);
|
||||||
|
print "Content-type: $type\n"; print "Content-length: $size\n\n"; print <FILE>;
|
||||||
|
close (FILE);
|
||||||
|
} else {$err = "send-image file access error"; &err_log;}
|
||||||
|
$size;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
sub date_time {
|
||||||
|
($which,$z) = ($_[0],"a"); my($sec,$min,$hour,$mday,$mon,$year);
|
||||||
|
if (!$which) {
|
||||||
|
($min,$hour) = (gmtime(time + $gmtPlusMinus))[1,2];
|
||||||
|
if ($hour > 11) {$z = "p";}
|
||||||
|
if ($hour > 12) {$hour = $hour - 12;}
|
||||||
|
return sprintf("%02d-%02d$z",$hour,$min);
|
||||||
|
}
|
||||||
|
elsif ($which) {
|
||||||
|
($sec,$min,$hour,$mday,$mon,$year) = (gmtime(time + $gmtPlusMinus));
|
||||||
|
if ($year > 99) {$year = 2000 + ($year - 100);}
|
||||||
|
elsif ($year < 100) {$year = "19$year";}
|
||||||
|
if ($dtUS eq "1") {return sprintf("%02d\/%02d\/%04d %02d:%02d:%02d",$mon + 1,$mday,$year,$hour,$min,$sec);}
|
||||||
|
elsif ($dtUS eq "2") {return sprintf("%04d\/%02d\/%02d %02d:%02d:%02d",$year,$mon + 1,$mday,$hour,$min,$sec);}
|
||||||
|
else {return sprintf("%02d\/%02d\/%04d %02d:%02d:%02d",$mday,$mon + 1,$year,$hour,$min,$sec);}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
sub do_ssi {
|
||||||
|
&sg_count; print "Content-type: text/html\n\n";
|
||||||
|
if ($cnb eq 0 || $cnb eq "") {$cnb = "???";}
|
||||||
|
$cnb =~ s/^(0+)// if !$ssi_zro;
|
||||||
|
if (!$ssi_img) {print " ";}
|
||||||
|
elsif ($ssi_img == 1) {print "$cnb";}
|
||||||
|
else {
|
||||||
|
for($cnt = 0; $cnt <= length($cnb) - 1; $cnt++) { $digit = substr($cnb,$cnt,1);
|
||||||
|
print "<img \n src=\"$ssi_url"."$digit.gif"."\" width=\"$iwid\" height=\"$ihgt\" border=\"0\">";}
|
||||||
|
}
|
||||||
|
$ENV{'HTTP_REFERER'} = $ENV{'DOCUMENT_URI'};
|
||||||
|
&logged_as; &do_log;
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
sub do_clock {
|
||||||
|
local($digit,$chk) = ($_[0],$_[0]);
|
||||||
|
$digit = substr(date_time(0),$digit,1);
|
||||||
|
&sendFile($img_url.$digit.".gif", "image/gif");
|
||||||
|
if ($pn eq "c" && $chk eq 0) {&sg_count; &do_log;}
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
sub err_log {require "$log_path"."a_errlog.pl"; &err_logs}
|
||||||
|
|
||||||
|
########## Main
|
||||||
|
|
||||||
|
if ( $ENV{'DOCUMENT_URI'} ) { &do_ssi; }
|
||||||
|
if ( $ENV{'REQUEST_METHOD'} eq 'GET' ) {;}
|
||||||
|
elsif ( $ENV{'REQUEST_METHOD'} eq 'POST' ) {;}
|
||||||
|
else {$err = "illegal method"; &err_log;}
|
||||||
|
|
||||||
|
$query_string = $query->param('log');
|
||||||
|
$query_string =~ s/(\0|`|..\\)//g;
|
||||||
|
$pn = substr($query_string,0,1);
|
||||||
|
|
||||||
|
my $crf = 0;
|
||||||
|
|
||||||
|
if ($ENV{'HTTP_REFERER'}) {
|
||||||
|
foreach $referer (@referers) {
|
||||||
|
if ($ENV{'HTTP_REFERER'} =~ m|\Ahttps?://([^/]*)$referer|i) {
|
||||||
|
$crf = 1;
|
||||||
|
last;
|
||||||
|
} } }
|
||||||
|
if ($crf == 0) {$err = "bad referrer, off-site access denied"; &err_log;}
|
||||||
|
&logged_as;
|
||||||
|
if ($pn =~ /\Al\Z/i) {require "$log_path"."a_dolink.pl"; &do_link;}
|
||||||
|
elsif ($pn =~ /^(c|n)/) {&do_clock(substr($query_string,1,1));}
|
||||||
|
&sg_count;
|
||||||
|
if ($pn eq "p") {
|
||||||
|
local($digit) = substr($cnb,substr($query_string,1,1),1);
|
||||||
|
&sendFile($img_url.$digit.".gif", "image/gif");
|
||||||
|
&do_log if $query_string =~ /^p0$/;
|
||||||
|
} elsif ($pn eq "t") {
|
||||||
|
&sendFile($img_url."trans.gif", "image/gif");
|
||||||
|
&do_log ;
|
||||||
|
} elsif ($pn eq "0" || $pn eq "v") {
|
||||||
|
local($digit) = substr($cnb,0,1);
|
||||||
|
&sendFile($img_url.$digit.".gif", "image/gif");
|
||||||
|
&do_log if $pn eq "0";
|
||||||
|
} elsif ($pn =~ /[1-7]/) {
|
||||||
|
local($digit) = substr($cnb,$pn,1);
|
||||||
|
&sendFile($img_url.$digit.".gif", "image/gif");
|
||||||
|
}
|
||||||
|
exit(0);
|