]> ruin.nu Git - ndwebbie.git/blobdiff - NDWeb/Pages/Resources.pm
Converted rankings
[ndwebbie.git] / NDWeb / Pages / Resources.pm
index 17790a1c7cabefeea6c6885c53d5705a9ea05029..f06620d41ea0501a0191bdd61e8809ee36834e15 100644 (file)
 #   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
 #**************************************************************************/
 
-package ND::Web::Pages::Resources;
+package NDWeb::Pages::Resources;
 use strict;
 use warnings FATAL => 'all';
 use CGI qw/:standard/;
-use ND::Web::Include;
+use NDWeb::Include;
 
-use base qw/ND::Web::XMLPage/;
+use base qw/NDWeb::XMLPage/;
 
-$ND::Web::Page::PAGES{resources} = __PACKAGE__;
+$NDWeb::Page::PAGES{resources} = __PACKAGE__;
 
 sub render_body {
        my $self = shift;
@@ -49,17 +49,14 @@ sub render_body {
                (s.size::int8*(1464-tick())*250)/100 + score + (resources/planets*LEAST(members,60))/300 AS nscore3,
                (s.size::int8*(1464-tick())*250)/100 AS scoregain3
                FROM (SELECT alliance_id AS id,sum(metal+crystal+eonium) AS resources, count(*) AS planets 
-               FROM planets p join covop_targets c ON p.id = c.planet GROUP by alliance_id) r 
+               FROM planets p join planet_scans c ON p.id = c.planet GROUP by alliance_id) r 
                NATURAL JOIN alliances a 
                LEFT OUTER JOIN (SELECT * FROM alliance_stats WHERE tick = (SELECT max(tick) FROM alliance_stats)) s ON a.id = s.id
                ORDER BY $order
                });
        $query->execute;
        my @alliances;
-       my $i = 0;
        while (my $alliance = $query->fetchrow_hashref){
-               $i++;
-               $alliance->{ODD} = $i % 2;
                push @alliances,$alliance;
        }
        $BODY->param(Alliances => \@alliances);