]> ruin.nu Git - ndwebbie.git/blobdiff - top100.pl
cache templates in memory
[ndwebbie.git] / top100.pl
index 9611a17acfd4d6c6e30628b7b0cb041b6dd75c09..455312c810e70f92b2e375ebc05a34a42095b7c0 100644 (file)
--- a/top100.pl
+++ b/top100.pl
@@ -55,6 +55,7 @@ my $query = $DBH->prepare(qq{SELECT id,coords(x,y,z), ruler, planet,race,
        $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 +68,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);