Willkommen bei WordPress. Dies ist dein erster Beitrag. Bearbeite oder lösche ihn und beginne mit dem Schreiben!
Hallo Welt!
von raredesign | Dez 3, 2019 | Allgemein | 0 Kommentare
Cokiee Shell
Current Path : /usr/local/siteapps/topdownloads-2.0-14/apps/work/ |
Current File : //usr/local/siteapps/topdownloads-2.0-14/apps/work/stat_js.dist.pl |
#!/usr/bin/perl ######################################################################### # Top Downloads v2.0 (Javascript) # # Copyright (c)2001 Chi Kien Uong # # URL: http://www.proxy2.de # # # # This Software is distributed under the GNU General Public # # License. For more details see license.txt # # # # # To include the table into a HTML document use: # # <script language="JavaScript" # # src="http://www.domain.com/stat_js.pl?top=xx"></script> # # # # To include a count number into a HTML document use: # # <script language="JavaScript" # # src="http://www.domain.com/stat_js.pl?stat=file_id"></script> # # # # Total downloads: # # <script language="JavaScript" # # src="http://www.domain.com/stat_js.pl?total=1"></script> # # # ######################################################################### # base url to the *.gif files without trailing "/" $base_gif = "@@PROTO@@@@DOMAIN_NAME@@/gif"; # path to the log file - relative to script location or absolute $basedat = "@@ROOT_DIR@@/log.txt"; $table_width = 560; # width of hole table $table_text = 250; # width reserve for the file description $table_bg = "#F7F7F7"; # table background color $table_top = "#E1A8A8"; # top table background color $show_default = 15; # 10=TOP_10 20=TOP_20, etc. $font_size = "face=Arial size=1"; # font style and size # End Setup ##################### @querys = split(/&/, $ENV{'QUERY_STRING'}); foreach $query_str (@querys) { ($name, $value) = split(/=/, $query_str); $query{$name} = $value; } print "Content-type: text/html\n\n"; if ($query{'stat'} || $query{'total'}) { open(DATA,"$basedat"); @lines = <DATA>; close(DATA); shift(@lines); if ($query{'stat'}) { foreach $line (@lines) { ($file_id,$count,$location,$stamp,$descript) = split(/\|/,$line); if ($query{'stat'} eq $file_id) { print ("document.write('$count')"); last; } } } else { foreach $line (@lines) { ($file_id,$count,$location,$stamp,$descript) = split(/\|/,$line); $total += $count; } print ("document.write('$total');\n"); } } else { $query{'top'} = $show_default if ($query{'top'} !~ /^\d+/); unless (open(DATA,"$basedat")) { if (-e "$basedat") { die ("document.write('File exists, but cannot be opened.');\n"); } else { open(DATA,">$basedat"); } } @sort_array = <DATA>; chop (@sort_array); close(DATA); $last_download = shift(@sort_array); print "document.write('<table align=\"center\" bgcolor=\"$table_bg\" border=0 cellpadding=2 cellspacing=1 width=$table_width>');\n"; print "document.write('<tr><td colspan=2 bgcolor=\"$table_top\"><b><font $font_size color=\"#990000\">Top $query{'top'} Downloads</font></b></td></tr>');\n"; $total=0; foreach $input (@sort_array) { ($filenum, $countnum, $location, $stamp, $description) = split(/\|/,$input); $name_array{$filenum}=$countnum; $descript_array{$filenum}=$description; $total += $countnum; } if ($total>0) { $show=0; $flag=0; foreach $file_id (sort {$name_array{$b} <=> $name_array{$a}} (keys(%name_array))) { if ($show < $query{'top'}) { $top_pos = $name_array{$file_id} if ($flag == 0); $percent = ($name_array{$file_id} *100/ $total); if ($percent <= 1) {$img = 'blue.gif';} elsif ($percent > 1 && $percent <= 2) {$img = 'green.gif';} elsif ($percent > 2 && $percent <= 5) {$img = 'aqua.gif';} elsif ($percent > 5 && $percent <= 8) {$img = 'pink.gif';} elsif ($percent > 8 && $percent <= 11) {$img = 'yellow.gif';} elsif ($percent > 11 && $percent <= 14) {$img = 'purple.gif';} elsif ($percent > 14 && $percent <= 17) {$img = 'brown.gif';} elsif ($percent > 17 && $percent <= 20) {$img = 'darkgreen.gif';} elsif ($percent > 20 && $percent <= 23) {$img = 'red.gif';} elsif ($percent > 23) {$img = 'gold.gif';} $img_width = int($name_array{$file_id} *($table_width-$table_text)/$top_pos); if ($descript_array{$file_id} ne "---") { print "document.write('<tr><td><font $font_size>$descript_array{$file_id}</font></td><td><font $font_size><img src=\"$base_gif/$img\" width=$img_width height=10> $name_array{$file_id}</font></td></tr>');\n"; } else { print "document.write('<tr><td><font $font_size>$file_id</font></td><td><font $font_size><img src=\"$base_gif/$img\" width=$img_width height=10> $name_array{$file_id}</font></td></tr>');\n"; } $show++; $flag=1; } else { last; } } } print "document.write('<tr><td><font $font_size>Statistic</font></td><td><font $font_size>Last Download: </font><font $font_size color=\"#660066\">$last_download</font> <font $font_size>');\n"; print "document.write('Total Downloads: </font><font $font_size color=\"#FF0000\">$total</font></td></tr></table>');\n"; } exit(0);
Cokiee Shell Web 1.0, Coded By Razor
Neueste Kommentare