Dit is dezelfde aanpassing als nummer 2. Alleen is hier de functie voluit gegeven.
Bij deze versie zijn enkele colums verwijderd en klopt de hyperlink weer.
Dit is een versie waarbij de byemail als basis is genomen (zie ppstats aanpassing 2 voor uitleg).
Bij deze versie zijn enkele colums verwijderd en klopt de hyperlink weer.
Dit is een versie waarbij de byemail als basis is genomen (zie ppstats aanpassing 2 voor uitleg).
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
| #-----------------------------------------------------------------------------
#
# Write stats ordered by nodes done this day.
#
#-----------------------------------------------------------------------------
sub write_daytop
{
&debugln("Entering write_daytop() ...");
my $count = 0;
my $pagecount = 1;
my $msg;
my $displacement;
my $y;
my $lastseen;
my $lastseentime;
my $lastseencolor;
open(OUTFILE, ">". $userprefs{"htmldir"} . $page . $userprefs{"htmldaytop"}) or die "Personal Proxy Statistics : Cannot open ". $userprefs{"htmldir"} . $page . $htmlfile . "($!)\n";
&write_header();
print OUTFILE " <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=\"100%\">\n";
print OUTFILE " <TR ALIGN=CENTER>\n <TD CLASS=section WIDTH=\"10%\">Rank</TD>\n <TD CLASS=section NOWRAP>E-Mail Address</TD>\n";
print OUTFILE " <TD CLASS=section WIDTH=\"20%\">Nodes Today</TD>\n <TD CLASS=section WIDTH=\"20%\">Last Seen</TD>\n </TR>\n";
for ($y = $userprefs{"dayshist"}; $y >= 0; $y--) {
$pageblocks[$y] = 0;
}
foreach $email (sort { $emails{$b}[1] <=> $emails{$a}[1] || $a cmp $b } keys %emails) {
if ($emails{$email}[1] != 0 ) {
$count += 1;
# Start a new file if maximum number of rows has been reached.
if ($count > $userprefs{"maxrows"} * $pagecount) {
&write_section_footer($pagecount, $numemail, 0, $userprefs{"htmldaytop"}, "Please click on the \"@\"symbol for detailed participant information.");
for ($y = $userprefs{"dayshist"}; $y >= 0; $y--) {
$pageblocks[$y] = 0;
}
$pagecount += 1;
open(OUTFILE, ">". $userprefs{"htmldir"} . $page . $userprefs{"htmldaytop"}) or die "Personal Proxy Statistics : Cannot open". $userprefs{"htmldir"} . $page . $htmlfile . "($!)\n";
&write_header();
print OUTFILE " <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=\"100%\">\n";
print OUTFILE " <TR ALIGN=CENTER><TD CLASS=section WIDTH=\"10%\">Rank</TD><TD CLASS=section NOWRAP>E-Mail Address</TD>\n";
print OUTFILE " <TD CLASS=section WIDTH=\"20%\">Nodes Today</TD><TD CLASS=section WIDTH=\"20%\">Last Seen</TD></TR>\n";
}
for ($y = $userprefs{"dayshist"} - 3; $y > 0; $y--) {
$emails{$email}[$y] = defined($emails{$email}[$y]) ? $emails{$email}[$y] : 0;
}
for ($y = $userprefs{"dayshist"} - 3; $y > 0; $y--) {
$pageblocks[$y] += defined($emails{$email}[$y]) ? $emails{$email}[$y] : 0;
}
$pageblocks[0] += defined($emails{$email}[0]) ? $emails{$email}[0] : 0;
if ($count % 2 == 0) {
print OUTFILE " <TR CLASS=even ALIGN=RIGHT>\n";
} else {
print OUTFILE " <TR CLASS=odd ALIGN=RIGHT>\n";
}
print OUTFILE " <TD NOWRAP ALIGN=LEFT> $count</TD>\n";
$domain = undef;
if ($email =~ /\.(\w+)$/) { $domain = $1; }
if (defined($domain) && defined($country{$domain})) {
$label = $country{$domain};
if (-e $userprefs{"htmldir"} . $userprefs{"icondir"} . "flags/$domain.gif") {
$icon = "$domain.gif";
} else {
$icon = "unknown.gif";
}
} else {
$label = "Unknown";
$icon = "unknown.gif";
}
$y = 0;
$correct = 0;
foreach $tmpemail (sort { $emails{$b}[0] <=> $emails{$a}[0] || $a cmp $b } keys %emails) {
$y++;
if ($emails{$tmpemail}[0] == $emails{$email}[0]) {
$correct = $y;
}
}
$emaildir = "e". $correct;
if (defined($name_list{$email})) {
$head = $name_list{$email};
$text = $head;
} else {
($head, $tail) = split(/@/, $email);
$text = $head . "\@" . $tail;
}
print OUTFILE " <TD NOWRAP ALIGN=LEFT>[img]\"".[/img] <A HREF=\"". $userprefs{"htmlroot"} . "$emaildir/". $userprefs {"htmlindvemail"} . "\">$text</A></TD>\n";
print OUTFILE " <TD>" . &ratef($emails{$email}[1]) . "</TD>\n";
# Print out the Last Seen column.
($year, $mon, $mday, $hour, $min, $sec, $wday) = &nice_gmtime($time_begin);
$lastseentime = $emails_ls{$email}[0]*24*60*60 + ($hour - $emails_ls{$email}[1])*60*60 + ($min - $emails_ls{$email}[2])*60 + $sec - $emails_ls{$email}[3];
$lastseen = &ls($lastseentime);
$lastseencolor = &ls_color($lastseentime);
print OUTFILE " <TD CLASS=$lastseencolor NOWRAP>$lastseen</TD></TR>\n";
}
}
print OUTFILE " <TR ALIGN=RIGHT><TD CLASS=section> </TD><TD CLASS=section>Nodes Total</TD><TD CLASS=section>". &ratef($blocks[1]) . "</TD><TD CLASS=section> </TD></TR>\n";
print OUTFILE " <TR><TD COLSPAN=4> </TD></TR>\n";
print OUTFILE " <TR ALIGN=CENTER><TD CLASS=note COLSPAN=4>Please click on the \"@\"symbol for detailed participant information.</TD></TR></TABLE>\n";
&write_footer();
close OUTFILE;
&debugln("Exiting write_daytop() ...");
} # write_daytop |