X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=top100.pl;h=20b0bd1f8c8b582282f30444b997a53742320732;hb=5af89dd22a075c6652b779ef471bf21cb9965cb6;hp=9611a17acfd4d6c6e30628b7b0cb041b6dd75c09;hpb=a7cec3a4152ab42e16d6b530f25f960909c72eca;p=ndwebbie.git diff --git a/top100.pl b/top100.pl index 9611a17..20b0bd1 100644 --- 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,7 +68,9 @@ while (my ($id,$coords,$ruler,$planet,$race,$size,$score,$value,$xp,$sizerank,$s $planet{Relationship} = $relationship; $planet{isHC} = 1; } + $planet{ODD} = $i % 2; push @planets,\%planet; + $i++; } $BODY->param(Planets => \@planets);