%MonthBytes = %MonthHits = %MonthHostsKnown = %MonthHostsUnknown = %MonthPages = %MonthUnique = %MonthVisits =
%monthlib = %monthnum = ();
-$VERSION="3.2 (build 55)";
+$VERSION="3.2 (build 56)";
$Lang="en";
# Default value
return 0;
}
- # If session for read (no update), file can be open with share
- # POSSIBLE CHANGE HERE
+ # If session for read (no update), file can be open with share. So POSSIBLE CHANGE HERE
open(HISTORY,"$DirData/$PROG$DayRequired$month$year$FileSuffix.txt") || error("Error: Couldn't open for read file \"$DirData/$PROG$DayRequired$month$year$FileSuffix.txt\" : $!"); # Month before Year kept for backward compatibility
$MonthUnique{$year.$month}=0; $MonthPages{$year.$month}=0; $MonthHits{$year.$month}=0; $MonthBytes{$year.$month}=0; $MonthHostsKnown{$year.$month}=0; $MonthHostsUnKnown{$year.$month}=0;
my $readdomain=0;my $readbrowser=0;my $readnsver=0;my $readmsiever=0;
&debug(" Begin of VISITOR section");
$_=<HISTORY>;
chomp $_; s/\r//;
- if ($_ eq "") { error("Error: History file \"$DirData/$PROG$month$year$FileSuffix.txt\" is corrupted (in section VISITOR). Last line read is number $countlines.\nRestore a recent backup of this file, or remove it (data for this month will be lost)."); }
+ if ($_ eq "") { error("Error: History file \"$DirData/$PROG$month$year$FileSuffix.txt\" is corrupted (in section VISITOR). Last line read is number $countlines.\nCorrect the line, restore a recent backup of this file, or remove it (data for this month will be lost)."); }
my @field=split(/\s+/,$_); $countlines++;
my $count=0;
while ($field[0] ne "END_VISITOR") {
}
$_=<HISTORY>;
chomp $_; s/\r//;
- if ($_ eq "") { error("Error: History file \"$DirData/$PROG$month$year$FileSuffix.txt\" is corrupted (in section VISITOR). Last line read is number $countlines.\nRestore a recent backup of this file, or remove it (data for this month will be lost)."); }
+ if ($_ eq "") { error("Error: History file \"$DirData/$PROG$month$year$FileSuffix.txt\" is corrupted (in section VISITOR). Last line read is number $countlines.\nCorrect the line, restore a recent backup of this file, or remove it (data for this month will be lost)."); }
@field=split(/\s+/,$_); $countlines++;
}
&debug(" End of VISITOR section ($count entries)");
&debug(" Begin of UNKNOWNIP section");
$_=<HISTORY>;
chomp $_; s/\r//;
- if ($_ eq "") { error("Error: History file \"$DirData/$PROG$month$year$FileSuffix.txt\" is corrupted (in section UNKNOWNIP). Last line read is number $countlines.\nRestore a recent backup of this file, or remove it (data for this month will be lost)."); }
+ if ($_ eq "") { error("Error: History file \"$DirData/$PROG$month$year$FileSuffix.txt\" is corrupted (in section UNKNOWNIP). Last line read is number $countlines.\nCorrect the line, restore a recent backup of this file, or remove it (data for this month will be lost)."); }
my @field=split(/\s+/,$_); $countlines++;
my $count=0;
while ($field[0] ne "END_UNKNOWNIP") {
}
$_=<HISTORY>;
chomp $_; s/\r//;
- if ($_ eq "") { error("Error: History file \"$DirData/$PROG$month$year$FileSuffix.txt\" is corrupted (in section UNKNOWNIP). Last line read is number $countlines.\nRestore a recent backup of this file, or remove it (data for this month will be lost)."); }
+ if ($_ eq "") { error("Error: History file \"$DirData/$PROG$month$year$FileSuffix.txt\" is corrupted (in section UNKNOWNIP). Last line read is number $countlines.\nCorrect the line, restore a recent backup of this file, or remove it (data for this month will be lost)."); }
@field=split(/\s+/,$_); $countlines++;
}
&debug(" End of UNKNOWN_IP section ($count entries)");
&debug(" Begin of LOGIN section");
$_=<HISTORY>;
chomp $_; s/\r//;
- if ($_ eq "") { error("Error: History file \"$DirData/$PROG$month$year$FileSuffix.txt\" is corrupted (in section LOGIN). Last line read is number $countlines.\nRestore a recent backup of this file, or remove it (data for this month will be lost)."); }
+ if ($_ eq "") { error("Error: History file \"$DirData/$PROG$month$year$FileSuffix.txt\" is corrupted (in section LOGIN). Last line read is number $countlines.\nCorrect the line, restore a recent backup of this file, or remove it (data for this month will be lost)."); }
my @field=split(/\s+/,$_); $countlines++;
my $count=0;
while ($field[0] ne "END_LOGIN") {
}
$_=<HISTORY>;
chomp $_; s/\r//;
- if ($_ eq "") { error("Error: History file \"$DirData/$PROG$month$year$FileSuffix.txt\" is corrupted (in section LOGIN). Last line read is number $countlines.\nRestore a recent backup of this file, or remove it (data for this month will be lost)."); }
+ if ($_ eq "") { error("Error: History file \"$DirData/$PROG$month$year$FileSuffix.txt\" is corrupted (in section LOGIN). Last line read is number $countlines.\nCorrect the line, restore a recent backup of this file, or remove it (data for this month will be lost)."); }
@field=split(/\s+/,$_); $countlines++;
}
&debug(" End of LOGIN section ($count entries)");
&debug(" Begin of TIME section");
$_=<HISTORY>;
chomp $_; s/\r//;
- if ($_ eq "") { error("Error: History file \"$DirData/$PROG$month$year$FileSuffix.txt\" is corrupted (in section TIME). Last line read is number $countlines.\nRestore a recent backup of this file, or remove it (data for this month will be lost)."); }
+ if ($_ eq "") { error("Error: History file \"$DirData/$PROG$month$year$FileSuffix.txt\" is corrupted (in section TIME). Last line read is number $countlines.\nCorrect the line, restore a recent backup of this file, or remove it (data for this month will be lost)."); }
my @field=split(/\s+/,$_); $countlines++;
my $count=0;
while ($field[0] ne "END_TIME") {
}
$_=<HISTORY>;
chomp $_; s/\r//;
- if ($_ eq "") { error("Error: History file \"$DirData/$PROG$month$year$FileSuffix.txt\" is corrupted (in section TIME). Last line read is number $countlines.\nRestore a recent backup of this file, or remove it (data for this month will be lost)."); }
+ if ($_ eq "") { error("Error: History file \"$DirData/$PROG$month$year$FileSuffix.txt\" is corrupted (in section TIME). Last line read is number $countlines.\nCorrect the line, restore a recent backup of this file, or remove it (data for this month will be lost)."); }
@field=split(/\s+/,$_); $countlines++;
}
&debug(" End of TIME section ($count entries)");
&debug(" Begin of DAY section");
$_=<HISTORY>;
chomp $_; s/\r//;
- if ($_ eq "") { error("Error: History file \"$DirData/$PROG$month$year$FileSuffix.txt\" is corrupted (in section DAY). Last line read is number $countlines.\nRestore a recent backup of this file, or remove it (data for this month will be lost)."); }
+ if ($_ eq "") { error("Error: History file \"$DirData/$PROG$month$year$FileSuffix.txt\" is corrupted (in section DAY). Last line read is number $countlines.\nCorrect the line, restore a recent backup of this file, or remove it (data for this month will be lost)."); }
my @field=split(/\s+/,$_); $countlines++;
my $count=0;
while ($field[0] ne "END_DAY" ) {
}
$_=<HISTORY>;
chomp $_; s/\r//;
- if ($_ eq "") { error("Error: History file \"$DirData/$PROG$month$year$FileSuffix.txt\" is corrupted (in section DAY). Last line read is number $countlines.\nRestore a recent backup of this file, or remove it (data for this month will be lost)."); }
+ if ($_ eq "") { error("Error: History file \"$DirData/$PROG$month$year$FileSuffix.txt\" is corrupted (in section DAY). Last line read is number $countlines.\nCorrect the line, restore a recent backup of this file, or remove it (data for this month will be lost)."); }
@field=split(/\s+/,$_); $countlines++;
}
&debug(" End of DAY section ($count entries)");
&debug(" Begin of SIDER section");
$_=<HISTORY>;
chomp $_; s/\r//;
- if ($_ eq "") { error("Error: History file \"$DirData/$PROG$month$year$FileSuffix.txt\" is corrupted (in section SIDER). Last line read is number $countlines.\nRestore a recent backup of this file, or remove it (data for this month will be lost)."); }
+ if ($_ eq "") { error("Error: History file \"$DirData/$PROG$month$year$FileSuffix.txt\" is corrupted (in section SIDER). Last line read is number $countlines.\nCorrect the line, restore a recent backup of this file, or remove it (data for this month will be lost)."); }
my @field=split(/\s+/,$_); $countlines++;
my $count=0;my $countadd=0;
while ($field[0] ne "END_SIDER") {
}
$_=<HISTORY>;
chomp $_; s/\r//;
- if ($_ eq "") { error("Error: History file \"$DirData/$PROG$month$year$FileSuffix.txt\" is corrupted (in section SIDER). Last line read is number $countlines.\nRestore a recent backup of this file, or remove it (data for this month will be lost)."); }
+ if ($_ eq "") { error("Error: History file \"$DirData/$PROG$month$year$FileSuffix.txt\" is corrupted (in section SIDER). Last line read is number $countlines.\nCorrect the line, restore a recent backup of this file, or remove it (data for this month will be lost)."); }
@field=split(/\s+/,$_); $countlines++;
}
&debug(" End of SIDER section ($count entries loaded)");
&debug(" Begin of PAGEREFS section");
$_=<HISTORY>;
chomp $_; s/\r//;
- if ($_ eq "") { error("Error: History file \"$DirData/$PROG$month$year$FileSuffix.txt\" is corrupted (in section PAGEREFS). Last line read is number $countlines.\nRestore a recent backup of this file, or remove it (data for this month will be lost)."); }
+ if ($_ eq "") { error("Error: History file \"$DirData/$PROG$month$year$FileSuffix.txt\" is corrupted (in section PAGEREFS). Last line read is number $countlines.\nCorrect the line, restore a recent backup of this file, or remove it (data for this month will be lost)."); }
my @field=split(/\s+/,$_); $countlines++;
my $count=0;
while ($field[0] ne "END_PAGEREFS") {
}
$_=<HISTORY>;
chomp $_; s/\r//;
- if ($_ eq "") { error("Error: History file \"$DirData/$PROG$month$year$FileSuffix.txt\" is corrupted (in section PAGEREFS). Last line read is number $countlines.\nRestore a recent backup of this file, or remove it (data for this month will be lost)."); }
+ if ($_ eq "") { error("Error: History file \"$DirData/$PROG$month$year$FileSuffix.txt\" is corrupted (in section PAGEREFS). Last line read is number $countlines.\nCorrect the line, restore a recent backup of this file, or remove it (data for this month will be lost)."); }
@field=split(/\s+/,$_); $countlines++;
}
&debug(" End of PAGEREFS section ($count entries)");
&debug(" Begin of FILETYPES section");
$_=<HISTORY>;
chomp $_; s/\r//;
- if ($_ eq "") { error("Error: History file \"$DirData/$PROG$month$year$FileSuffix.txt\" is corrupted (in section FILETYPES). Last line read is number $countlines.\nRestore a recent backup of this file, or remove it (data for this month will be lost)."); }
+ if ($_ eq "") { error("Error: History file \"$DirData/$PROG$month$year$FileSuffix.txt\" is corrupted (in section FILETYPES). Last line read is number $countlines.\nCorrect the line, restore a recent backup of this file, or remove it (data for this month will be lost)."); }
my @field=split(/\s+/,$_); $countlines++;
my $count=0;
while ($field[0] ne "END_FILETYPES") {
}
$_=<HISTORY>;
chomp $_; s/\r//;
- if ($_ eq "") { error("Error: History file \"$DirData/$PROG$month$year$FileSuffix.txt\" is corrupted (in section FILETYPES). Last line read is number $countlines.\nRestore a recent backup of this file, or remove it (data for this month will be lost)."); }
+ if ($_ eq "") { error("Error: History file \"$DirData/$PROG$month$year$FileSuffix.txt\" is corrupted (in section FILETYPES). Last line read is number $countlines.\nCorrect the line, restore a recent backup of this file, or remove it (data for this month will be lost)."); }
@field=split(/\s+/,$_); $countlines++;
}
&debug(" End of FILETYPES section ($count entries)");
&debug(" Begin of SEARCHWORDS section");
$_=<HISTORY>;
chomp $_; s/\r//;
- if ($_ eq "") { error("Error: History file \"$DirData/$PROG$month$year$FileSuffix.txt\" is corrupted (in section SEARCHWORDS). Last line read is number $countlines.\nRestore a recent backup of this file, or remove it (data for this month will be lost)."); }
+ if ($_ eq "") { error("Error: History file \"$DirData/$PROG$month$year$FileSuffix.txt\" is corrupted (in section SEARCHWORDS). Last line read is number $countlines.\nCorrect the line, restore a recent backup of this file, or remove it (data for this month will be lost)."); }
my @field=split(/\s+/,$_); $countlines++;
my $count=0;
while ($field[0] ne "END_SEARCHWORDS") {
}
$_=<HISTORY>;
chomp $_; s/\r//;
- if ($_ eq "") { error("Error: History file \"$DirData/$PROG$month$year$FileSuffix.txt\" is corrupted (in section SEARCHWORDS). Last line read is number $countlines.\nRestore a recent backup of this file, or remove it (data for this month will be lost)."); }
+ if ($_ eq "") { error("Error: History file \"$DirData/$PROG$month$year$FileSuffix.txt\" is corrupted (in section SEARCHWORDS). Last line read is number $countlines.\nCorrect the line, restore a recent backup of this file, or remove it (data for this month will be lost)."); }
@field=split(/\s+/,$_); $countlines++;
}
&debug(" End of SEARCHWORDS section ($count entries)");
&debug(" Begin of SIDER_404 section");
$_=<HISTORY>;
chomp $_; s/\r//;
- if ($_ eq "") { error("Error: History file \"$DirData/$PROG$month$year$FileSuffix.txt\" is corrupted (in section SIDER_404). Last line read is number $countlines.\nRestore a recent backup of this file, or remove it (data for this month will be lost)."); }
+ if ($_ eq "") { error("Error: History file \"$DirData/$PROG$month$year$FileSuffix.txt\" is corrupted (in section SIDER_404). Last line read is number $countlines.\nCorrect the line, restore a recent backup of this file, or remove it (data for this month will be lost)."); }
my @field=split(/\s+/,$_); $countlines++;
my $count=0;
while ($field[0] ne "END_SIDER_404") {
}
$_=<HISTORY>;
chomp $_; s/\r//;
- if ($_ eq "") { error("Error: History file \"$DirData/$PROG$month$year$FileSuffix.txt\" is corrupted (in section SIDER_404). Last line read is number $countlines.\nRestore a recent backup of this file, or remove it (data for this month will be lost)."); }
+ if ($_ eq "") { error("Error: History file \"$DirData/$PROG$month$year$FileSuffix.txt\" is corrupted (in section SIDER_404). Last line read is number $countlines.\nCorrect the line, restore a recent backup of this file, or remove it (data for this month will be lost)."); }
@field=split(/\s+/,$_); $countlines++;
}
&debug(" End of SIDER_404 section ($count entries)");
#--------------------------------------------------------------------
-# Function: ChangeWordSeparatorsIntoSpace
+# Function: Change word separators into space and remove bad coded chars
# Input: stringtodecode
# Return: decodedstring
#--------------------------------------------------------------------
sub ChangeWordSeparatorsIntoSpace {
- $_[0] =~ s/%20/ /g;
- $_[0] =~ s/%22/ /g;
- $_[0] =~ s/%27/ /g;
- $_[0] =~ s/%28/ /g;
- $_[0] =~ s/%29/ /g;
- $_[0] =~ s/%2b/ /g;
- $_[0] =~ s/%2c/ /g;
- $_[0] =~ tr/\+\'\(\)\",/ /s; # "&" and "=" must not be in this list
+ $_[0] =~ s/%1[03]/ /g;
+ $_[0] =~ s/%2[02789abc]/ /g;
+ $_[0] =~ tr/\+\'\(\)\"\*,/ /s; # "&" and "=" must not be in this list
}