X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=points.pl;h=213fad9d84069e0e3f41d9dd26b229b37fe17e9a;hb=dfdaf29be0eb73b0b900ce3bced443120b1fca96;hp=464ad18f79efe85872e0a941dc0f430a74a86491;hpb=9e7bc0a25ae14affe960a0606d0542677c51abd7;p=ndwebbie.git diff --git a/points.pl b/points.pl index 464ad18..213fad9 100644 --- a/points.pl +++ b/points.pl @@ -18,6 +18,7 @@ #**************************************************************************/ use strict; +use warnings FATAL => 'all'; $ND::TEMPLATE->param(TITLE => 'Top Members'); @@ -28,7 +29,7 @@ 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'); @@ -45,9 +46,9 @@ $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, ODD => $i % 2}; - $i++; } $BODY->param(Members => \@members);