From: eldy <> Date: Fri, 11 Jan 2002 03:04:50 +0000 (+0000) Subject: Added links from NewsGroup in "Connect from" report. X-Git-Tag: AWSTATS_4_0_BETA~149 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d51bf424fd1e38bffbfb31366f655e064beba837;p=thirdparty%2FAWStats.git Added links from NewsGroup in "Connect from" report. --- diff --git a/wwwroot/cgi-bin/awstats.pl b/wwwroot/cgi-bin/awstats.pl index 8aece60d..f4d860db 100644 --- a/wwwroot/cgi-bin/awstats.pl +++ b/wwwroot/cgi-bin/awstats.pl @@ -937,6 +937,7 @@ sub Check_Config { if (! $Message[104]) { $Message[104]="Entry pages"; } if (! $Message[105]) { $Message[105]="Code"; } if (! $Message[106]) { $Message[106]="Average size"; } + if (! $Message[107]) { $Message[107]="Links from a NewsGroup"; } } #-------------------------------------------------------------------- @@ -994,12 +995,14 @@ sub Read_History_File { if ($field[0] eq "From2") { $_from_p[2]+=$field[1]; $_from_h[2]+=$field[2]; next; } if ($field[0] eq "From3") { $_from_p[3]+=$field[1]; $_from_h[3]+=$field[2]; next; } if ($field[0] eq "From4") { $_from_p[4]+=$field[1]; $_from_h[4]+=$field[2]; next; } - # Next 5 lines are to read old awstats history files ("Fromx" section was "HitFromx" in such files) + if ($field[0] eq "From5") { $_from_p[5]+=$field[1]; $_from_h[5]+=$field[2]; next; } + # Next lines are to read old awstats history files ("Fromx" section was "HitFromx" in such files) if ($field[0] eq "HitFrom0") { $_from_p[0]+=0; $_from_h[0]+=$field[1]; next; } if ($field[0] eq "HitFrom1") { $_from_p[1]+=0; $_from_h[1]+=$field[1]; next; } if ($field[0] eq "HitFrom2") { $_from_p[2]+=0; $_from_h[2]+=$field[1]; next; } if ($field[0] eq "HitFrom3") { $_from_p[3]+=0; $_from_h[3]+=$field[1]; next; } if ($field[0] eq "HitFrom4") { $_from_p[4]+=0; $_from_h[4]+=$field[1]; next; } + if ($field[0] eq "HitFrom5") { $_from_p[5]+=0; $_from_h[5]+=$field[1]; next; } if ($field[0] eq "BEGIN_TIME") { &debug(" Begin of TIME section"); @@ -1624,7 +1627,8 @@ sub Save_History_File { print HISTORYTMP "From1 ".int($_from_p[1])." ".int($_from_h[1])."\n"; print HISTORYTMP "From2 ".int($_from_p[2])." ".int($_from_h[2])."\n"; print HISTORYTMP "From3 ".int($_from_p[3])." ".int($_from_h[3])."\n"; - print HISTORYTMP "From4 ".int($_from_p[4])." ".int($_from_h[4])."\n"; + print HISTORYTMP "From4 ".int($_from_p[4])." ".int($_from_h[4])."\n"; # Same site + print HISTORYTMP "From5 ".int($_from_p[5])." ".int($_from_h[5])."\n"; # News print HISTORYTMP "BEGIN_SEREFERRALS\n"; foreach my $key (keys %_se_referrals_h) { print HISTORYTMP "$key $_se_referrals_h{$key}\n"; next; } print HISTORYTMP "END_SEREFERRALS\n"; @@ -1689,8 +1693,8 @@ sub Init_HashArray { $HistoryFileAlreadyRead{"$year$month"}=0; # Delete/Reinit all arrays with name beginning by _ @_msiever_h = @_nsver_h = (); - for (my $ix=0; $ix<5; $ix++) { $_from_p[$ix]=0; $_from_h[$ix]=0; } - for (my $ix=0; $ix<=23; $ix++) { $_time_h[$ix]=0; $_time_k[$ix]=0; $_time_p[$ix]=0; } + for (my $ix=0; $ix<6; $ix++) { $_from_p[$ix]=0; $_from_h[$ix]=0; } + for (my $ix=0; $ix<24; $ix++) { $_time_h[$ix]=0; $_time_k[$ix]=0; $_time_p[$ix]=0; } # Delete/Reinit all hash arrays with name beginning by _ %_browser_h = %_domener_h = %_domener_k = %_domener_p = %_errors_h = %_filetypes_h = %_filetypes_k = %_filetypes_gz_in = %_filetypes_gz_out = @@ -2993,7 +2997,8 @@ if ($UpdateStats) { # News Link ? if (! $found && $refererprot =~ /^news/i) { $found=1; - # TODO + if ($PageBool) { $_from_p[5]++; } + $_from_h[5]++; } } } @@ -4088,25 +4093,29 @@ EOF debug("ShowOriginStats",2); print "$CENTER 
"; &tab_head($Message[36],19); - my @p_p=(0,0,0,0,0); + my @p_p=(0,0,0,0,0,0); if ($TotalPages > 0) { $p_p[0]=int($_from_p[0]/$TotalPages*1000)/10; $p_p[1]=int($_from_p[1]/$TotalPages*1000)/10; $p_p[2]=int($_from_p[2]/$TotalPages*1000)/10; $p_p[3]=int($_from_p[3]/$TotalPages*1000)/10; $p_p[4]=int($_from_p[4]/$TotalPages*1000)/10; + $p_p[5]=int($_from_p[5]/$TotalPages*1000)/10; } - my @p_h=(0,0,0,0,0); + my @p_h=(0,0,0,0,0,0); if ($TotalHits > 0) { $p_h[0]=int($_from_h[0]/$TotalHits*1000)/10; $p_h[1]=int($_from_h[1]/$TotalHits*1000)/10; $p_h[2]=int($_from_h[2]/$TotalHits*1000)/10; $p_h[3]=int($_from_h[3]/$TotalHits*1000)/10; $p_h[4]=int($_from_h[4]/$TotalHits*1000)/10; + $p_h[5]=int($_from_h[5]/$TotalHits*1000)/10; } print "$Message[37]$Message[56]$Message[15]$Message[57]$Message[15]\n"; #------- Referrals by direct address/bookmarks print "$Message[38]$_from_p[0] $p_p[0] %$_from_h[0] $p_h[0] %\n"; + #------- Referrals by news group + print "$Message[107]$_from_p[5] $p_p[5] %$_from_h[5] $p_h[5] %\n"; #------- Referrals by search engine print "$Message[40]
\n"; print "\n";