📄 adminshowstats.pl
字号:
################################################################################ AdminShowStats.pl ################################################################################# UltraBoard Ver. 1.61 by UltraScripts.com ## Scripts written by Jacky W.W. Yung, WebMaster@UltraScripts.com ## Available from http://www.UltraScripts.com/UltraBoard/ ## --------------------------------------------------------------------------- ## PROGRAM NAME : UltraBoard ## VERSION : 1.61 ## LAST MODIFIED : 30/06/1999 ## =========================================================================== ## COPYRIGHT NOTICE : ## ## Copyright (c) 1999 Jacky Yung. All Rights Reserved. ## ## This program is free software; you can change or modify it as you see fit. ## However, modified versions cannot be sold or distributed. You cannot alter ## the copyright and "powered by" notices throughout the scripts. These ## notices must be clearly visible to the end users. ## ## WARRANTY DISCLAIMER: ## ## THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT WITHOUT ## ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR ## FITNESS FOR A PARTICULAR PURPOSE. ################################################################################################################################################################ ShowStats ################################################################################sub ShowStats { #use POSIX qw(&ceil); $HTML.=&Table($TableWidth,$TableAlign,"","6","",""). &Tr("","",""). &Td("","","","","","","nowrap","",""). &Form("UBAdmin.$Ext","POST","",""). &HiddenBox("Session",$SessionID). "</td>". "</tr>". &Tr("","",""). &Td("","","","","RIGHT","","","",""). &GetMenuList. "</td>". "</tr>". &Tr("","",""). &Td("","","","","","","nowrap","",""). "</form>". &Form("UBAdmin.$Ext","POST","","","name=\"form\""). &HiddenBox("Action","DoCreateBoard"). &HiddenBox("Count",(scalar(@GROUPS_DATA)-1)). &HiddenBox("Session",$SessionID). "</td>". "</tr>". "</table>"; if ($in{'Type'} eq "LastVisitors") { $ColSpan=3; open(LOG,"$StatsPath/Visitors.log"); flock(LOG,2) if ($FLock); @Visitors=<LOG>; close(LOG); $HTML.= &BTable($TableWidth,$TableAlign,"0","0",$TableCellSpacing,$TableCellPadding,$TableBorderColor,"",""). &Tr("","",$HeaderBGColor). &Td("","","3","","","","","",""). &Font($FontFace,$HeaderTextSize,$HeaderTextColor). "<b>LAST $MaxVisitorLog VISITORS</b>". "</font>". "</td>". "</tr>"; $RowColor=$RowOddBGColor; for ($n=$#Visitors;$n>=0;$n--) { @LogInfo=split(/\|\^\|/,$Visitors[$n]); $LogInfo[4]=~s/\_/ /g; if (!$LogInfo[2]) { $Host=$LogInfo[1]; }else{ $Host=$LogInfo[2]; } $HTML.= &Tr("","",$RowColor). &Td("35%","","","","","","",$ColumnOddBGColor,""). &Font($FontFace,$TextSize,$TextColor). $LogInfo[0]. "</font>". "</td>". &Td("40%","","","","","","",$ColumnEvenBGColor,""). &Font($FontFace,$TextSize,$TextColor). $Host. "</font>". "</td>". &Td("25%","","","","","","",$ColumnOddBGColor,""). &Font($FontFace,$TextSize,$TextColor). $LogInfo[4]. "</font>". "</td>". "</tr>"; if ($RowColor eq $RowEvenBGColor) { $RowColor=$RowOddBGColor; }else{ $RowColor=$RowEvenBGColor; } } $HTML.= &Tr("","",$MenuBGColor). &Td("","",$ColSpan,"","RIGHT","","","",""). &PrintVersion(). "</td>". "</tr>". "</table></td></tr></table>". "<p>"; }elsif ($in{'Type'} eq "LastReferURL") { $ColSpan=3; open(LOG,"$StatsPath/Visitors.log"); flock(LOG,2) if ($FLock); @Visitors=<LOG>; close(LOG); $HTML.= &BTable($TableWidth,$TableAlign,"0","0",$TableCellSpacing,$TableCellPadding,$TableBorderColor,"",""). &Tr("","",$HeaderBGColor). &Td("","","2","","","","","",""). &Font($FontFace,$HeaderTextSize,$HeaderTextColor). "<b>LAST $MaxVisitorLog REFERERS URL</b>". "</font>". "</td>". "</tr>"; $RowColor=$RowOddBGColor; for ($n=$#Visitors;$n>=0;$n--) { @LogInfo=split(/\|\^\|/,$Visitors[$n]); $LengthURL=length($LogInfo[3]); $ReferURL=$LogInfo[3]; if ($LengthURL >= 80) { $ReferURL=substr ($LogInfo[3],0,37)."...".substr ($LogInfo[3],$LengthURL-37,37); } $HTML.= &Tr("","",$RowColor). &Td("35%","","","","","","",$ColumnOddBGColor,""). &Font($FontFace,$TextSize,$TextColor). $LogInfo[0]. "</font>". "</td>". &Td("65%","","","","","","",$ColumnEvenBGColor,""). &Font($FontFace,$TextSize,$TextColor). &Link($LogInfo[3],"_blank","$LogInfo[3]"). $ReferURL. "</a>". "</font>". "</td>". "</tr>"; if ($RowColor eq $RowEvenBGColor) { $RowColor=$RowOddBGColor; }else{ $RowColor=$RowEvenBGColor; } } $HTML.= &Tr("","",$MenuBGColor). &Td("","",$ColSpan,"","RIGHT","","","",""). &PrintVersion(). "</td>". "</tr>". "</table></td></tr></table>". "<p>"; }elsif ($in{'Type'} eq "TopReferURL") { $ColSpan=3; open(REFERER,"$StatsPath/Referers.log"); flock(REFERER,2) if ($FLock); my (@RefURLs)=<REFERER>; close(REFERER); $TotalHits=0; for ($n=0;$n<=$#RefURLs;$n++) { ($RefURL,$Value)=split(/\|\^\|/,$RefURLs[$n]); $Sort{$n}=$Value; $ReferURL[$n]=$RefURL; $ReferValue[$n]=$Value; $TotalHits+=$Value; } @SortedList = reverse sort{$Sort{$a} <=> $Sort{$b}} keys %Sort; $HTML.= &BTable($TableWidth,$TableAlign,"0","0",$TableCellSpacing,$TableCellPadding,$TableBorderColor,"",""). &Tr("","",$HeaderBGColor). &Td("","","3","","","","","",""). &Font($FontFace,$HeaderTextSize,$HeaderTextColor). "<b>TOP REFERERS URL</b>". "</font>". "</td>". "</tr>"; $RowColor=$RowOddBGColor; for ($n=0;$n<scalar(@SortedList);$n++) { $TotalPercent=&ceil(($ReferValue[$n]/$TotalHits)*10000)/100; $LengthURL=length($ReferURL[$n]); $ReferURL=$ReferURL[$n]; if ($LengthURL >= 70) { $ReferURL=substr ($ReferURL[$n],0,35)."...".substr ($ReferURL[$n],$LengthURL-35,35); } $HTML.= &Tr("","",$RowColor). &Td("10%","","","","CENTER","","",$ColumnOddBGColor,""). &Font($FontFace,$TextSize,$TextColor). $ReferValue[$n]. "</font>". "</td>". &Td("10%","","","","CENTER","","",$ColumnEvenBGColor,""). &Font($FontFace,$TextSize,$TextColor). $TotalPercent."%". "</font>". "</td>". &Td("80%","","","","","","",$ColumnOddBGColor,""). &Font($FontFace,$TextSize,$TextColor). &Link($ReferURL[$n],"_blank",$ReferURL[$n]). $ReferURL. "</a>". "</font>". "</td>". "</tr>"; if ($RowColor eq $RowEvenBGColor) { $RowColor=$RowOddBGColor; }else{ $RowColor=$RowEvenBGColor; } } $HTML.= &Tr("","",$MenuBGColor). &Td("","",$ColSpan,"","RIGHT","","","",""). &PrintVersion(). "</td>". "</tr>". "</table></td></tr></table>". "<p>"; }elsif ($in{'Type'} eq "Days") { $ColSpan=4; open(HITS,"$StatsPath/Days.hits"); flock(HITS,2) if ($FLock); my (@Hits)=<HITS>; close(HITS); open(CDATE,"$StatsPath/CDate.dat"); flock(CDATE,2) if ($FLock); my ($CurrentDate)=<CDATE>; close(CDATE); open(HITS,"$StatsPath/Today.hits"); flock(HITS,2) if ($FLock); my ($TodayHits)=<HITS>; close(HITS); $Max=0; $TotalHits=0; @Day=(); @DayHit=(); if ($CurrentDate) { push (@Day, $CurrentDate); push (@DayHit, $TodayHits); $Max=$TodayHits if ($Max<$TodayHits); $TotalHits+=$TodayHits; } for ($n=$#Hits;$n>=0;$n--) { @DayInfo=split(/\|\^\|/,$Hits[$n]); push (@Day, $DayInfo[0]); push (@DayHit, $DayInfo[1]); $Max=$DayInfo[1] if ($Max<$DayInfo[1]); $TotalHits+=$DayInfo[1]; } $HTML.= &BTable($TableWidth,$TableAlign,"0","0",$TableCellSpacing,$TableCellPadding,$TableBorderColor,"",""). &Tr("","",$HeaderBGColor). &Td("","","4","","","","","",""). &Font($FontFace,$HeaderTextSize,$HeaderTextColor). "<b>DAYS HITS</b>". "</font>". "</td>". "</tr>"; $RowColor=$RowOddBGColor; for ($n=0;$n<scalar(@Day);$n++) { $Percentage=&ceil(($DayHit[$n]/$Max)*100); $TotalPercent=&ceil(($DayHit[$n]/$TotalHits)*10000)/100; $HTML.= &Tr("","",$RowColor). &Td("20%","","","","","","",$ColumnOddBGColor,""). &Font($FontFace,$TextSize,$TextColor). $Day[$n]. "</font>". "</td>". &Td("10%","","","","CENTER","","",$ColumnEvenBGColor,""). &Font($FontFace,$TextSize,$TextColor). $DayHit[$n]. "</font>". "</td>". &Td("10%","","","","CENTER","","",$ColumnOddBGColor,""). &Font($FontFace,$TextSize,$TextColor). $TotalPercent."%". "</font>". "</td>". &Td("60%","","","","","","",$ColumnEvenBGColor,""). &Font($FontFace,$TextSize,$TextColor). &Image("$URLImages/Bar.gif","$Percentage%","16","","","0","$DayHit[$n] ($TotalPercent%)"). "</font>". "</td>". "</tr>"; if ($RowColor eq $RowEvenBGColor) { $RowColor=$RowOddBGColor; }else{ $RowColor=$RowEvenBGColor; } } $HTML.= &Tr("","",$MenuBGColor). &Td("","",$ColSpan,"","RIGHT","","","",""). &PrintVersion(). "</td>". "</tr>". "</table></td></tr></table>". "<p>"; }elsif ($in{'Type'} eq "ActionLog") { $ColSpan=9; open(LOG,"$StatsPath/Action.log"); flock(LOG,2) if ($FLock); my (@Actions)=<LOG>; close(LOG); $HTML.= &BTable($TableWidth,$TableAlign,"0","0",$TableCellSpacing,$TableCellPadding,$TableBorderColor,"",""). &Tr("","",$HeaderBGColor). &Td("","","9","","","","","",""). &Font($FontFace,$HeaderTextSize,$HeaderTextColor). "<b>LAST $MaxActionLog ACTIONS</b>". "</font>". "</td>". "</tr>". &Tr("","",$HeaderBGColor). &Td("","","","","","","","",""). &Font($FontFace,$HeaderTextSize,$HeaderTextColor). "<b>Date</b>". "</font>". "</td>". &Td("","","","","","","","",""). &Font($FontFace,$HeaderTextSize,$HeaderTextColor). "<b>HOST</b>". "</font>". "</td>". &Td("","","","","","","","",""). &Font($FontFace,$HeaderTextSize,$HeaderTextColor). "<b>IP</b>". "</font>". "</td>". &Td("","","","","","","","",""). &Font($FontFace,$HeaderTextSize,$HeaderTextColor). "<b>ACTION</b>". "</font>". "</td>". &Td("","","","","","","","",""). &Font($FontFace,$HeaderTextSize,$HeaderTextColor). "<b>CATEGORY</b>". "</font>". "</td>". &Td("","","","","","","","",""). &Font($FontFace,$HeaderTextSize,$HeaderTextColor). "<b>BOARD</b>". "</font>". "</td>". &Td("","","","","","","","",""). &Font($FontFace,$HeaderTextSize,$HeaderTextColor). "<b>POST ID</b>". "</font>". "</td>". &Td("","","","","","","","",""). &Font($FontFace,$HeaderTextSize,$HeaderTextColor). "<b>ID</b>". "</font>". "</td>". &Td("","","","","","","","",""). &Font($FontFace,$HeaderTextSize,$HeaderTextColor). "<b>USERNAME</b>". "</font>". "</td>". "</tr>"; $RowColor=$RowOddBGColor; for ($n=$#Actions;$n>=0;$n--) { @LogInfo=split(/\|\^\|/,$Actions[$n]); $HTML.= &Tr("","",$RowColor). &Td("","","","","","","",$ColumnOddBGColor,""). &Font($FontFace,"1",$TextColor). $LogInfo[0]. "</font>". "</td>". &Td("","","","","","","",$ColumnEvenBGColor,""). &Font($FontFace,"1",$TextColor). $LogInfo[2]. "</font>". "</td>". &Td("","","","","","","",$ColumnOddBGColor,""). &Font($FontFace,"1",$TextColor). $LogInfo[1]. "</font>". "</td>". &Td("","","","","","","",$ColumnEvenBGColor,""). &Font($FontFace,"1",$TextColor). $LogInfo[4]. "</font>". "</td>". &Td("","","","","","","",$ColumnOddBGColor,""). &Font($FontFace,"1",$TextColor). $LogInfo[5]. "</font>". "</td>". &Td("","","","","","","",$ColumnEvenBGColor,""). &Font($FontFace,"1",$TextColor). $LogInfo[6]. "</font>". "</td>". &Td("","","","","","","",$ColumnOddBGColor,""). &Font($FontFace,"1",$TextColor). $LogInfo[7]. "</font>". "</td>". &Td("","","","","","","",$ColumnEvenBGColor,""). &Font($FontFace,"1",$TextColor). $LogInfo[8]. "</font>". "</td>". &Td("","","","","","","",$ColumnOddBGColor,""). &Font($FontFace,"1",$TextColor). $LogInfo[9]. "</font>". "</td>". "</tr>"; if ($RowColor eq $RowEvenBGColor) { $RowColor=$RowOddBGColor; }else{ $RowColor=$RowEvenBGColor; } } $HTML.= &Tr("","",$MenuBGColor). &Td("","",$ColSpan,"","RIGHT","","","",""). &PrintVersion(). "</td>". "</tr>". "</table></td></tr></table>". "<p>"; }elsif ($in{'Type'} eq "AdminLog") { $ColSpan=6; open(LOG,"$StatsPath/Admin.log"); flock(LOG,2) if ($FLock); my (@Actions)=<LOG>; close(LOG); $HTML.= &BTable($TableWidth,$TableAlign,"0","0",$TableCellSpacing,$TableCellPadding,$TableBorderColor,"",""). &Tr("","",$HeaderBGColor). &Td("","","8","","","","","",""). &Font($FontFace,$HeaderTextSize,$HeaderTextColor). "<b>LAST $MaxActionLog ADMINISTRATOR ACTIONS</b>". "</font>". "</td>". "</tr>". &Tr("","",$HeaderBGColor).
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -