X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=points.pl;h=e1a18863d1ed65ff4527f05254c1142083209a67;hb=03830799201db0b0f28e9c494fdd1b5b5143749c;hp=18f38c34f9a177873517e5442d6ea5b8776d9d1c;hpb=80f02fee77b80abf19a48c5fee4f4cd09150d991;p=ndwebbie.git diff --git a/points.pl b/points.pl index 18f38c3..e1a1886 100644 --- a/points.pl +++ b/points.pl @@ -18,17 +18,17 @@ #**************************************************************************/ use strict; +use warnings FATAL => 'all'; -$ND::TEMPLATE->param(TITLE => 'Edit MOTD'); +$ND::TEMPLATE->param(TITLE => 'Top Members'); our $BODY; our $DBH; -our $LOG; die "You don't have access" unless isMember(); my $type = "total"; -if (param('type') =~ /^(defense|attack|total|humor|scan|rank)$/){ +if (defined param('type') && param('type') =~ /^(defense|attack|total|humor|scan|rank)$/){ $type = $1; } $type .= '_points' unless ($type eq 'rank'); @@ -43,9 +43,11 @@ my $query = $DBH->prepare("SELECT username,defense_points,attack_points,scan_poi $query->execute; my @members; +my $i = 0; while (my ($username,$defense,$attack,$scan,$humor,$total,$rank) = $query->fetchrow){ + $i++; push @members,{Username => $username, Defense => $defense, Attack => $attack - , Scan => $scan, Humor => $humor, Total => $total, Rank => $rank}; + , Scan => $scan, Humor => $humor, Total => $total, Rank => $rank, ODD => $i % 2}; } $BODY->param(Members => \@members);