tmp>perl -MCPAN -e shell 色々と質問に答えます。 CPAN>install HTML::Entities::Numbered CPAN>install Unicode::Japanese CPAN>install Jcode
--- C:\awstats-6.95-mod/wwwroot/cgi-bin/awstats.pl Thu Nov 19 16:36:17 2009 +++ C:\AWStats695t_Jpn/wwwroot/cgi-bin/awstats.pl Wed Nov 25 10:40:17 2009 @@ -32,9 +36,10 @@ use vars qw/ $DEBUGFORCED $NBOFLINESFORBENCHMARK $FRAMEWIDTH $NBOFLASTUPDATELOOKUPTOSAVE $LIMITFLUSH $NEWDAYVISITTIMEOUT $VISITTIMEOUT $NOTSORTEDRECORDTOLERANCE -$WIDTHCOLICON $TOOLTIPON +$WIDTHCOLICON $WIDTHHIT $WIDTHPAGE $WIDTHBANDWIDTH $WIDTHFULLDATE $WIDTHPARCENT $WIDTHYESNO $WIDTHBROWSER $WIDTHOS $TOOLTIPON $lastyearbeforeupdate $lastmonthbeforeupdate $lastdaybeforeupdate $lasthourbeforeupdate $lastdatebeforeupdate +$endtag $OptionSelect /; $DEBUGFORCED=0; # Force debug level to log lesser level into debug.log file (Keep this value to 0) $NBOFLINESFORBENCHMARK=8192; # Benchmark info are printing every NBOFLINESFORBENCHMARK lines (Must be a power of 2) @@ -51,9 +56,17 @@ $NOTSORTEDRECORDTOLERANCE = 20000 ; # Lapse of time to accept a record if not in correct order. 20000 = 2 hour (Default = 20000) $WIDTHCOLICON = 32; +$WIDTHHIT=70; +$WIDTHPAGE=70; +$WIDTHBANDWIDTH=80; +$WIDTHFULLDATE=160; +$WIDTHPARCENT=80; +$WIDTHYESNO=50; +$WIDTHBROWSER=160; +$WIDTHOS=90; $TOOLTIPON = 0; # Tooltips plugin loaded $NOHTML = 0; # Suppress the html headers - +$endtag=">"; # ----- Running variables ----- use vars qw/ $DIR $PROG $Extension
@@ -2502,6 +2493,13 @@ if ( $BuildReportFormat !~ /html|xhtml|xml/i ) { $BuildReportFormat = 'html'; } + if ($BuildReportFormat eq "html") { # HTML 4.1 + $endtag=">"; + $OptionSelect = "selected"; + } else { # XHTML 1.1 + $endtag=" />"; + $OptionSelect = "selected=\"selected\""; + } if ( $BuildHistoryFormat !~ /text|xml/ ) { $BuildHistoryFormat = 'text'; } if ( $SaveDatabaseFilesWithPermissionsForEveryone !~ /[0-1]/ ) { $SaveDatabaseFilesWithPermissionsForEveryone = 0;
@@ -130,6 +143,7 @@ $DNSLastUpdateCacheFile $MiscTrackerUrl $Lang +$LangHTML $MaxRowsInHTMLOutput $MaxLengthOfShownURL $MaxLengthOfStoredURL @@ -849,16 +940,16 @@ print "<?xml version=\"1.0\" encoding=\"$PageCode\"?>\n"; } else { print "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n"; } - if ( $FrameName ne 'index' ) { +# if ( $FrameName ne 'index' ) { print -"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n"; - } - else { - print -"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Frameset//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd\">\n"; - } +"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n"; +# } +# else { +# print +#"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Frameset//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd\">\n"; +# } print -"<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"$Lang\">\n"; +"<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"$LangHTML\">\n"; } else { if ( $FrameName ne 'index' ) { "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Frameset//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd\">\n"; @@ -869,12 +960,12 @@ print "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Frameset//EN\">\n"; } - print '<html lang="' . $Lang . '"' + print '<html lang="' . $LangHTML . '"' . ( $PageDir ? ' dir="rtl"' : '' ) . ">\n"; } print "<head>\n"; - my $endtag = '>'; + $endtag = '>'; if ( $BuildReportFormat eq 'xhtml' || $BuildReportFormat eq 'xml' ) { $endtag = ' />'; } @@ -9991,6 +10126,9 @@ } $Lang = 'en'; } +foreach (keys %LangBrowserToLangAwstats) { + if ($Lang eq $LangBrowserToLangAwstats{$_}) { $LangHTML = $_; } #convert Lang to LangHTML +} # Check and correct bad parameters &Check_Config();
@@ -16499,48 +16736,48 @@ # TODO # Total row print -"<tr><td bgcolor=\"#$color_TableBGRowTitle\">$Message[102]</td>"; +"<tr><td class=\"colortab\">$Message[102]</td>"; if ( $ShowMonthStats =~ /U/i ) { --- C:\awstats-6.95-mod/wwwroot/css/awstats_bw.css Sat Jul 31 23:36:08 2004 +++ C:\AWStats695t_Jpn/wwwroot/css/awstats_bw.css Sat Sep 05 12:00:54 2009 @@ -1,16 +1,19 @@ body { font: 11px verdana, arial, helvetica, sans-serif; background-color: #FFFFFF; margin-top: 0 } .aws_bodyl { } .aws_border { background-color: #BBBBBB; padding: 1px 1px 1px 1px; margin-top: 0 } -.aws_title { font: 13px verdana, arial, helvetica, sans-serif; font-weight: bold; background-color: #BBBBBB; text-align: center; margin-bottom: 0; padding: 1px 1px 1px 1px; } +.aws_title { font: 13px verdana, arial, helvetica, sans-serif; font-weight: bold; background-color: #CCCCDD; text-align: center; margin: 1em 30% -1em 0; padding: 1px 1px 1px 1px; } .aws_blank { font: 13px verdana, arial, helvetica, sans-serif; background-color: #FFFFFF; text-align: center; margin-bottom: 0; padding: 1px 1px 1px 1px; } .aws_data { background-color: #FFFFFF; border-top-width: 1px; - border-left-width: 0px; - border-right-width: 0px; - border-bottom-width: 0px; + border-left-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-color: #CCCCDD; + border-style:outset; + margin-top:1em; } -.aws_formfield { font: 13px verdana, arial, helvetica; } +.aws_formfield { font: 13px verdana, arial, helvetica, sans-serif; } .aws_button { font-family: arial,verdana,helvetica, sans-serif; font-size: 12px; @@ -24,8 +27,24 @@ td.awsm { border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; padding: 0px 0px 0px 0px; font: 11px verdana, arial, helvetica, sans-serif; color: #000000; } b { font-weight: bold; } a { font: 11px verdana, arial, helvetica, sans-serif; } -a:link { color: #001133; text-decoration: none; } -a:visited { color: #001133; text-decoration: none; } -a:hover { color: #444444; text-decoration: underline; } -div { font: 12px arial,verdana,helvetica; text-align:justify; } -.ctooltip { position:absolute; top:0px; left:0px; z-index:2; width:380; visibility:hidden; font: 8pt MS Comic Sans,arial,sans-serif; background-color: #EEEEEE; padding: 8px; border: 1px solid black; } \ No newline at end of file +a:link { color: #0011BB; text-decoration: none; } +a:visited { color: #0011BB; text-decoration: none; } +a:hover { color: #605040; text-decoration: underline; } +div { font: 12px arial,verdana,helvetica,sans-serif; text-align:justify; } +.ctooltip { position:absolute; top:0px; left:0px; z-index:2; width:380px; visibility:hidden; font: 8pt "MS Comic", Sans,arial,sans-serif; background-color: #EEEEEE; padding: 8px; border: 1px solid black; } +img {border-width: 0em} +.vmiddle {vertical-align:middle;} +table {table-layout:fixed} +.currentday { font-weight: bold; } +.colortab { background-color: #ECECEC} +.colore { background-color: #CEC2E8} +.colorh { background-color: #66DDEE} +.colork { background-color: #2EA495} +.colorp { background-color: #4477DD} +.colors { background-color: #8888DD} +.coloru { background-color: #FFAA66} +.colorv { background-color: #F4F090} +.colorweekend { background-color: #EAEAEA} +.colorx { background-color: #C1B2E2} +.bottom {vertical-align:bottom;} +.nowrap { white-space:nowrap}
@@ -1106,32 +1150,22 @@ if ( $width == 70 && $QueryString =~ /buildpdf/i ) { print -"<table class=\"aws_border\" border=\"0\" cellpadding=\"2\" cellspacing=\"0\" width=\"800\">\n"; +"<table class=\"aws_data\" border=\"1\" cellpadding=\"2\" cellspacing=\"0\" width=\"796\" summary=\"$title1\" id=\"$class\">\n"; } else { print -"<table class=\"aws_border\" border=\"0\" cellpadding=\"2\" cellspacing=\"0\" width=\"100%\">\n"; +"<table class=\"aws_data\" border=\"1\" cellpadding=\"2\" cellspacing=\"0\" width=\"100%\" summary=\"$title1\" id=\"$class\">\n"; } if ($tooltipnb) { - print "<tr><td class=\"aws_title\" width=\"$width%\"".Tooltip($tooltipnb,$tooltipnb).">$title ".$extra_head_html."</td>"; - } - else { - print "<tr><td class=\"aws_title\" width=\"$width%\">$title ".$extra_head_html."</td>"; - } - print "<td class=\"aws_blank\"></td></tr>\n"; - print "<tr><td colspan=\"2\">\n"; - if ( $width == 70 && $QueryString =~ /buildpdf/i ) { - print -"<table class=\"aws_data\" border=\"1\" cellpadding=\"2\" cellspacing=\"0\" width=\"796\">\n"; + print "<caption class=\"aws_title\"".Tooltip($tooltipnb,$tooltipnb).">$title ".$extra_head_html."</caption>\n"; } else { - print -"<table class=\"aws_data\" border=\"1\" cellpadding=\"2\" cellspacing=\"0\" width=\"100%\">\n"; + print "<caption class=\"aws_title\">$title ".$extra_head_html."</caption>\n"; } }
@@ -7625,10 +7679,15 @@ # Return: encodedstring #------------------------------------------------------------------------------ sub XMLEncode { - if ( $BuildReportFormat ne 'xhtml' && $BuildReportFormat ne 'xml' ) { - return shift; - } +# エスケープはHTMLでも必要 +# if ( $BuildReportFormat ne 'xhtml' && $BuildReportFormat ne 'xml' ) { +# return shift; +# } + $string =~ s/</</g; # to avoid < bocome &lt; if after CleanXSS + $string =~ s/>/>/g; # to avoid < bocome &gt; if after CleanXSS + $string =~ s/"/"/g; # to avoid < bocome &quot; if after CleanXSS + $string =~ s/'/'/g; # to avoid < bocome &apos; if after CleanXSS my $string = shift; $string =~ s/&/&/g; $string =~ s/</</g; @@ -7647,8 +7706,16 @@ sub XMLEncodeForHisto { my $string = shift; $string =~ s/\s/%20/g; + $string =~ s/</</g; + $string =~ s/>/>/g; + $string =~ s/"/"/g; + $string =~ s/'/'/g; $string =~ s/&/&/g; $string =~ s/</</g; $string =~ s/>/>/g; if ( $BuildHistoryFormat ne 'xml' ) { return $string; } $string =~ s/=/%3d/g; + $string =~ s/</</g; + $string =~ s/>/>/g; + $string =~ s/"/"/g; + $string =~ s/'/'/g; $string =~ s/&/&/g; $string =~ s/</g; $string =~ s/>/>/g;
@@ -7881,9 +7980,9 @@ ); print "<a href=\"" . XMLEncode("$AWScript?${NewLinkParams}lang=$lng") - . "\"$NewLinkTarget><img src=\"$DirIcons\/flags\/$flag.png\" height=\"14\" border=\"0\"" + . "\"$NewLinkTarget><img src=\"$DirIcons\/flags\/$flag.png\" height=\"14\" width=\"14\"" . AltTitle("$lngtitle") - . "$endtag</a> \n"; + . "$endtag</a>\n"; } } } @@ -13336,22 +13491,35 @@ } else { print -"<tr><td class=\"aws\" valign=\"middle\"><strong>$Message[7]:</strong> </td><td class=\"aws\" valign=\"middle\"><span style=\"font-size: 14px;\">$SiteDomain</span></td>"; +"<tr><td class=\"aws\" valign=\"middle\"><strong>$Message[7]:</strong></td><td class=\"aws\" valign=\"middle\"><span style=\"font-size: 14px;\">$SiteDomain</span></td>"; } # Logo and flags + my $width; + my $height; + if ($Logo eq "awstats_logo1.png") { + $width = 111; + $height = 51; + } elsif ($Logo eq "awstats_logo5.png") { + $width = 230; + $height = 54; + } elsif ($Logo eq "awstats_logo6.png") { + $width = 112; + $height = 54; + } if ( $FrameName ne 'mainleft' ) { if ( $LogoLink =~ "http://awstats.sourceforge.net" ) { print "<td align=\"right\" rowspan=\"3\"><a href=\"" . XMLEncode($LogoLink) - . "\" target=\"awstatshome\"><img src=\"$DirIcons/other/$Logo\" border=\"0\"" + . "\"><img src=\"$DirIcons/other/$Logo\" width=\"$width\" height=\"$height\"" . AltTitle( ucfirst($PROG) . " Web Site" ) . "$endtag</a>"; } else { print "<td align=\"right\" rowspan=\"3\"><a href=\"" . XMLEncode($LogoLink) - . "\" target=\"awstatshome\"><img src=\"$DirIcons/other/$Logo\" border=\"0\"$endtag</a>"; + . "\"><img src=\"$DirIcons/other/$Logo\" width=\"$width\" height=\"$height\"" + . AltTitle(ucfirst($PROG)." Web Site")."$endtag</a>"; } if ( !$StaticLinks ) { print "<br$endtag"; Show_Flag_Links($Lang); } print "</td>";
@@ -14379,7 +14562,14 @@ $cpt = ( scalar keys %_host_h ); } &tab_head( "$title", 19, 0, 'hosts' ); - print "<tr bgcolor=\"#$color_TableBGRowTitle\"><th>"; + print "<col$endtag"; + &ShowHostInfo('__col__'); + if ($ShowHostsStats =~ /P/i) { print "<col width=\"$WIDTHPAGE\"$endtag";} + if ($ShowHostsStats =~ /H/i) { print "<col width=\"$WIDTHHIT\"$endtag";} + if ($ShowHostsStats =~ /B/i) { print "<col width=\"$WIDTHBANDWIDTH\"$endtag";} + if ($ShowHostsStats =~ /L/i) { print "<col width=\"$WIDTHFULLDATE\"$endtag";} + print "\n"; + print "<tr class=\"colortab\"><th abbr=\"$Message[79]\">"; if ( $FilterIn{'host'} || $FilterEx{'host'} ) { # With filter if ( $FilterIn{'host'} ) { print "$Message[79] '<strong>$FilterIn{'host'}</strong>'";
--- C:\awstats-6.95-mod/wwwroot/cgi-bin/awstats.pl Thu Nov 19 16:36:17 2009 +++ C:\AWStats695t_Jpn/wwwroot/cgi-bin/awstats.pl Wed Nov 25 10:40:17 2009 @@ -289,7 +305,7 @@ ) = ( 2, 2, 0, 2, 2, 2, 2, 2, 2 ); use vars qw/ - $DirLock $DirCgi $DirConfig $DirData $DirIcons $DirLang $AWScript $ArchiveFileName + $DirLock $DirCgi $DirConfig $DirData $DirIcons $DirJs $DirCss $DirLang $AWScript $ArchiveFileName $AllowAccessFromWebToFollowingIPAddresses $HTMLHeadSection $HTMLEndSection $LinksToWhoIs $LinksToIPWhoIs $LogFile $LogType $LogFormat $LogSeparator $Logo $LogoLink $StyleSheet $WrapperScript $SiteDomain $UseHTTPSLinkForUrl $URLQuerySeparators $URLWithAnchor $ErrorMessages $ShowFlagLinks @@ -297,7 +313,8 @@ ( $DirLock, $DirCgi, $DirConfig, $DirData, - $DirIcons, $DirLang, + $DirIcons, $DirJs, # JS用ディレクトリ + $DirCss, $DirLang, # CSS用ディレクトリ $AWScript, $ArchiveFileName, $AllowAccessFromWebToFollowingIPAddresses, $HTMLHeadSection, $HTMLEndSection, $LinksToWhoIs, @@ -1908,6 +1945,14 @@ if ( $QueryString !~ /diricons=([^\s&]+)/i ) { $DirIcons = $value; } next; } + if ($param =~ /^DirJs/) { + if ($QueryString !~ /dirjs=([^\s&]+)/i) { $DirJs=$value; } + next; + } + if ($param =~ /^DirCss/) { + if ($QueryString !~ /dircss=([^\s&]+)/i) { $DirCss=$value; } + next; + } if ( $param =~ /^SiteDomain/ ) { # No regex test as SiteDomain is always exact value @@ -2578,6 +2623,9 @@ $DirData ||= '.'; $DirCgi ||= '/cgi-bin'; $DirIcons ||= '/icon'; + $DirJs ||= '/js'; + $DirCss ||= '/css'; + $StyleSheet ||= '/awstatscss/awstats_bw.css'; if ( $DNSLookup !~ /[0-2]/ ) { error( "DNSLookup parameter is wrong in config/domain file. Value is '$DNSLookup' (should be 0,1 or 2)" ); --- C:\awstats-6.95-mod/wwwroot/cgi-bin/plugins/tooltips.pm Wed Nov 25 11:43:49 2009 +++ C:\AWStats695t_Jpn/wwwroot/cgi-bin/plugins/tooltips.pm Thu Jan 29 16:52:32 2009 @@ -104,50 +104,17 @@ $doctop="document.documentElement.scrollTop"; } - print <<EOF; - -<script language="javascript" type="text/javascript"> -function ShowTip(fArg) -{ - var tooltipOBJ = (document.getElementById) ? document.getElementById('tt' + fArg) : eval("document.all['tt" + fArg + "']"); - if (tooltipOBJ != null) { - var tooltipLft = ($docwidth?$docwidth:document.body.style.pixelWidth) - (tooltipOBJ.offsetWidth?tooltipOBJ.offsetWidth:(tooltipOBJ.style.pixelWidth?tooltipOBJ.style.pixelWidth:$TOOLTIPWIDTH)) - 30; - var tooltipTop = 10; - if (navigator.appName == 'Netscape') { - tooltipTop = ($doctop>=0?$doctop+10:event.clientY+10); - tooltipOBJ.style.top = tooltipTop+"px"; - tooltipOBJ.style.left = tooltipLft+"px"; - } - else { - tooltipTop = ($doctop>=0?$doctop+10:event.clientY+10); - tooltipTop = (document.body.scrollTop>=0?document.body.scrollTop+10:event.clientY+10); -EOF # Seul IE en HTML a besoin de code supplementaire. IE en xhtml est OK if ($BuildReportFormat ne 'xhtml' && $BuildReportFormat ne 'xml') { print <<EOF; - if ((event.clientX > tooltipLft) && (event.clientY < (tooltipOBJ.scrollHeight?tooltipOBJ.scrollHeight:tooltipOBJ.style.pixelHeight) + 10)) { - tooltipTop = ($doctop?$doctop:document.body.offsetTop) + event.clientY + 20; - } +<script language="javascript" type="text/javascript" src="$DirJs/tooltiph.js"></script> EOF - } + } else { print <<EOF; - tooltipOBJ.style.left = tooltipLft; - tooltipOBJ.style.top = tooltipTop; - } - tooltipOBJ.style.visibility = "visible"; - } -} -function HideTip(fArg) -{ - var tooltipOBJ = (document.getElementById) ? document.getElementById('tt' + fArg) : eval("document.all['tt" + fArg + "']"); - if (tooltipOBJ != null) { - tooltipOBJ.style.visibility = "hidden"; - } -} -</script> +<script language="javascript" type="text/javascript" src="$DirJs/tooltipx.js"></script> EOF - + } } return 1; # -----> @@ -199,6 +166,7 @@ s/#RobotArray#/$aws_NbOfRobots/; s/#WormsArray#/$aws_NbOfWorms/; s/#SearchEnginesArray#/$aws_NbOfSearchEngines/; + s/#br#/<br$endtag/; print "$_"; } }
@@ -810,7 +901,7 @@ if ( $BuildReportFormat eq 'xhtml' || $BuildReportFormat eq 'xml' ) { print( $ENV{'HTTP_USER_AGENT'} =~ /MSIE|Googlebot/i ? "Content-type:text/html; charset=$newpagecode\n" - : "Content-type: text/xml; charset=$newpagecode\n" ); + : "Content-type: application/xhtml+xml; charset=$newpagecode\n" ); } else { print "Content-type: text/html; charset=$newpagecode\n"; }
@@ -901,10 +992,8 @@ ? "<meta http-equiv=\"content-type\" content=\"text/html; charset=" . ( $PageCode ? $PageCode : "iso-8859-1" ) . "\"$endtag\n" - : "<meta http-equiv=\"content-type\" content=\"text/xml; charset=" - . ( $PageCode ? $PageCode : "iso-8859-1" ) - . "\"$endtag\n" ); + : "" ); } else { print @@ -915,12 +1004,17 @@ } if ($Expires) { + if ( $BuildReportFormat eq 'xhtml' || $BuildReportFormat eq 'xml' ) { + if ( $ENV{'HTTP_USER_AGENT'} =~ /MSIE|Googlebot/i ){ print "<meta http-equiv=\"expires\" content=\"" . ( gmtime( $starttime + $Expires ) ) . "\"$endtag\n"; } + } my @k = keys %HTMLOutput; # This is to have a unique title and description page + if ( $BuildReportFormat eq 'xhtml' || $BuildReportFormat eq 'xml' ) { + if ( $ENV{'HTTP_USER_AGENT'} =~ /MSIE|Googlebot/i ){ print "<meta http-equiv=\"description\" content=\"" . ucfirst($PROG) . " - Advanced Web Statistics for $SiteDomain$periodtitle" @@ -930,87 +1024,29 @@ print "<meta http-equiv=\"keywords\" content=\"$SiteDomain, free, advanced, realtime, web, server, logfile, log, analyzer, analysis, statistics, stats, perl, analyse, performance, hits, visits\"$endtag\n"; } + } + } print "<title>$Message[7] $SiteDomain$periodtitle" . ( $k[0] ? " - " . $k[0] : "" ) . "</title>\n"; if ( $FrameName ne 'index' ) { - if ($StyleSheet) { - print "<link rel=\"stylesheet\" href=\"$StyleSheet\"$endtag\n"; + if ($TOOLTIPON) { + if ( $BuildReportFormat eq 'xhtml' || $BuildReportFormat eq 'xml' ) { + if ( $ENV{'HTTP_USER_AGENT'} =~ /MSIE|Googlebot/i ){ + print "<meta http-equiv=\"Content-Script-Type\" content=\"text/javascript\"$endtag\n"; }
@@ -8374,54 +8479,56 @@ $NewLinkParams =~ s/^&//; $NewLinkParams =~ s/&$//; if ($NewLinkParams) { $NewLinkParams = "${NewLinkParams}&"; } - print "\n<form name=\"FormFilter\" action=\"" + print "\n<form" + . ($BuildReportFormat eq 'html' ? " name=\"FORMFILTER\"" : "") + . " id=\"FORMFILTER\" action=\"" . XMLEncode("$AWScript?${NewLinkParams}") . "\" class=\"aws_border\">\n"; print @@ -13288,7 +13440,7 @@ my $NewLinkTarget = ''; if ( $FrameName eq 'mainright' ) { - $NewLinkTarget = " target=\"_parent\""; + $NewLinkTarget = ""; } - print "<form name=\"FormDateFilter\" action=\"" + print "<form" + . ($BuildReportFormat eq 'html' ? " name=\"FORMDATEFILTER\"" : "") + . " id=\"FORMDATEFILTER\" action=\"" . XMLEncode("$AWScript?${NewLinkParams}") - . "\" style=\"padding: 0px 0px 0px 0px; margin-top: 0\"$NewLinkTarget>\n"; + . "\" style=\"padding: 0px 0px 0px 0px; margin-top: 0\">\n"; }
--- C:\awstats-6.9-mod/wwwroot/css/awstats_bw.css Sun Apr 27 17:47:28 2008 +++ C:\AWStats69t_Jpn/wwwroot/css/awstats_bw.css Thu Jan 22 11:26:22 2009 @@ -10,7 +10,7 @@ border-right-width: 0px; border-bottom-width: 0px; } -.aws_formfield { font: 13px verdana, arial, helvetica; } +.aws_formfield { font: 13px verdana, arial, helvetica, sans-serif; } .aws_button { font-family: arial,verdana,helvetica, sans-serif; font-size: 12px;
@@ -780,8 +847,32 @@ 'Opera versions', 'Safari versions', 'Chrome versions', - 'Konqueror versions' -); + 'Konqueror versions', + '','','', + '','','','','','','','','','', + '','','','','','','','','','', + 'dd mmm yyyy', + 'mmmbreakyyyy', + 'mmm yyyy', + 'ddbreakmmm', + "Unknown robot (identified by 'robot')", + "Unknown robot (identified by 'crawl')", + "Unknown robot (identified by 'spider')", + "Unknown robot (identified by 'bot*')", + "Unknown robot (identified by '*bot')", + "Unknown robot (identified by empty user agent string)", + "Unknown robot (identified by hit on 'robots.txt')", + "Often spam bot", + "Unknown or unspecified distribution", + "unknown version", + "Unknown Unix system", + 'Unknown search engines', + "Unknown robot (identified by 'checker')", + "Unknown robot (identified by 'discovery')", + "Unknown robot (identified by 'hunter')", + "Unknown robot (identified by 'scanner')", + "Unknown robot (identified by 'sucker')" + ); #------------------------------------------------------------------------------ # Functions @@ -7983,8 +8082,13 @@ my $dateformat = $Message[78]; if ( $option == 2 ) { - $dateformat =~ s/^[^ymd]+//g; - $dateformat =~ s/[^ymd]+$//g; + $dateformat = $Message[200]; + } elsif ($option == 3) { # mmm<br>yyyy + $dateformat = $Message[201]; + } elsif ($option == 4) { # mmm yyyy + $dateformat = $Message[202]; + } elsif ($option == 5) { # dd<br>mmm + $dateformat = $Message[203]; } $dateformat =~ s/yyyy/$year/g; $dateformat =~ s/yy/$year/g; @@ -7994,6 +8098,7 @@ $dateformat =~ s/HH/$hour/g; $dateformat =~ s/MM/$min/g; $dateformat =~ s/SS/$sec/g; + $dateformat =~ s/break/<br$endtag/g; return "$dateformat"; } @@ -15989,27 +16217,28 @@ if ( $LogType eq 'W' || $LogType eq 'S' ) { $w = '17'; $colspan = 6; + print "<col width=\"$w%\"$endtag<col width=\"$w%\"$endtag<col width=\"$w%\"$endtag<col width=\"$w%\"$endtag<col width=\"$w%\"$endtag<col width=\"$w%\"$endtag\n"; + } else { + print "<col width=\"$w%\"$endtag<col width=\"$w%\"$endtag<col width=\"$w%\"$endtag<col width=\"$w%\"$endtag<col width=\"$w%\"$endtag\n"; } # Show first/last - print "<tr bgcolor=\"#$color_TableBGRowTitle\">"; + print "<tr class=\"colortab\">"; print "<td class=\"aws\"><strong>$Message[133]</strong></td><td class=\"aws\" colspan=\"" . ( $colspan - 1 ) . "\">\n"; print( $MonthRequired eq 'all' ? "$Message[6] $YearRequired" : "$Message[5] " - . $MonthNumLib{$MonthRequired} - . " $YearRequired" + . Format_Date("$YearRequired$MonthRequired"."00000000",4)); ); print "</td></tr>\n"; - print "<tr bgcolor=\"#$color_TableBGRowTitle\">"; + print "<tr class=\"colortab\">"; print "<td class=\"aws\"><strong>$Message[8]</strong></td>\n"; print "<td class=\"aws\" colspan=\"" . ( $colspan - 1 ) . "\">" . ( $FirstTime ? Format_Date( $FirstTime, 0 ) : "NA" ) . "</td>"; print "</tr>\n"; - print "<tr bgcolor=\"#$color_TableBGRowTitle\">"; + print "<tr class=\"colortab\">"; print "<td class=\"aws\"><strong>$Message[9]</strong></td>\n"; print "<td class=\"aws\" colspan=\"" . ( $colspan - 1 ) . "\">" @@ -16391,13 +16622,13 @@ . ( !$StaticLinks && $monthix == $nowmonth && $YearRequired == $nowyear - ? '<font class="currentday">' + ? '<span class="currentday">' : '' ); - print "$MonthNumLib{$monthix}<br$endtag$YearRequired"; + print Format_Date("$YearRequired$monthix"."00000000",3); print( !$StaticLinks && $monthix == $nowmonth - && $YearRequired == $nowyear ? '</font>' : '' ); + && $YearRequired == $nowyear ? '</span>' : '' ); print "</td>"; # } @@ -16454,13 +16692,13 @@ . ( !$StaticLinks && $monthix == $nowmonth && $YearRequired == $nowyear - ? '<font class="currentday">' + ? '<span class="currentday">' : '' ); - print "$MonthNumLib{$monthix} $YearRequired"; + print Format_Date("$YearRequired$monthix"."00000000",4); print( !$StaticLinks && $monthix == $nowmonth - && $YearRequired == $nowyear ? '</font>' : '' ); + && $YearRequired == $nowyear ? '</span>' : '' ); print "</td>"; if ( $ShowMonthStats =~ /U/i ) { print "<td>", @@ -16842,56 +17080,57 @@ && $day == $nowday && $month == $nowmonth && $year == $nowyear - ? '<font class="currentday">' + ? '<span class="currentday">' : '' ); - print "$day<br$endtag<span style=\"font-size: " - . ( $FrameName ne 'mainright' - && $QueryString !~ /buildpdf/i ? "9" : "8" ) - . "px;\">" - . $MonthNumLib{$month} - . "</span>"; + print Format_Date("$year$month$day"."000000",5); print( !$StaticLinks && $day == $nowday && $month == $nowmonth - && $year == $nowyear ? '</font>' : '' ); + && $year == $nowyear ? '</span>' : '' ); print "</td>\n"; } - print "<td></td>"; +# print "<td></td>"; print "<td valign=\"middle\"" . Tooltip(18) . ">$Message[96]</td>\n"; print "</tr>\n"; print "</table>\n"; } - print "<br$endtag\n"; +# print "<br$endtag\n"; # Show data array for days if ($AddDataArrayShowDaysOfMonthStats) { - print "<table>\n"; + print "<table summary=\"Show data array for days\" style=\"margin-left:auto;margin-right:auto\">\n"; + print "<col width=\"$WIDTHFULLDATE\"$endtag"; + if ($ShowDaysOfMonthStats =~ /V/i) { print "<col width=\"$WIDTHHIT\"$endtag";} + if ($ShowDaysOfMonthStats =~ /P/i) { print "<col width=\"$WIDTHPAGE\"$endtag";} + if ($ShowDaysOfMonthStats =~ /H/i) { print "<col width=\"$WIDTHHIT\"$endtag";} + if ($ShowDaysOfMonthStats =~ /B/i) { print "<col width=\"$WIDTHBANDWIDTH\"$endtag";} + print "\n"; print -"<tr><td width=\"80\" bgcolor=\"#$color_TableBGRowTitle\">$Message[4]</td>"; +"<tr><td class=\"colortab\">$Message[4]</td>"; if ( $ShowDaysOfMonthStats =~ /V/i ) { - print "<td width=\"80\" bgcolor=\"#$color_v\"" + print "<td class=\"colorv\"" . Tooltip(1) . ">$Message[10]</td>"; } if ( $ShowDaysOfMonthStats =~ /P/i ) { - print "<td width=\"80\" bgcolor=\"#$color_p\"" + print "<td class=\"colorp\"" . Tooltip(3) . ">$Message[56]</td>"; } if ( $ShowDaysOfMonthStats =~ /H/i ) { - print "<td width=\"80\" bgcolor=\"#$color_h\"" + print "<td class=\"colorh\"" . Tooltip(4) . ">$Message[57]</td>"; } if ( $ShowDaysOfMonthStats =~ /B/i ) { - print "<td width=\"80\" bgcolor=\"#$color_k\"" + print "<td class=\"colork\"" . Tooltip(5) . ">$Message[75]</td>"; } - print "</tr>"; + print "</tr>\n"; foreach my $daycursor ( $firstdaytoshowtime .. $lastdaytoshowtime ) { --- C:\awstats-6.95-mod/wwwroot/cgi-bin/lang/awstats-en.txt Wed Jun 03 20:05:30 2009 +++ C:\AWStats695t_Jpn/wwwroot/cgi-bin/lang/awstats-en.txt Tue Aug 25 16:00:13 2009 @@ -178,3 +179,48 @@ message174=Safari versions message175=Chrome versions message176=Konqueror versions +message177= +message178= +message179= +message180= +message181= +message182= +message183= +message184= +message185= +message186= +message187= +message188= +message189= +message190= +message191= +message192= +message193= +message194= +message195= +message196= +message197= +message198= +message199= +message200=dd mmm yyyy +message201=mmmbreakyyyy +message202=mmm yyyy +message203=ddbreakmmm +message204=Unknown robot (identified by 'robot') +message205=Unknown robot (identified by 'crawl') +message206=Unknown robot (identified by 'spider') +message207=Unknown robot (identified by 'bot*') +message208=Unknown robot (identified by '*bot') +message209=Unknown robot (identified by empty user agent string) +message210=Unknown robot (identified by hit on 'robots.txt') +message211=Often spam bot +message212=Unknown or unspecified distribution +message213=unknown version +message214=Unknown Unix system +message215=Unknown search engines +message216=Unknown robot (identified by 'checker') +message217=Unknown robot (identified by 'discovery') +message218=Unknown robot (identified by 'hunter') +message219=Unknown robot (identified by 'scanner') +message220=Unknown robot (identified by 'sucker') +message221=Entries shown here gave hits or traffic "not viewed" by visitors, so they are included only in "Not viewed traffic" chart of Summary. --- C:\awstats-6.95-mod/wwwroot/cgi-bin/lang/awstats-jp.txt Mon Jun 07 20:04:36 2004 +++ C:\AWStats695t_Jpn/wwwroot/cgi-bin/lang/awstats-jp.txt Sat Sep 05 12:07:26 2009 @@ -93,79 +95,133 @@ message89=金曜日 message90=土曜日 message91=曜日 -message92=だれ -message93=いつ -message94=認証されたユーザー +message92=訪問者の属性 +message93=訪問日時 +message94=認証されたユーザ message95=最小 message96=平均 message97=最大 -message98=Web圧縮 -message99=帯域幅の保存 +message98=mod_zipによる圧縮 +message99=節約されたバイト数 message100=圧縮前 message101=圧縮後 message102=合計 -message103=キーフレーズ -message104=入り口 +message103=種類の検索文 +message104=最初に閲覧 message105=コード -message106=平均サイズ +message106=平均データ長 message107=ニュースグループからのリンク -message108=Kb -message109=Mb -message110=Gb +message108=kB +message109=MB +message110=GB message111=Grabber message112=Yes message113=No -message114=WhoIs情報 +message114=WhoIsDBの情報 message115=OK -message116=出口 -message117=訪問の長さ -message118=ウィンドーを閉じる +message116=最後に閲覧 +message117=滞在時間 +message118=このウィンドウを閉じる message119=バイト -message120=検索文字列(キーフレーズ) -message121=検索文字列(キーワード) -message122=検索エンジン -message123=ホームページ -message124=他のフレーズ -message125=他のログイン -message126=検索エンジン -message127=ホームページ -message128=サマリー -message129=「年」ビューでは精密な数字はありません +message120=検索文 +message121=検索語 +message122=の検索エンジンから登録されている +message123=このサイトにリンクしているWebページ +message124=上記以外の検索文 +message125=他のユーザ(もしくは匿名ユーザ)のログイン +message126=参照検索エンジン +message127=参照サイト +message128=サマリ +message129=年単位の統計では正確な値は表示されません message130=データ配列関数 message131=送信者のEMail message132=受信者のEMail message133=表示するレポート message134=エキストラ/マーケティング message135=画面解像度 -message136=ワーム/ウィルス攻撃 -message137=お気に入りに追加 -message138=日付 -message139=その他 -message140=Java 対応ブラウザー -message141=Macromedia Director 対応ブラウザー -message142=Flash 対応ブラウザー -message143=Real Audio 対応ブラウザー -message144=Quicktime Audio 対応ブラウザー -message145=Windows Media 対応ブラウザー -message146=PDF 対応ブラウザー +message136=ワーム/ウィルスによる攻撃 +message137=favicon.icoへのヒット(成功のみ) +message138=日別の統計 +message139=その他の情報 +message140=Java 対応ブラウザ +message141=Macromedia Director 対応ブラウザ +message142=Flash 対応ブラウザ +message143=Real Audio 対応ブラウザ +message144=Quicktime Audio 対応ブラウザ +message145=Windows Media 対応ブラウザ +message146=PDF 対応ブラウザ message147=SMTP エラーコード message148=国 message149=メール message150=サイズ message151=最初 message152=最後 -message153=除外フィルター -message154=このチャートのコードは訪問者によるアクセスではありませんので他のチャートに含まれていません。 -message155=クラスター -message156=ロボットによるアクセスは訪問者の閲覧とは違いますので他のチャートに含まれていません。 -message157=+の後の数字は「robots.txt」の表示が成功した回数です。 -message158=ワームによるアクセスは訪問者の閲覧とは違いますので他のチャートに含まれていません。 -message159=閲覧に含まれないアクセスはロボット、ワームなどによるものです。 -message160=閲覧アクセス -message161=閲覧に含まれないアクセス -message162=月 +message153=除外フィルタ +message154=ここにリストされているコードは不可視な訪問者としてカウントされているため、サマリの不可視トラフィック以外のチャートの数値には含まれていません。 +message155=クラスタ +message156=ここにリストされているロボットは不可視な訪問者としてカウントされているため、サマリの不可視トラフィック以外のチャートの数値には含まれていません。 +message157=+の後に表示されている数値は、“robots.txt”ファイルへの参照で検出されたヒット数です。 +message158=ここにリストされているワームは不可視な訪問者としてカウントされているため、サマリの不可視トラフィック以外のチャートの数値には含まれていません。 +message159=不可視トラフィックとは、ワームやロボット、あるいは特殊なHTTPステータスコードを持つ応答などによって生成されたトラフィックのことです。 +message160=可視トラフィック +message161=不可視トラフィック +message162=月別の統計 message163=ワーム -message164=その他のワーム -message165=Mails successfully sent -message166=Mails failed/refused +message164=種類のワーム +message165=送信成功メール +message166=失敗メール message167=Sensitive targets +message168=Javascript disabled +message169=生成 +message170=プラグイン +message171=地域 +message172=都市 +message173=Operaバージョン +message174=Safariバージョン +message175=Chromeバージョン +message176=Konquerorバージョン +message177= +message178= +message179= +message180= +message181= +message182= +message183= +message184= +message185= +message186= +message187= +message188= +message189= +message190= +message191= +message192= +message193= +message194= +message195= +message196= +message197= +message198= +message199= +message200=yyyy年 mmm dd日 +message201=yyyy年breakmmm +message202=yyyy年 mmm +message203=mmmbreakdd日 +message204=未分類のrobot (名前に'robot'を含む) +message205=未分類のrobot (名前に'crawl'を含む) +message206=未分類のrobot (名前に'spider'を含む) +message207=未分類のrobot (名前に'bot*'を含む) +message208=未分類のrobot (名前に'*bot'を含む) +message209=未分類のrobot (user agent文字列がない) +message210=未分類のrobot ('robots.txt'への参照で検出) +message211=SPAM botによく使われる +message212=特定できないディストリビューション +message213=バージョン不明 +message214=特定できないUnixシステム +message215=未知のサーチエンジン +message216=未分類のrobot (名前に'checker'を含む) +message217=未分類のrobot (名前に'discovery'を含む) +message218=未分類のrobot (名前に'hunter'を含む) +message219=未分類のrobot (名前に'scanner'を含む) +message220=未分類のrobot (名前に'sucker'を含む) +message221=ここにリストされているヒットは不可視な訪問者としてカウントされているため、サマリの不可視トラフィック以外のチャートの数値には含まれていません。
perl Makefile.PL make make test make install
C:\>ppm install http://theoryx5.uwinnipeg.ca/ppms/Geo-IP.ppd
@@ -10382,7 +10402,7 @@ my $regmisc=qr/^$miscquoted/; my $regfavico=qr/\/favicon\.ico$/i; my $regrobot=qr/^\/robots\.txt$/i; - my $regtruncanchor=qr/#(\w*)$/; + my $regtruncanchor=qr/#([A-Za-z0-9\-_:\.]*)$/; my $regtruncurl=qr/([$URLQuerySeparators])(.*)$/; my $regext=qr/\.(\w{1,6})$/; my $regdefault;
+ my $regtruncanchor=qr/#([A-Za-z][A-Za-z0-9\-_:\.]*)$/;
--- C:\awstats-6.95-mod/wwwroot/cgi-bin/awstats.pl Thu Nov 19 16:36:17 2009 +++ C:\AWStats695t_Jpn/wwwroot/cgi-bin/awstats.pl Wed Nov 25 10:40:17 2009 @@ -12389,6 +12533,7 @@ $SearchEnginesKnownUrl{ $tmprefererserver} ) { # Search engine with known URL syntax + my $keyphrasep = ""; foreach my $param ( split( /&/, @@ -12416,12 +12562,16 @@ $param =~ tr/ /\+/s; if ( ( length $param ) > 0 ) { - $_keyphrases{$param}++; + if ( $keyphrasep eq "") { + $keyphrasep = "$param"; + } else { + $keyphrasep = $keyphrasep . "+" . "$param"; } - last; } } + if ((length $keyphrasep) > 0) { $_keyphrases{$keyphrasep}++; } + } elsif ( $LevelForKeywordsDetection >= 2 ) { # Search engine with unknown URL syntax
--- C:\awstats-6.9-mod/wwwroot/cgi-bin/awstats.pl Fri Jan 23 11:16:31 2009 +++ C:\AWStats69t_Jpn/wwwroot/cgi-bin/awstats.pl Sat Feb 07 22:02:36 2009 @@ -12477,10 +12628,11 @@ # debug("xxx".$refurl[0]); # If search engine with key inside page url like a9 (www.a9.com/searchkey1%20searchkey2) if ( $refurl[0] =~ -/$SearchEnginesKnownUrl{$tmprefererserver}(.*)$/ +/$SearchEnginesKnownUrl{$tmprefererserver}(.*)$SearchEnginesKnownUrlTrail{$tmprefererserver}$/ ) { my $param = $1; + $param = &DecodeEncodedString($param); &ChangeWordSeparatorsIntoSpace( $param); $param =~ tr/ /\+/s; --- C:\awstats-6.95-mod/wwwroot/cgi-bin/lib/search_engines.pm Wed Nov 25 11:49:45 2009 +++ C:\AWStats695t_Jpn/wwwroot/cgi-bin/lib/search_engines.pm Wed Oct 14 16:13:18 2009 @@ -856,6 +1082,18 @@ 'pogodak', 'q=' ); +# SearchEnginesKnownUrlTrail +# Known rules to extract keywords from a referrer search engine URL +#------------------------------------------------------------------------------ +%SearchEnginesKnownUrlTrail=( +# Japanese Search Engines +# Added by Hobbit_makoto 2007.01.17 +'fresheyedir','\/', +'idolphoto','\/index[0-9]+\.html', +'olane','\/c\/\d', +'yahoogle','\.html', +); + # SearchEnginesKnownUrlNotFound # Known rules to extract not found keywords from a referrer search engine URL #------------------------------------------------------------------------------