#!/usr/bin/perl
#
# Please read the e-mail you received
# with logit for installation instructions.
# (or readme.txt in the logit.zip file)
#
# This script is coupled with logitpro.cgi
#
# If you did not download this from logitpro.com, please do so
#
########
#Edit this if LogIT Fails to respond, exchange $ENV{'SCRIPT_NAME'} with the name of this script (ie: logitpro.cgi)
$script = $ENV{'SCRIPT_NAME'};
#set this to 1 if you forget your password... then set it back to 0 after you recover!!! IMPORTANT!!!!
$resetpass = 0;
#if you get a 500 error after installing, uncomment the next line (remove the # before "use CGI..."),
#and then submit a technical support request at http://helpdesk.logitpro.com
#use CGI::Carp qw(fatalsToBrowser);
#!!!!!DO NOT EDIT BELOW THIS LINE!!!!!
#I am sure that these translations are not perfect, please let me know if you know a better way of saying it
############################################
# copyright notice: This program is copyright 1999-2000 BCS (LogIT PRO)
# You may not edit, configure, or misconfigure anything under this copyright
# notice without written consent from the maker. Any altering will be
# defined as direct defiance of International copyright laws, and subject
# to fines and or punishment to the maximum of their degree in your country.
# Any plagiarism of this script without written consent from the maker will be
# defined as a direct defiance of International copyright laws, and subject
# to maximum fines and/or punishment as the laws are stated in your country.
#
# This copyright holds to the International Software Piracy Act
############################################
# la copie écrivent la notification: Ce programme est copie écrivent BCS 1999-2000 (LogIT PRO)
# vous peut ne pas éditer, configurent, ou le misconfigure quelque chose sous cette copie écrivent
# notification sans consentement écrit du générateur. modifier
# définir comme direct défit international copie écrire loi, et sujet
# amende et ou punition maximum leur degré dans votre pays
# tout plagiarism ce séquence type sans écrire consentement générateur
# définir tel que un direct défit international copie écrire loi, et sujet
# maximum amende et/ou punition tel que loi énoncer dans votre pays
#
# ce copie écrire prise international logiciel piraterie acte
############################################
# la copie écrivent la notification: Ce programme est copie écrivent BCS 1999-2000 (LogIT PRO)
# vous peut ne pas éditer, configurent, ou le misconfigure quelque chose sous cette copie écrivent
# notification sans consentement écrit du générateur. modifier
# définir comme direct défit international copie écrire loi, et sujet
# fine et ou punition maximum leur degré dans votre pays
# tout plagiarism ce séquence type sans écrire consentement générateur
# définir tel que un direct défit international copie écrire loi, et sujet
# maximum amende et/ou punition tel que loi énoncer dans votre pays
#
# ce copie écrire prise international logiciel piraterie acte
############################################
# la copia escriben el aviso: Este programa es copia escribe BCS 1999-2000 (LogIT PRO)
# usted puede no corregir, configura, o el misconfigure cualquier cosa bajo esta copia escribe
# aviso sin consentimiento escrito del fabricante. alterar ser
# definir como directo desafío internacional copia escribir ley, y tema
# multa y o castigo máximo su grado en su país
# cualquier plagiarism este escritura sin escribir consentimiento fabricante ser
# definir a medida que uno directo desafío internacional copia escribir ley, y tema
# máximo multa y/o castigo a medida que ley ser indicar en su país
#
# este copia escribir asimiento internacional software piratería acto
############################################
########### DO NOT EDIT BELOW ##############
############################################
$noupdat=0;$HeaderPrinted=0;
$cookieExpLength = 7776000;
$verinfo = "2.2.6";
&ginput;
&GetCookies;
if ($INPUT{'llogin'} ne "") {&llogin;}
elsif ($INPUT{'logout'} ne "") {&logout;}
elsif (!($ENV{'QUERY_STRING'} =~ /img/)) {print "Content-type: text/html\n\n";}
else {&img;exit;}
&chk;
&ReadConfig;
if ($p1 eq $p2) {$INPUT{'pword'} = $LPConfig{'password'};}
if ($resetpass) {&NewConfig(1,1,1,1,1);}
elsif ($INPUT{'NewConfig'} ne "") {&NewConfig();}
elsif ($INPUT{'UpdateDataFile'} ne "") {&UpdateDataFile;}
elsif ($INPUT{'tref'} ne "") {&logcheck; &tref($INPUT{'tref'});}
elsif ($INPUT{'tpag'} ne "") {&logcheck; &tpag($INPUT{'tpag'});}
elsif ($INPUT{'tsrh'} ne "") {&logcheck; &tsrh($INPUT{'tsrh'});}
elsif ($INPUT{'fixips'} ne "") {&logcheck; &fixips;}
elsif ($INPUT{'ggdate'} ne "") {&ggdate;}
elsif ($INPUT{'fixwbak'} ne "") {&logcheck; &fixwbak;}
elsif ($INPUT{'autoupdate'} ne "") {&autoupdate;}
elsif ($INPUT{'updatedata'} ne "") {&updatedata;}
elsif ($INPUT{'makebak'} ne "") {&logcheck; &makebak;}
elsif ($INPUT{'fixblank'} ne "") {&logcheck; &fixblank;}
elsif ($INPUT{'fixtitle'} ne "") {&logcheck; &fixtitle;}
elsif ($INPUT{'delete'} eq "on") {&del;}
elsif ($INPUT{'login'} ne "") {&logcheck; &login;}
elsif ($INPUT{'llogin'} ne "") {&llogin;}
elsif ($INPUT{'logout'} ne "") {&logout;}
elsif ($INPUT{'gencode'} ne "") {&logcheck; &gencode;}
elsif ($INPUT{'hourb'} ne "") {&logcheck; &hourb;}
elsif ($INPUT{'dalyb'} ne "") {&logcheck; &dalyb;}
elsif ($INPUT{'weekb'} ne "") {&logcheck; &weekb;}
elsif ($INPUT{'montb'} ne "") {&logcheck; &montb;}
elsif ($INPUT{'lastvisits'} ne "") {&logcheck; &lastvisits;}
elsif ($INPUT{'lastrefers'} ne "") {&logcheck; &lastrefers;}
elsif ($INPUT{'lastsearch'} ne "") {&logcheck; &lastsearch;}
elsif ($INPUT{'toprefers'} ne "") {&logcheck; &toprefers;}
elsif ($INPUT{'topsearch'} ne "") {&logcheck; &topsearch;}
elsif ($INPUT{'topsearcheg'} ne "") {&logcheck; &topsearcheg;}
elsif ($INPUT{'toppages'} ne "") {&logcheck; &toppages;}
elsif ($INPUT{'topips'} ne "") {&logcheck; &topips;}
elsif ($INPUT{'topclr'} ne "") {&logcheck; &topclr;}#LogitPRO VIP Service
elsif ($INPUT{'topjva'} ne "") {&logcheck; &topjva;}#LogitPRO VIP Service
elsif ($INPUT{'dele'} ne "") {&dele($INPUT{'dele'});}
elsif ($INPUT{'tophosts'} ne "") {&logcheck; &tophosts;}
elsif ($INPUT{'topdomains'} ne "") {&logcheck; &topdomains;}
elsif ($INPUT{'topcountries'} ne "") {&logcheck; &topcountries;}
elsif ($INPUT{'topplatform'} ne "") {&logcheck; &topplatform;}
elsif ($INPUT{'topbrowser'} ne "") {&logcheck; &topbrowser;}
elsif ($INPUT{'frame'} ne "") {&frame($INPUT{'frame'});}
elsif ($INPUT{'track'} ne "") {&logcheck; &track($INPUT{'track'});}
elsif ($INPUT{'img'} ne "") {&img;}
elsif ($ENV{'QUERY_STRING'} =~ /closed/) {&closed;}
else {print "[ERROR: no action specified]";}
sub ReadConfig {
$onoff = 0;
unless (-e "data/d.dat") {$onoff = 1;}
if ($onoff) {return;exit;}
readit('DATA','data/d.dat',1);
close (DATA);
foreach $data (@tmp) {
chomp($data);
($varname, $varvalue) = split(/\|/, $data);
$varvalue =~ s/^\s+//;
$varvalue =~ s/\s+$//;
$varvalue =~ s/\n//g;
$LPConfig{$varname} = $varvalue;
}
&gimgs;
if ($INPUT{'pword'} eq $guest) {$LPConfig{'ServerPath'} = "Not Shown to GUESTs";$LPConfig{'IPBlocked'} = "Not Shown to GUESTs";$LPConfig{'DomainBlocked'} = "Not Shown to GUESTs";$LPConfig{'mailprog'} = "Not Shown to GUESTs";$LPConfig{'yourmail'} = "Not Shown to GUESTs";$LPConfig{'password'} = "Not Shown to GUESTs";}
}
sub logcheck {
if ($LPConfig{'passprt'} && !($Cookies{'login'} eq "yes")) {$noupdat=1;&login;}
elsif ($LPConfig{'passprt'}) {print qq~logout ~;}
else {}
return;
}
sub fixips {
open (TMP,"data/i.dat");@info=split(/\r/,);close (TMP);
open (BAK,">i.bak");foreach $line (@info){print BAK "$line\r";}close (BAK);
open (TMP,">data/i.dat");
flock (TMP,2);
foreach $line (@info) {
@line=split(/\|/,$line);
$host=$line[4];use Socket;
@a=split(/\./,$host);$addr=pack('C4',@a);($name,$alias,$adrtype,$length,@address)=gethostbyaddr($addr,AF_INET);$host2=$name;
$host = substr($host2, 0, 80);if ($host2 ne $host){$host .= qq~...~;}
$line[5]=$host;
print TMP (join("|",@line),"\r");print "$line[4] = $host \r";
}
close (TMP);print "$name,$alias,$adrtype,$length,";print @address;
}
sub fixtitle {
open (TMP,">data/i.dat");
flock (TMP,2);
foreach $line (@info) {
@line=split(/\|/,$line);
if (!($line[10] && $line[10] ne "") && ($line[3] ne "" && $line[3])){$domain="$line[3]";$line[10]=&gettitle();$line[10]=~s/\'/\`/g;$line[10]=~s/\"/\`\`/g;$line[10]=~s/\|/\`/g;$line[10]=~s/\~/\`\`/g;}
print TMP (join("|",@line),"\r");print "$line[3] = $line[10] \r";
}
close (TMP);
}
sub fixwbak {
&header('Using THE Backup files');
@bak = ("data/i|info","data/c|count","data/o|overall","data/h|href","data/m|month and week","data/ip|daily ips");
foreach $line (@bak) {
@a = split(/\|/,$line);
@b = ("$a[0].dat","$a[0].bak");
$yesno = rename $b[1],$b[0];
if ($yesno) {$pt = qq~$IMG[3]> $a[1] backup has been used..... ~;
open (FILE,"$b[0]");
($dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $size, $atime, $mtime, $ctime, $blksize, $blocks) = stat(FILE);
close (FILE);
if ($size > 1) {$pt .= qq~$IMG[10] width=5 height=1>$IMG[3]> $a[1] backup has STUCK! ~;}
else {$pt .= qq~$IMG[10] width=5 height=1>$IMG[2]> ERROR: $a[1] backup has been lost... ~;}
}
else {$pt = qq~$IMG[2]>ERROR: $a[1] backup could not be used..... ~;}
open (TMP,"$b[0]");
@tmp = ;
close (TMP);
open (TMP,">$b[1]");
print TMP @tmp;
close (TMP);
$onoff = 1;unless (-e $b[1]) {$onoff = 0;}
if ($onoff) {
$pt .= qq~$IMG[10] width=15 height=1>$IMG[3]> $a[1] backup has been created..... ~;
open (FILE,"$b[1]");
($dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $size, $atime, $mtime, $ctime, $blksize, $blocks) = stat(FILE);
close (FILE);
if ($size > 1) {$pt .= qq~$IMG[10] width=15 height=1>$IMG[3]> $a[1] backup has been finished
~;}
else {$pt .= qq~$IMG[10] width=15 height=1>$IMG[2]>ERROR: data could not put into $a[1] backup file
~;}
}
else {$pt .= qq~$IMG[10] width=15 height=1>$IMG[2]>ERROR: $a[1] backup has NOT been created.....
~;}
print $pt;
}
print qq~$IMG[0]>Finished doing backup routine... if errors occured, please try again~;
&footer;
print qq~~;
}
sub fixblank {
&makebak;open (TMP,"data/i.dat");@info2=split(/\r/,);close (TMP);
open (TMP,">data/i.dat");
foreach $line (@info2) {
@line=split(/\|/,$line);
if (($line[0] ne "") && ($line[1] ne "") && ($line[2] ne "")) {
print TMP "$line[0]|$line[1]|$line[2]|$line[3]|$line[4]|$line[5]|$line[6]|$line[7]|$line[8]|$line[9]|$line[10]|\r";
}
else {print @line;print "<-- this line was not updated ";}
}
close (TMP);
}
sub makebak {
&header('Creating THE Backup files');
@bak = ("data/i|info","data/c|count","data/o|overall","data/h|href","data/m|month and week","data/ip|daily ips");
foreach $line (@bak) {
@a = split(/\|/,$line);
@b = ("$a[0].dat","$a[0].bak");
open (TMP,"$b[0]");
@tmp = ;
close (TMP);
open (TMP,">$b[1]");
print TMP @tmp;
close (TMP);
$onoff = 1;unless (-e $b[1]) {$onoff = 0;}
if ($onoff) {
$pt = qq~$IMG[3]> $a[1] backup has been created..... ~;
open (FILE,"$b[1]");
($dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $size, $atime, $mtime, $ctime, $blksize, $blocks) = stat(FILE);
close (FILE);
if ($size > 1) {$pt .= qq~ $IMG[3]> $a[1] backup has been finished
~;}
else {$pt .= qq~ $IMG[2]>ERROR: data could not put into $a[1] backup file
~;}
}
else {$pt = qq~$IMG[2]>ERROR: $a[1] backup has NOT been created.....
~;}
print $pt;
}
print qq~$IMG[0]>Finished doing backup routine... if errors occured, please try again~;
&footer;
print qq~~;
}
sub del {
if ($INPUT{'pword'} ne $LPConfig{'password'}) {&ErroR('Problem.... WRONG PASSWORD!!!');}
open (TMP,"data/i.dat");@info = split(/\r/,);close (TMP);$b=0;
$del=~s/[^\w]/_/g;
foreach $line (@info) {
@line=split(/\|/,$line);$lline="$line\r";
$line[0] =~ s/[^\w]/_/g;
if (!($del =~ /$line[0]/)) {if ($b) {push @ino,$lline;} else {@ino=$lline;}}
$b++;
}
open (LOCK,">lock.test");flock (LOCK,2);print LOCK "1234567890";close (LOCK);
open (LOCK,"lock.test");@lock = ;if ($lock[0] eq "1234567890") {$ynprint = 1;} else {$ynprint = 0;}
open (LOCK,">lock.test");close(LOCK);
if ($ynprint) {open (TMP,">data/i.dat");flock (TMP,2);print TMP @ino;close (TMP);}
else {print qq~
ERROR - READ/WRITE
There was a problem writing to the files on your server. Possible problems include: no space on disk, files are currently locked and/or being writtian to
~;}
print "Settings updated/deleted...
";$INPUT{'pword'} = "";&login;
}
#Login
sub login {
$frames= "login";
print shift;
print " ";
&header("Mozaik LogIT PRO LOGIN AREA");
if ($LPConfig{'passprt'} && !($Cookies{'login'} eq "yes")) {
print qq~ $Cookies{'login'}
In order
to edit your configurations, you must enter your admin password here and press enter
\r
You must login
to view your statistics.
\r
Reset files
\r
~;
}
elsif ($LPConfig{'passprt'}) {
print qq~
In order
to edit your configurations, you must enter your admin password here and press enter
You are logged in, but for security reasons, you must still type your password to view configurations:
\r
You are Logged In
\r
Reset files
You are logged in, but for security reasons, you must still type your password to view configurations:
\r
~;
}
else {
print qq~
In order
to edit your configurations, you must enter your admin password here and press enter
In order
to edit your configurations, you must enter your admin password here and press enter
You are logged in, but for security reasons, you must still type your password to view configurations:
\r
You are Logged In
\r
Reset files
You are logged in, but for security reasons, you must still type your password to view configurations:
\r
~;
&footer;
exit;
}
}
sub logout {
$frames= "logout";
&ClearCookies;
&header("Mozaik Logged Out of LogIT PRO");
print qq~successful logout!~;
print qq~
In order
to edit your configurations, you must enter your admin password here and press enter
\r
You must login
to view your statistics.
\r
Reset files
\r
The footer will not be displayed for security reasons
~;
exit;
}
#Hourly Breakdown
sub hourb {
$frames= "hourb";
open (INFO,"data/i.dat") || &ErroR('unable to open the info file i.dat for reading');
@info = split(/\r/,);
close (INFO);
&header("Mozaik LogIT PRO HOURLY BREAKDOWN AREA");
$table = qq~
~;
&footer;
}
#last $LPConfig{'LastVisits'} visitors
sub lastvisits {
$frames= "lastvisits";
&header("Mozaik LogIT PRO LAST VISITS AREA");
if ($INPUT{'list'}) {$list = $INPUT{'list'};}
else {$list = $LPConfig{'LastVisits'};}
open (INFO,"data/i.dat") || &ErroR('unable to open the info file i.dat');
@info = split(/\r/,);
close (INFO);
@info = sort {uc($b) cmp uc($a)} @info;
$dte = "";$n=0;$table = qq~~;
print qq~
~;
print $table;
&footer;
}
sub dele {
if ($INPUT{'pword'} && ($INPUT{'pword'} eq $LPConfig{'password'})) {
$dele = shift;
if ($dele eq "m.dat") {unlink "data/m.dat";open (TMP,">data/m.dat") || ErroR("Error creating monthly-daily data file 'm.dat'");print TMP "Sun:|Mon:|Tue:|Wed:|Thu:|Fri:|Sat:|\rJan:|Feb:|Mar:|Apr:|May:|Jun:|Jul:|Aug:|Sep:|Oct:|Nov:|Dec:|";close (TMP);&header('deleted the month/week file');print "finished...";&footer;}
elsif ($dele eq "h.dat") {unlink "data/h.dat";open (TMP,">data/h.dat") || ErroR("Error creating history data file 'h.dat'");close (TMP);&header('deleted the daily file');print "finished...";&footer;} #history
elsif ($dele eq "ip.dat") {unlink "data/ip.dat";open (TMP,">data/ip.dat") || ErroR("Error creating daily ip data file 'ip.dat'");close (TMP);&header('deleted today`s unique ip file');print "finished...";&footer;} #ip
elsif ($dele eq "r.dat") {unlink "data/r.dat";open (TMP,">data/r.dat") || ErroR("Error creating referer newlink data file 'r.dat'");close (TMP);&header('deleted the new/old referrer file');print "finished...";&footer;} #href
elsif ($dele eq "c.dat") {
unlink "data/u.overall";open (TMP,">data/u.overall") || ErroR("Error creating the count data file 'c.dat'");close (TMP);
unlink "data/t.overall";open (TMP,">data/t.overall") || ErroR("Error creating the count data file 'c.dat'");close (TMP);
unlink "data/u.count";open (TMP,">data/u.count") || ErroR("Error creating the count data file 'c.dat'");close (TMP);
unlink "data/t.count";open (TMP,">data/t.count") || ErroR("Error creating the count data file 'c.dat'");close (TMP);
unlink "data/c.dat";open (TMP,">data/c.dat") || ErroR("Error creating the count data file 'c.dat'");close (TMP);
&header('deleted today`s hit count file');print "finished...";&footer;
} #count
elsif ($dele eq "i.dat") {unlink "data/i.dat";open (TMP,">data/i.dat") || ErroR("Error creating info data file 'i.dat'");close (TMP);&header('deleted the info file');print "finished...";&footer;} #info
elsif ($dele eq "o.dat") {&gdate;unlink "data/o.dat";open (TMP,">data/o.dat") || ErroR("Error creating overall data file 'o.dat'");print TMP "$date\, $clock|0|0|";close (TMP);&header('deleted the overall file');print "finished...";&footer;} #overall
elsif ($dele eq "all") {unlink "data/m.dat";unlink "data/o.dat";unlink "data/i.dat";unlink "data/c.dat";unlink "data/r.dat";unlink "data/ip.dat";unlink "data/h.dat";&chk;&header('deleted all of the files');print "finished...";&footer;}
elsif ($dele eq "revert") {
opendir(TMP,"data");
@a = readdir(TMP);closedir(TMP);
foreach $del (@a) {
if ($del ne "." && $del ne "..") {
$del = "data/$del";
$deel = unlink $del;
if ($deel) {print " $del - deleted! \r";}
else {print " $del - NOT DELETED! \r";}
}
}
rmdir "data";print " data/ - deleted! \r";
unlink "search.dat";print " search.dat - deleted! \r";
print "
Everything has been deleted/removed from the logit directory except for logitpro.cgi and extras.bin (and any other file that you uploaded, and wasn't created by logitpro)";
print "
once you run $script?login , everything will be recreated fresh just like you are using it for the first time";
}
elsif (!($dele eq "d.dat")) {unlink "$dele";}}
}
sub chk {
unless (-e "data") {mkdir "data",755;$mode = 0700; chmod $mode, 'data'; }
unless (-e "data/h.dat") {open (TMP,">data/h.dat") || ErroR("Error creating history data file 'h.dat'");close (TMP);} #history
unless (-e "data/ip.dat") {open (TMP,">data/ip.dat") || ErroR("Error creating daily ip data file 'ip.dat'");close (TMP);} #ip
unless (-e "data/r.dat") {open (TMP,">data/r.dat") || ErroR("Error creating referer newlink data file 'r.dat'");close (TMP);} #href
unless (-e "data/m.dat") {open (TMP,">data/m.dat") || ErroR("Error creating monthly-daily data file 'm.dat'");print TMP "Sun:|Mon:|Tue:|Wed:|Thu:|Fri:|Sat:|\rJan:|Feb:|Mar:|Apr:|May:|Jun:|Jul:|Aug:|Sep:|Oct:|Nov:|Dec:|";close (TMP);} #monthly
unless (-e "data/c.dat") {open (TMP,">data/c.dat") || ErroR("Error creating the count data file 'c.dat'");close (TMP);} #count
unless (-e "data/i.dat") {open (TMP,">data/i.dat") || ErroR("Error creating info data file 'i.dat'");close (TMP);} #info
unless (-e "data/o.dat") {&gdate;open (TMP,">data/o.dat") || ErroR("Error creating overall data file 'o.dat'");print TMP "$date\, $clock|0|0|";close (TMP);} #overall
if ($INPUT{'UpdateDataFile'} ne "") {&UpdateDataFile;exit;}
unless (-e "data/d.dat") {&gimgs;&NewConfig("Configurations have either not been set, or have been deleted",1);}#data
}
sub glstvis {
$b=1;
foreach $line (@info) {
@lisst = split(/\|/,$line);
$lisst[2] =~ s/ //g;
if ($dte ne $lisst[1]) {
$dte = $lisst[1];
$dayy = gday($lisst[0]);
$table .= "
$dayy, $dte
\r";
$ttd="
";$tdd="
";
$table .= "
$ttd Extra $tdd $ttd Time $tdd$ttd IP Address $tdd$ttd Host name $tdd$ttd Accessed Page $tdd
";
}
if (($b / 2) =~ /\./) {$color="tddark"}
else {$color="tdlight"}
if ($lisst[4] ne "" && $lisst[4]) {
$lisst[4] = substr($lisst[4],0,15);
$imagg3 = qq~$IMG[1] alt="Click here to track the ip: $lisst[4]" border=0>~;
}
else {$imagg3 = qq~$IMG[11]>~;}
if ($lisst[5] ne "" && $lisst[5]) {
$lisst[5] = substr($lisst[5],0,35);
@tmp = split (/\./,$lisst[5]);$tmp1=$tmp[$#tmp];$tmp0=$tmp[($#tmp-1)];$tmp2=$tmp[($#tmp-2)];if ($tmp0 eq "com") {$tmp0="$tmp2.$tmp0";}$domain = "$tmp0.$tmp1";
$imagg4 = qq~$IMG[0] alt="Click here to track the domain: $domain" border=0>~;
}
else {$imagg4 = qq~$IMG[11]>~;}
if ($lisst[10] ne "") {$lisst[10]="($lisst[10])";}else{$lisst[10]=""}
if ($lisst[9] ne "" && $lisst[9]) {
$lisst[10] =~ s/\'//g;$imagg1 = qq~$IMG[3] alt="Referred by Search: $lisst[9]" border=0>~;
}
elsif ($lisst[3] ne "" && $lisst[3]) {
$lisst[10] =~ s/\'//g;$imagg1 = qq~$IMG[3] alt="Referred by: $lisst[10] $lisst[3]" border=0>~;
}
else {$imagg1 = qq~$IMG[11]>~;}
$check = 0;
($lisst[8],$check) = split(/~x~/,$lisst[8]);
if ($check =~ /\*/) {
$lisst[8] =~ s/\'//g;
$imagg2 = qq~$IMG[2] alt="Accessed page: $lisst[8] was not found on your server at $lisst[2], $lisst[1]">~;$imagg5 = qq~$IMG[11]>~;
}
else {$imagg2 = qq~$IMG[11]>~;$imagg5 = qq~$IMG[4] alt="track local page: $lisst[8]" border=0>~;}
$shortl8 = substr($lisst[8],-20,20);
if ($shortl8 ne $lisst[8]) {$lisst[8]=qq~...$shortl8~;}
else {$lisst[8]=qq~$shortl8~;}
$table .= qq~
The following is a list of the top $list Referral Pages which created these hits, if nothing shows, it means there was an insignificant number of referrals:
~;
&trkpgs;
$table .= "
";
$table .= qq~ The following is a list of the top $list IP addresses which created these hits (clicking on an IP will perform a HOST lookup):
~;
&trkips;
$table .= "
";
#$table .= "
";
print "$table";
&footer;
}
sub tpag {
$track = shift;
$track =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
if ($INPUT{'list'}) {$list = $INPUT{'list'};}
else {$list = $LPConfig{'TopRefers'};}
open (INFO,"data/i.dat") || &ErroR('unable to open the info file i.dat');
@info = split (/\r/,);
close (INFO);
@info = sort {uc($b) cmp uc($a)} @info;
@tracked = "";
foreach $line (@info) {
@ba = split(/\|/,$line);
$aba = $ba[8] . "-";
$bab = $track . "-";
if ($aba eq $bab) {push (@tracked,$line);}
$aba = "";$bab = "";
}
$ttrr = $#tracked;
&header("Tracking Local Page $track");
$table = qq~Tracking local Page $track
The following is a list of the top $list Referral Pages which created these hits, if nothing shows, it means there was an insignificant number of referrals:
~;
&trkrefs;
$table .= "
";
$table .= qq~ The following is a list of the top $list IP addresses which created these hits (clicking on an IP will perform a HOST lookup):
~;
&trkips;
$table .= "
";
print "$table";
&footer;
}
sub tsrh {
$track = shift;
if ($track =~ /\?/) { $track = $ENV{'QUERY_STRING'}; $track =~ s/tsrh\=//g;}
$track =~ tr/+/ /;$track =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
@trak = split(/\:/,$track);
$track = "$trak[0]:$trak[1]";
$lnkk = $trak[2];
if ($trak[3] ne "") {$lnkk .= ":$trak[3]";}
if ($INPUT{'list'}) {$list = $INPUT{'list'};}
else {$list = $LPConfig{'TopHosts'};}
open (INFO,"data/i.dat") || &ErroR('unable to open the info file i.dat');
@info = split (/\r/,);
close (INFO);
@info = sort {uc($b) cmp uc($a)} @info;
@tracked = "";
foreach $line (@info) {if ($line =~ /$track/) {push (@tracked,$line);}}
$ttrr = $#tracked;
&header("Tracking Referrer $track");
@tracked = sort {$a <=> $b} @tracked;
$table = qq~Tracking Referrer $track
The following is a list of the top $list Referral Pages which created these hits, if nothing shows, it means there was an insignificant number of referrals:
~;
&trkpgs;
$table .= "
";
$table .= qq~ The following is a list of the top $list IP addresses which created these hits (clicking on an IP will perform a HOST lookup):
\r~;
$enter = $lisst[0];$ent++;
}
if (($b / 2) =~ /\./) {$color="tddark"}
else {$color="tdlight"}
($lisst[8],$check) = split(/~x~/,$lisst[8]);
if ($check =~ /\*/) {
$lisst[8] =~ s/\'//g;
$imagg2 = qq~$IMG[2] alt="Accessed page: $lisst[8] was not found on your server at $lisst[2], $lisst[1]" onClick="alert('Accessed page: $lisst[8] was not found on your server at $lisst[2], $lisst[1]');">~;
}
else {$imagg2 = qq~$IMG[11]>~;}
$ttable .= qq~
\r~;
$b++;
if ($b > $list) {return;exit;}
}
}
}
sub gencode {
if ($INPUT{'genit'} eq "java") {$gen="Javascript Code";$generate = qq~<script src="$LPConfig{'URI'}?java"></script>
<!-- // Note, Javascript code adds a hidden 1x1 image to your page, Put this code in the body area, or it will not work. // -->~;}
elsif ($INPUT{'genit'} eq "ssi") {$gen="SSI Code";$generate = qq~<!--#include virtual="$LPConfig{'URI'}?count"-->~;}
&header('Mozaik LOGIT PRO GENERATE CODE AREA');
print qq~
What kind of code would you like generated?
note: javascript code doesn't work on frame pages, you can only use it on content pages. You can also use a combination of javascript and SSI, but only use one per page.~;
print qq~
$gen
~;
&footer();
}
#Top $LPConfig{'TopRefers'} Referrers
sub toprefers {
$frames= "toprefers";
&header("Mozaik LogIT PRO TOP REFERRER AREA");
print "note, if you see nothing below it is because an insufficient amount of hits have been generated. If this is the case, please stop back later
";
if ($INPUT{'list'}) {$list = $INPUT{'list'};}
else {$list = $LPConfig{'TopRefers'};}
open (INFO,"data/i.dat") || &ErroR('unable to open the info file i.dat');
@info = split(/\r/,);
close (INFO);
@info = sort {uc($b) cmp uc($a)} @info;
$dte = "";$n=0;$table = qq~
\r~;
$b++;
if ($b > $list) {return;exit;}
}
}
}
#Top $LPConfig{'TopRefers'} Searches
sub topsearch {
$frames= "topsearch";
&header("Mozaik LogIT PRO TOP SEARCH AREA");
print "note, if you see nothing below it is because an insufficient amount of hits have been generated. If this is the case, please stop back later
";
if ($INPUT{'list'}) {$list = $INPUT{'list'};}
else {$list = $LPConfig{'TopRefers'};}
open (INFO,"data/i.dat") || &ErroR('unable to open the info file i.dat');
@info = split(/\r/,);
close (INFO);
@info = sort {uc($b) cmp uc($a)} @info;
$dte = "";$n=0;$table = qq~
\r~;
$b++;
if ($b > $list) {return;exit;}
}
}
}
#Top $LPConfig{'TopRefers'} SearchEng
sub topsearcheg {
$frames= "topsearcheg";
&header("Mozaik LogIT PRO TOP SEARCH AREA");
print "note, if you see nothing below it is because an insufficient amount of hits have been generated. If this is the case, please stop back later
";
if ($INPUT{'list'}) {$list = $INPUT{'list'};}
else {$list = $LPConfig{'TopRefers'};}
open (INFO,"data/i.dat") || &ErroR('unable to open the info file i.dat');
@info = split(/\r/,);
close (INFO);
@info = sort {uc($b) cmp uc($a)} @info;
$dte = "";$n=0;$table = qq~
\r";
$b++;
if ($b > $list) {return;exit;}
}
}
}
#Top $LPConfig{'TopRefers'} Local Pages
sub toppages {
$frames= "toppages";
&header("Mozaik LogIT PRO TOP LOCAL PAGE AREA");
print "note, if you see nothing below it is because an insufficient amount of hits have been generated. If this is the case, please stop back later
";
if ($INPUT{'list'}) {$list = $INPUT{'list'};}
else {$list = $LPConfig{'TopRefers'};}
open (INFO,"data/i.dat") || &ErroR('unable to open the info file i.dat');
@info = split(/\r/,);
close (INFO);
@info = sort {uc($b) cmp uc($a)} @info;
$dte = "";$n=0;$table = qq~
";
&header("Mozaik LogIT PRO TOP IPS AREA");
print "note, if you see nothing below it is because an insufficient amount of hits have been generated. If this is the case, please stop back later
";
&header("Mozaik LogIT PRO TOP HOSTS AREA");
print "note, if you see nothing below it is because an insufficient amount of hits have been generated. If this is the case, please stop back later
";
&header("Mozaik LogIT PRO TOP DOMAINS AREA");
print "note, if you see nothing below it is because an insufficient amount of hits have been generated. If this is the case, please stop back later
";
>opips(6);
$table .= qq~
~;
print qq~
~;
print qq~
~;
print $table;
&footer;
}
#Top $LPConfig{'TopPlat'} Countries
sub topcountries {
open (BIN,"extras.bin") || &ErroR('unable to open the extras file for data output');
@bin = ;$bin="@bin";
($junk,$tmp) = split(/~~\|~~/,$bin);@countries=split(/\|\|\|/,$tmp);close (BIN);
$frames= "topcountries";
&header("Mozaik LogIT PRO TOP COUNTRY AREA");
print "note, if you see nothing below it is because an insufficient amount of hits have been generated. If this is the case, please stop back later
";
if ($INPUT{'list'}) {$list = $INPUT{'list'};}
else {$list = $LPConfig{'TopPlat'};}
open (INFO,"data/i.dat") || &ErroR('unable to open the info file i.dat');
@tmp = split(/\r/,);
close (INFO);
@info = sort {uc($b) cmp uc($a)} @info;
$dte = "";$n=0;$table = qq~
\r";
$b++;
if ($b > $list) {return;exit;}
}
}
}
sub gctry {
$data="";
$ctry="";
$dat=shift;
if (!($dat && $dat ne "")) {return "[no host to check country with]";exit;}
foreach $line (@countries) {
($data,$ctry) = split(/\|/,$line);
if ($data =~ /$dat/) {return "$ctry [$dat]";exit;}
}
return "not found ($dat)";
}
#Top $LPConfig{'TopPlat'} Platforms
sub topplatform {#7
$frames= "topplatform";
&header("Mozaik LogIT PRO TOP PLATFORM AREA");
print "note, if you see nothing below it is because an insufficient amount of hits have been generated. If this is the case, please stop back later
";
if ($INPUT{'list'}) {$list = $INPUT{'list'};}
else {$list = $LPConfig{'TopPlat'};}
open (INFO,"data/i.dat") || &ErroR('unable to open the info file i.dat');
@info = split(/\r/,);
close (INFO);
@info = sort {uc($b) cmp uc($a)} @info;
$dte = "";$n=0;$table = qq~
\r";
$b++;
if ($b > $list) {return;exit;}
}
}
}
#Top $LPConfig{'TopPlat'} Browsers
sub topbrowser {
$frames= "topbrowser";
&header("Mozaik LogIT PRO TOP BROWSER AREA");
print "note, if you see nothing below it is because an insufficient amount of hits have been generated. If this is the case, please stop back later
";
if ($INPUT{'list'}) {$list = $INPUT{'list'};}
else {$list = $LPConfig{'TopPlat'};}
open (INFO,"data/i.dat") || &ErroR('unable to open the info file i.dat');
@info = split(/\r/,);
close (INFO);
@info = sort {uc($b) cmp uc($a)} @info;
$dte = "";$n=0;$table = qq~
when you see the button appear above, click on it to update your search.dat file.
~;
&footer;
exit;
}
sub updatedata {
@tmp = split(/\|~~/,$INPUT{'updatedata'});
open (TMP,">search.dat") || &ErroR('unable to update search file');
foreach $tmp (@tmp) {
print TMP "$tmp\n";
}
close (TMP);
open (FILE,"search.dat");
($dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $size, $atime, $mtime, $ctime, $blksize, $blocks) = stat(FILE);
close (FILE);
if ($size < 100) {&ErroR('Data in search.dat file has been lost due to a server error... Please update immediately! (contact searchdaterror@logitpro.com and tell them your problem)');}
else {&login('Search.dat has been updated!');}
}
sub header {
$title = shift;
open (TMP,"data/c.dat");@count = split(/\|/,);close (TMP);
open (TMP,"data/o.dat");@overall = split(/\|/,);close (TMP);
open (TMP,"search.dat");
@logit=;
close (TMP);
$sinfo = $logit[0];
print qq~
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
$title
$title
|
~;#DO NOT EDIT THIS OUT -- CONTACT webmaster\@logitpro.com
print qq~