]> ruin.nu Git - ndwebbie.git/blobdiff - top100.pl
oops, guess I had forgotten about this file
[ndwebbie.git] / top100.pl
index 27219e0e570e995057c7b6ec795433c59f3db7c0..1a7d2e4233ba7a9f3372a7e9754297abb7b20817 100644 (file)
--- a/top100.pl
+++ b/top100.pl
@@ -18,6 +18,8 @@
 #**************************************************************************/
 
 use strict;
+use warnings FATAL => 'all';
+no warnings qw(uninitialized);
 
 $ND::TEMPLATE->param(TITLE => 'Top100 ');
 
@@ -52,9 +54,10 @@ if (isHC()){
 }
 my $query = $DBH->prepare(qq{SELECT id,coords(x,y,z), ruler, planet,race,
        size, score, value, xp, sizerank, scorerank, valuerank, xprank
-       $extra_columns FROM current_planet_stats ORDER BY $order LIMIT 100 OFFSET $offset});
-$query->execute;
+       $extra_columns FROM current_planet_stats ORDER BY $order LIMIT 100 OFFSET ?});
+$query->execute($offset);
 my @planets;
+my $i = 0;
 while (my ($id,$coords,$ruler,$planet,$race,$size,$score,$value,$xp,$sizerank,$scorerank,$valuerank,$xprank
                ,$planet_status,$hit_us,$alliance,$relationship,$nick) = $query->fetchrow){
        my %planet = (Coords => $coords, Planet => "$ruler OF $planet", Race => $race, Size => "$size ($sizerank)"
@@ -67,6 +70,8 @@ while (my ($id,$coords,$ruler,$planet,$race,$size,$score,$value,$xp,$sizerank,$s
                $planet{Relationship} = $relationship;
                $planet{isHC} = 1;
        }
+       $i++;
+       $planet{ODD} = $i % 2;
        push @planets,\%planet;
 }
 $BODY->param(Planets => \@planets);