X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=resources.pl;h=12955667b3f172e21fdfb80038c161806cd04a42;hb=d2b25d79058863d3604489e7a36d1c0d1a491b5c;hp=5e63b7a5d3d6583c405101a982b668f39cf5ff97;hpb=6eacbf94cc13b8b6df3018df1159065fc9a5140e;p=ndwebbie.git diff --git a/resources.pl b/resources.pl index 5e63b7a..1295566 100644 --- a/resources.pl +++ b/resources.pl @@ -18,7 +18,7 @@ #**************************************************************************/ use strict; -use POSIX; +use warnings FATAL => 'all'; our $BODY; our $DBH; our $LOG; @@ -29,7 +29,7 @@ $ND::TEMPLATE->param(TITLE => 'Alliance Resources'); die "You don't have access" unless isHC(); my $order = "respplanet DESC"; -if (param('order') =~ /^(score|resources|respplanet|nscore|nscore2|nscore3)$/){ +if (defined param('order') && param('order') =~ /^(size|score|resources|respplanet|nscore|nscore2|nscore3)$/){ $order = "$1 DESC"; } @@ -50,9 +50,9 @@ $query->execute; my @alliances; my $i = 0; while (my $alliance = $query->fetchrow_hashref){ + $i++; $alliance->{ODD} = $i % 2; push @alliances,$alliance; - $i++ } $BODY->param(Alliances => \@alliances);