From b3d60946973fc4d48b32c2447522f0bba02087d3 Mon Sep 17 00:00:00 2001 From: Michael Andreen Date: Wed, 9 Jan 2008 20:47:49 +0100 Subject: [PATCH] Use list_context variables instead of homebrewed ODD --- NDWeb/Pages/AllianceRankings.pm | 3 --- NDWeb/Pages/Alliances.pm | 9 --------- NDWeb/Pages/Calls.pm | 17 ----------------- NDWeb/Pages/Check.pm | 18 ------------------ NDWeb/Pages/CovOp.pm | 4 +--- NDWeb/Pages/DefLeeches.pm | 2 -- NDWeb/Pages/EditRaid.pm | 2 -- NDWeb/Pages/Forum.pm | 13 ++----------- NDWeb/Pages/GalaxyRankings.pm | 3 --- NDWeb/Pages/HostileAlliances.pm | 3 --- NDWeb/Pages/Intel.pm | 9 --------- NDWeb/Pages/Main.pm | 7 ------- NDWeb/Pages/MemberIntel.pm | 13 ------------- NDWeb/Pages/PlanetNaps.pm | 3 --- NDWeb/Pages/PlanetRankings.pm | 3 --- NDWeb/Pages/Points.pm | 4 +--- NDWeb/Pages/Raids.pm | 2 -- NDWeb/Pages/Resources.pm | 3 --- NDWeb/Pages/TargetList.pm | 3 --- NDWeb/Pages/Users.pm | 3 --- NDWeb/XMLPage.pm | 2 +- templates/alliancerankings.tmpl | 2 +- templates/alliances.tmpl | 6 +++--- templates/calls.tmpl | 16 ++++++++-------- templates/check.tmpl | 16 ++++++++-------- templates/covop.tmpl | 2 +- templates/defLeeches.tmpl | 2 +- templates/editRaid.tmpl | 2 +- templates/forum.tmpl | 6 +++--- templates/galaxyrankings.tmpl | 2 +- templates/hostileAlliances.tmpl | 2 +- templates/intel.tmpl | 2 +- templates/main.tmpl | 8 ++++---- templates/memberIntel.tmpl | 6 +++--- templates/planetNaps.tmpl | 2 +- templates/planetrankings.tmpl | 2 +- templates/points.tmpl | 2 +- templates/raids.tmpl | 2 +- templates/resources.tmpl | 2 +- templates/targetList.tmpl | 2 +- templates/users.tmpl | 4 ++-- 41 files changed, 49 insertions(+), 165 deletions(-) diff --git a/NDWeb/Pages/AllianceRankings.pm b/NDWeb/Pages/AllianceRankings.pm index c29d540..29bb2df 100644 --- a/NDWeb/Pages/AllianceRankings.pm +++ b/NDWeb/Pages/AllianceRankings.pm @@ -81,7 +81,6 @@ sub render_body { ORDER BY $order LIMIT 100 OFFSET ?}); $query->execute($offset) or $error .= p($DBH->errstr); my @alliances; - my $i = 0; while (my $alliance = $query->fetchrow_hashref){ for my $type (qw/members size score avgsize avgscore/){ #$alliance->{$type} = prettyValue($alliance->{$type}); @@ -98,8 +97,6 @@ sub render_body { $alliance->{$type} =~ s/(^[-+]?\d+?(?=(?>(?:\d{3})+)(?!\d))|\G\d{3}(?=\d))/$1,/g; #Add comma for ever 3 digits, i.e. 1000 => 1,000 } } - $i++; - $alliance->{ODD} = $i % 2; push @alliances,$alliance; } $BODY->param(Alliances => \@alliances); diff --git a/NDWeb/Pages/Alliances.pm b/NDWeb/Pages/Alliances.pm index d60f7a7..75635ef 100644 --- a/NDWeb/Pages/Alliances.pm +++ b/NDWeb/Pages/Alliances.pm @@ -95,10 +95,7 @@ sub render_body { ORDER BY $order}); my @members; $members->execute($alliance->{id}); - my $i = 0; while (my $member = $members->fetchrow_hashref){ - $i++; - $member->{ODD} = $i % 2; push @members,$member; } $BODY->param(Members => \@members); @@ -111,15 +108,12 @@ sub render_body { $query->execute($alliance->{id}) or $error .= $DBH->errstr; my @intel; - $i = 0; while (my $intel = $query->fetchrow_hashref){ if ($intel->{ingal}){ $intel->{missionclass} = 'ingal'; }else{ $intel->{missionclass} = $intel->{mission}; } - $i++; - $intel->{ODD} = $i % 2; push @intel,$intel; } $BODY->param(Intel => \@intel); @@ -142,11 +136,8 @@ sub render_body { })or $error .= $DBH->errstr; $query->execute or $error .= $DBH->errstr; my @alliances; - my $i = 0; while (my $alliance = $query->fetchrow_hashref){ next unless (defined $alliance->{score} || $alliance->{kscore} > 0); - $i++; - $alliance->{ODD} = $i % 2; push @alliances, $alliance; } $BODY->param(Alliances => \@alliances); diff --git a/NDWeb/Pages/Calls.pm b/NDWeb/Pages/Calls.pm index 27e88de..8303b4f 100644 --- a/NDWeb/Pages/Calls.pm +++ b/NDWeb/Pages/Calls.pm @@ -159,10 +159,7 @@ sub render_body { } $ships->execute($fleet->{id}); my @ships; - my $i = 0; while (my $ship = $ships->fetchrow_hashref){ - $i++; - $ship->{ODD} = $i % 2; push @ships,$ship; } $fleet->{Ships} = \@ships; @@ -188,10 +185,7 @@ sub render_body { $fleet->{CLASS} = $fleet->{mission}; $ships->execute($fleet->{id}); my @ships; - my $i = 0; while (my $ship = $ships->fetchrow_hashref){ - $i++; - $ship->{ODD} = $i % 2; push @ships,$ship; } $fleet->{Ships} = \@ships; @@ -209,23 +203,16 @@ sub render_body { }); $attackers->execute($call->{id}); my @attackers; - my $i = 0; while(my $attacker = $attackers->fetchrow_hashref){ - $i++; - $attacker->{ODD} = $i % 2; $outgoings->execute($attacker->{planet},$call->{landing_tick}); my @missions; - my $k = 0; while (my $mission = $outgoings->fetchrow_hashref){ $mission->{eta} = '?' if not defined $mission->{eta}; $mission->{amount} = '?' if not defined $mission->{amount}; - $mission->{ODD} = $k++ % 2; $mission->{CLASS} = $mission->{mission}; my @ships; $ships->execute($mission->{id}); - my $j = 0; while (my $ship = $ships->fetchrow_hashref){ - $ship->{ODD} = $j++ % 2; push @ships,$ship; } push @ships, {ship => 'No', amount => 'ships'} if @ships == 0; @@ -275,7 +262,6 @@ sub render_body { })or warn $DBH->errstr; $query->execute or warn $DBH->errstr; my @calls; - my $i = 0; my $tick = $self->{TICK}; while (my $call = $query->fetchrow_hashref){ if ($call->{defense_points} < $minpoints){ @@ -288,12 +274,9 @@ sub render_body { while ($tick - 24 > $call->{landing_tick}){ $tick -= 24; push @calls,{}; - $i = 0; } $call->{attackers} =~ s{(\d+:\d+:\d+)}{$1}g; $call->{dcstyle} = 'Hostile' unless defined $call->{dc}; - $i++; - $call->{ODD} = $i % 2; $call->{shiptype} = $call->{shiptype}; push @calls, $call; } diff --git a/NDWeb/Pages/Check.pm b/NDWeb/Pages/Check.pm index eb0aa84..cac7f92 100644 --- a/NDWeb/Pages/Check.pm +++ b/NDWeb/Pages/Check.pm @@ -107,7 +107,6 @@ sub render_body { } my @planets; my $planet_id = undef; - my $i = 0; while (my $planet = $query->fetchrow_hashref){ $planet_id = $planet->{id}; for my $type (qw/size score value xp/){ @@ -126,8 +125,6 @@ sub render_body { log_message $ND::UID,"BC browsing ND planet $planet->{coords} tick $self->{TICK}"; } } - $i++; - $planet->{ODD} = $i % 2; delete $planet->{id}; push @planets,$planet; } @@ -152,15 +149,11 @@ sub render_body { $query->execute($planet_id); my $ships = $DBH->prepare(q{SELECT ship,amount FROM fleet_ships WHERE id = ?}); my @missions; - $i = 0; while (my $mission = $query->fetchrow_hashref){ - $mission->{ODD} = $i++ % 2; $mission->{CLASS} = $mission->{mission}; my @ships; $ships->execute($mission->{id}); - my $j = 0; while (my $ship = $ships->fetchrow_hashref){ - $ship->{ODD} = $j++ % 2; push @ships,$ship; } push @ships, {ship => 'No', amount => 'ships'} if @ships == 0; @@ -184,15 +177,11 @@ sub render_body { }); $query->execute($planet_id); my @incomings; - $i = 0; while (my $mission = $query->fetchrow_hashref){ - $mission->{ODD} = $i++ % 2; $mission->{CLASS} = $mission->{mission}; my @ships; $ships->execute($mission->{id}); - my $j = 0; while (my $ship = $ships->fetchrow_hashref){ - $ship->{ODD} = $j++ % 2; push @ships,$ship; } push @ships, {ship => 'No', amount => 'ships'} if @ships == 0; @@ -218,9 +207,7 @@ sub render_body { }); $query->execute($planet_id); my @scans; - $i = 0; while (my $scan = $query->fetchrow_hashref){ - $scan->{ODD} = $i++ % 2; push @scans,$scan; } $BODY->param(Scans => \@scans); @@ -244,9 +231,7 @@ sub render_body { }); $query->execute($planet_id); my @pdata; - $i = 0; while (my $data = $query->fetchrow_hashref){ - $data->{ODD} = ++$i % 2; $data->{amount} =~ s/(^[-+]?\d+?(?=(?>(?:\d{3})+)(?!\d))|\G\d{3}(?=\d))/$1,/g; #Add comma for ever 3 digits, i.e. 1000 => 1,000 push @pdata,$data; } @@ -270,7 +255,6 @@ sub render_body { $query->execute($x,$y) or $ND::ERROR .= p($DBH->errstr); my @galaxies; - $i = 0; while (my $galaxy = $query->fetchrow_hashref){ for my $type (qw/planets size score xp value/){ #$galaxy->{$type} = prettyValue($galaxy->{$type}); @@ -287,8 +271,6 @@ sub render_body { $galaxy->{$type} =~ s/(^[-+]?\d+?(?=(?>(?:\d{3})+)(?!\d))|\G\d{3}(?=\d))/$1,/g; #Add comma for ever 3 digits, i.e. 1000 => 1,000 } } - $i++; - $galaxy->{ODD} = $i % 2; push @galaxies,$galaxy; } $BODY->param(Galaxies => \@galaxies); diff --git a/NDWeb/Pages/CovOp.pm b/NDWeb/Pages/CovOp.pm index e777499..162e646 100644 --- a/NDWeb/Pages/CovOp.pm +++ b/NDWeb/Pages/CovOp.pm @@ -79,12 +79,10 @@ sub render_body { $query->execute($self->{PLANET}); my @targets; - my $i = 0; while (my ($id,$coords,$metal,$crystal,$eonium,$seccents,$dists,$max) = $query->fetchrow){ - $i++; push @targets,{Target => $id, Coords => $coords , Metal => $metal, Crystal => $crystal, Eonium => $eonium, SecCents => $seccents - , Dists => $dists, MaxResHack => $max, List => $list, ODD => $i % 2}; + , Dists => $dists, MaxResHack => $max, List => $list}; } $BODY->param(Targets => \@targets); return $BODY; diff --git a/NDWeb/Pages/DefLeeches.pm b/NDWeb/Pages/DefLeeches.pm index ec3010b..b10e403 100644 --- a/NDWeb/Pages/DefLeeches.pm +++ b/NDWeb/Pages/DefLeeches.pm @@ -47,9 +47,7 @@ sub render_body { $query->execute; my @members; - my $i = 0; while ( my $member = $query->fetchrow_hashref){ - $member->{ODD} = $i++ % 2; push @members,$member; } $BODY->param(Members => \@members); diff --git a/NDWeb/Pages/EditRaid.pm b/NDWeb/Pages/EditRaid.pm index 61a5814..5638b4f 100644 --- a/NDWeb/Pages/EditRaid.pm +++ b/NDWeb/Pages/EditRaid.pm @@ -230,9 +230,7 @@ sub render_body { delete $target->{planet}; my @scans; - my $i = 0; while (my $scan = $scans->fetchrow_hashref){ - $scan->{ODD} = $i++ % 2; push @scans,$scan; } $target->{Scans} = \@scans; diff --git a/NDWeb/Pages/Forum.pm b/NDWeb/Pages/Forum.pm index ac28bb0..76ac472 100644 --- a/NDWeb/Pages/Forum.pm +++ b/NDWeb/Pages/Forum.pm @@ -168,16 +168,13 @@ sub render_body { while (my $board = $boards->fetchrow_hashref){ next if $board->{id} < 0; $threads->execute($board->{id},$ND::UID,1) or $ND::ERROR .= p($DBH->errstr); - my $i = 0; my @threads; while (my $thread = $threads->fetchrow_hashref){ - $i++; - $thread->{Odd} = $i % 2; push @threads,$thread; } $board->{Threads} = \@threads; delete $board->{post}; - push @boards,$board if $i > 0; + push @boards,$board if $threads->rows > 0; } $category->{Boards} = \@boards; delete $category->{id}; @@ -196,11 +193,8 @@ sub render_body { my ($time) = $DBH->selectrow_array('SELECT now()::timestamp',undef); $BODY->param(Date => $time); $threads->execute($board->{id},$ND::UID,0) or $ND::ERROR .= p($DBH->errstr); - my $i = 0; my @threads; while (my $thread = $threads->fetchrow_hashref){ - $i++; - $thread->{Odd} = $i % 2; push @threads,$thread; } $BODY->param(Threads => \@threads); @@ -241,15 +235,12 @@ sub render_body { while (my $category = $categories->fetchrow_hashref){ $boards->execute($category->{id},$ND::UID) or $ND::ERROR .= p($DBH->errstr); my @boards; - my $i = 0; while (my $board = $boards->fetchrow_hashref){ - $i++; - $board->{Odd} = $i % 2; push @boards,$board; } $category->{Boards} = \@boards; delete $category->{id}; - push @categories,$category if $i > 0; + push @categories,$category if $boards->rows > 0; } $BODY->param(Categories => \@categories); diff --git a/NDWeb/Pages/GalaxyRankings.pm b/NDWeb/Pages/GalaxyRankings.pm index 4be9471..318f4f4 100644 --- a/NDWeb/Pages/GalaxyRankings.pm +++ b/NDWeb/Pages/GalaxyRankings.pm @@ -80,7 +80,6 @@ sub render_body { ORDER BY $order LIMIT 100 OFFSET ?}); $query->execute($offset) or $error .= p($DBH->errstr); my @galaxies; - my $i = 0; while (my $galaxy = $query->fetchrow_hashref){ for my $type (qw/planets size score xp value/){ #$galaxy->{$type} = prettyValue($galaxy->{$type}); @@ -97,8 +96,6 @@ sub render_body { $galaxy->{$type} =~ s/(^[-+]?\d+?(?=(?>(?:\d{3})+)(?!\d))|\G\d{3}(?=\d))/$1,/g; #Add comma for ever 3 digits, i.e. 1000 => 1,000 } } - $i++; - $galaxy->{ODD} = $i % 2; push @galaxies,$galaxy; } $BODY->param(Galaxies => \@galaxies); diff --git a/NDWeb/Pages/HostileAlliances.pm b/NDWeb/Pages/HostileAlliances.pm index 39ee1db..703e8b7 100644 --- a/NDWeb/Pages/HostileAlliances.pm +++ b/NDWeb/Pages/HostileAlliances.pm @@ -55,11 +55,8 @@ ORDER BY hostilecount DESC })or $ND::ERROR .= $DBH->errstr; $query->execute($begintick,$endtick) or $ND::ERROR .= $DBH->errstr; my @alliances; - my $i = 0; my $tick = $self->{TICK}; while (my $alliance = $query->fetchrow_hashref){ - $i++; - $alliance->{ODD} = $i % 2; push @alliances, $alliance; } $BODY->param(Alliances => \@alliances); diff --git a/NDWeb/Pages/Intel.pm b/NDWeb/Pages/Intel.pm index 3dc69b2..bd9777a 100644 --- a/NDWeb/Pages/Intel.pm +++ b/NDWeb/Pages/Intel.pm @@ -171,15 +171,12 @@ sub render_body { $query->execute($planet->{id}) or $error .= $DBH->errstr; my @intellists; my @incomings; - my $i = 0; while (my $intel = $query->fetchrow_hashref){ if ($intel->{ingal}){ $intel->{missionclass} = 'ingal'; }else{ $intel->{missionclass} = $intel->{mission}; } - $i++; - $intel->{ODD} = $i % 2; push @incomings,$intel; } push @intellists,{Message => 'Incoming fleets', Intel => \@incomings, Origin => 1}; @@ -187,15 +184,12 @@ sub render_body { $query = $DBH->prepare(intelquery('t.alliance AS talliance,coords(t.x,t.y,t.z) AS target',"o.id = ? $showticks")); $query->execute($planet->{id}) or $error .= $DBH->errstr; my @outgoings; - $i = 0; while (my $intel = $query->fetchrow_hashref){ if ($intel->{ingal}){ $intel->{missionclass} = 'ingal'; }else{ $intel->{missionclass} = $intel->{mission}; } - $i++; - $intel->{ODD} = $i % 2; push @outgoings,$intel; } push @intellists,{Message => 'Outgoing Fleets', Intel => \@outgoings, Target => 1}; @@ -212,15 +206,12 @@ sub render_body { my @intellists; my @intel; - my $i = 0; while (my $intel = $query->fetchrow_hashref){ if ($intel->{ingal}){ $intel->{missionclass} = 'ingal'; }else{ $intel->{missionclass} = $intel->{mission}; } - $i++; - $intel->{ODD} = $i % 2; push @intel,$intel; } push @intellists,{Message => q{Intel where alliances doesn't match}, Intel => \@intel, Origin => 1, Target => 1}; diff --git a/NDWeb/Pages/Main.pm b/NDWeb/Pages/Main.pm index 62d91f3..db3a11c 100644 --- a/NDWeb/Pages/Main.pm +++ b/NDWeb/Pages/Main.pm @@ -162,7 +162,6 @@ sub render_body { })or warn $DBH->errstr; $calls->execute($ND::UID) or warn $DBH->errstr; - my $i = 0; my @calls; while (my $call = $calls->fetchrow_hashref){ $call->{attackers} =~ s{(\d+:\d+:\d+)}{$1}g; @@ -175,8 +174,6 @@ sub render_body { }else{ $call->{covered} = 'Hostile'; } - $i++; - $call->{ODD} = $i % 2; $call->{shiptype} = $call->{shiptype}; push @calls, $call; } @@ -227,14 +224,10 @@ ORDER BY x,y,z,mission,tick $query->execute($self->{UID},$self->{PLANET},$self->{TICK}) or warn $DBH->errstr; my @fleets; - $i = 0; while (my $fleet = $query->fetchrow_hashref){ - $fleet->{ODD} = $i++ % 2; my @ships; $ships->execute($fleet->{id}); - my $j = 0; while (my $ship = $ships->fetchrow_hashref){ - $ship->{ODD} = $j++ % 2; push @ships,$ship; } $fleet->{ships} = \@ships; diff --git a/NDWeb/Pages/MemberIntel.pm b/NDWeb/Pages/MemberIntel.pm index 36eb09a..ab73864 100644 --- a/NDWeb/Pages/MemberIntel.pm +++ b/NDWeb/Pages/MemberIntel.pm @@ -73,8 +73,6 @@ sub render_body { $query->execute($user->{uid}) or $error .= $DBH->errstr; my @nd_attacks; my @other_attacks; - my $ndi = 0; - my $oi = 0; while (my $intel = $query->fetchrow_hashref){ my $attack = {target => $intel->{coords}, tick => $intel->{tick}}; if ($intel->{ndtarget}){ @@ -83,10 +81,8 @@ sub render_body { }else{ $attack->{Other} = 'Launched at a tick that was not claimed'; } - $attack->{ODD} = ++$ndi % 2; push @nd_attacks, $attack; }else{ - $attack->{ODD} = ++$oi % 2; push @other_attacks, $attack; } } @@ -107,19 +103,13 @@ sub render_body { my @nd_def; my @ingal_def; my @other_def; - $ndi = 0; - $oi = 0; - my $gi = 0; while (my $intel = $query->fetchrow_hashref){ my $def = {target => $intel->{coords}.(defined $intel->{alliance} ? " ($intel->{alliance})" : ''), tick => $intel->{tick}}; if (defined $intel->{alliance_id} && $intel->{alliance_id} == 1){ - $def->{ODD} = ++$ndi % 2; push @nd_def, $def; }elsif($intel->{ingal}){ - $def->{ODD} = ++$gi % 2; push @ingal_def, $def; }else{ - $def->{ODD} = ++$oi % 2; push @other_def, $def; } } @@ -154,10 +144,7 @@ sub render_body { ORDER BY $order DESC}); $query->execute() or $error .= $DBH->errstr; my @members; - my $i = 0; while (my $intel = $query->fetchrow_hashref){ - $i++; - $intel->{ODD} = $i % 2; $intel->{OLD} = 'OLD' if (!defined $intel->{tick} || $self->{TICK} > $intel->{tick} + 60); delete $intel->{tick}; push @members,$intel; diff --git a/NDWeb/Pages/PlanetNaps.pm b/NDWeb/Pages/PlanetNaps.pm index 32a5c48..adcd5b7 100644 --- a/NDWeb/Pages/PlanetNaps.pm +++ b/NDWeb/Pages/PlanetNaps.pm @@ -50,10 +50,7 @@ sub render_body { $query->execute or $error .= p($DBH->errstr); my @planets; - my $i = 0; while (my $planet = $query->fetchrow_hashref){ - $i++; - $planet->{ODD} = $i % 2; push @planets,$planet; } $BODY->param(Planets => \@planets); diff --git a/NDWeb/Pages/PlanetRankings.pm b/NDWeb/Pages/PlanetRankings.pm index 3d9f509..e744626 100644 --- a/NDWeb/Pages/PlanetRankings.pm +++ b/NDWeb/Pages/PlanetRankings.pm @@ -78,7 +78,6 @@ sub render_body { $extra_columns FROM current_planet_stats_full ORDER BY $order LIMIT 100 OFFSET ?}); $query->execute($offset) or $error .= p($DBH->errstr); my @planets; - my $i = 0; while (my $planet = $query->fetchrow_hashref){ for my $type (qw/size score value xp/){ #$planet->{$type} = prettyValue($planet->{$type}); @@ -92,8 +91,6 @@ sub render_body { $planet->{$type} =~ s/(^[-+]?\d+?(?=(?>(?:\d{3})+)(?!\d))|\G\d{3}(?=\d))/$1,/g; #Add comma for ever 3 digits, i.e. 1000 => 1,000 } } - $i++; - $planet->{ODD} = $i % 2; push @planets,$planet; } $BODY->param(Planets => \@planets); diff --git a/NDWeb/Pages/Points.pm b/NDWeb/Pages/Points.pm index 11482ab..250900b 100644 --- a/NDWeb/Pages/Points.pm +++ b/NDWeb/Pages/Points.pm @@ -57,11 +57,9 @@ sub render_body { $query->execute; my @members; - my $i = 0; while (my ($username,$defense,$attack,$scan,$humor,$total,$rank,$raid) = $query->fetchrow){ - $i++; push @members,{Username => $username, Defense => $defense, Attack => $attack, Raid => $raid - , Scan => $scan, Humor => $humor, Total => $total, Rank => $rank, ODD => $i % 2}; + , Scan => $scan, Humor => $humor, Total => $total, Rank => $rank}; } $BODY->param(Members => \@members); return $BODY; diff --git a/NDWeb/Pages/Raids.pm b/NDWeb/Pages/Raids.pm index 3fb4145..0b342fa 100644 --- a/NDWeb/Pages/Raids.pm +++ b/NDWeb/Pages/Raids.pm @@ -250,9 +250,7 @@ sub render_body { while (my $mission = $unitscans->fetchrow_hashref){ my @ships; $ships->execute($mission->{id}); - my $j = 0; while (my $ship = $ships->fetchrow_hashref){ - $ship->{ODD} = $j++ % 2; push @ships,$ship; } push @ships, {ship => 'No', amount => 'ships'} if @ships == 0; diff --git a/NDWeb/Pages/Resources.pm b/NDWeb/Pages/Resources.pm index 9267ecd..f06620d 100644 --- a/NDWeb/Pages/Resources.pm +++ b/NDWeb/Pages/Resources.pm @@ -56,10 +56,7 @@ sub render_body { }); $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); diff --git a/NDWeb/Pages/TargetList.pm b/NDWeb/Pages/TargetList.pm index 64fed86..f321a92 100644 --- a/NDWeb/Pages/TargetList.pm +++ b/NDWeb/Pages/TargetList.pm @@ -66,10 +66,7 @@ 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); diff --git a/NDWeb/Pages/Users.pm b/NDWeb/Pages/Users.pm index e0d48e6..232c423 100644 --- a/NDWeb/Pages/Users.pm +++ b/NDWeb/Pages/Users.pm @@ -131,10 +131,7 @@ sub render_body { ORDER BY lower(username)})or $error .= $DBH->errstr; $query->execute or $error .= $DBH->errstr; my @users; - my $i = 0; while (my $user = $query->fetchrow_hashref){ - $i++; - $user->{ODD} = $i % 2; push @users, $user; } $BODY->param(Users => \@users); diff --git a/NDWeb/XMLPage.pm b/NDWeb/XMLPage.pm index 76c6374..ece5bdd 100644 --- a/NDWeb/XMLPage.pm +++ b/NDWeb/XMLPage.pm @@ -91,7 +91,7 @@ sub render : method { $body = HTML::Template->new(filename => "templates/$self->{PAGE}.xml.tmpl", cache => 1); }else{ $body = HTML::Template->new(filename => "templates/$self->{PAGE}.tmpl", global_vars => 1 - , cache => 1, default_escape => 'HTML'); + , cache => 1, loop_context_vars => 1, default_escape => 'HTML'); $body->param(PAGE => $self->{PAGE}); } diff --git a/templates/alliancerankings.tmpl b/templates/alliancerankings.tmpl index 847b0cb..a44bbf1 100644 --- a/templates/alliancerankings.tmpl +++ b/templates/alliancerankings.tmpl @@ -17,7 +17,7 @@ - + <TMPL_VAR NAME=SizeImg> <TMPL_VAR NAME=ScoreImg> diff --git a/templates/alliances.tmpl b/templates/alliances.tmpl index 07a4aab..e10127a 100644 --- a/templates/alliances.tmpl +++ b/templates/alliances.tmpl @@ -39,7 +39,7 @@ XP (rank) - + () @@ -62,7 +62,7 @@ IngalReported by - + @@ -92,7 +92,7 @@ Value (avg) - + diff --git a/templates/calls.tmpl b/templates/calls.tmpl index 63dde79..70a2613 100644 --- a/templates/calls.tmpl +++ b/templates/calls.tmpl @@ -52,7 +52,7 @@ Change/remove? - + () @@ -69,7 +69,7 @@ - + @@ -79,7 +79,7 @@
TargetNameMissionTickETAAmount
- + @@ -100,7 +100,7 @@
- + @@ -110,7 +110,7 @@
TargetNameMissionTickETAAmount
- + @@ -123,7 +123,7 @@
- + @@ -133,7 +133,7 @@
SenderNameMissionLanding TickETAAmount
- + @@ -146,7 +146,7 @@
- + diff --git a/templates/check.tmpl b/templates/check.tmpl index a8c55fe..3270812 100644 --- a/templates/check.tmpl +++ b/templates/check.tmpl @@ -16,7 +16,7 @@ - + @@ -40,7 +40,7 @@ - + @@ -69,7 +69,7 @@
CallDCDef FleetsMember (def points)Landing tickRacesAmountShiptypesETAAllianceAttackers
XP
<TMPL_VAR NAME=SizeImg> <TMPL_VAR NAME=ScoreImg> <TMPL_VAR NAME=ValueImg> XPFleet (Resource) valueNickHit usAlliance
<TMPL_VAR NAME=SizeImg> <TMPL_VAR NAME=ScoreImg>
Amount - + @@ -92,7 +92,7 @@
TickType
- + @@ -109,7 +109,7 @@
TickScan
- + @@ -119,7 +119,7 @@
TargetNameMissionLanding tickETAAmount
- + @@ -130,7 +130,7 @@
- + @@ -140,7 +140,7 @@
SenderNameMissionLanding tickETAAmount
- + diff --git a/templates/covop.tmpl b/templates/covop.tmpl index 6904bd7..ca96517 100644 --- a/templates/covop.tmpl +++ b/templates/covop.tmpl @@ -3,7 +3,7 @@ - + diff --git a/templates/defLeeches.tmpl b/templates/defLeeches.tmpl index b8744e2..4490582 100644 --- a/templates/defLeeches.tmpl +++ b/templates/defLeeches.tmpl @@ -8,7 +8,7 @@ - + diff --git a/templates/editRaid.tmpl b/templates/editRaid.tmpl index 13ae19d..be4fa94 100644 --- a/templates/editRaid.tmpl +++ b/templates/editRaid.tmpl @@ -101,7 +101,7 @@
CoordsMetalCrystalEonium% Sec CentresDistsMax (15 agents)Last covop (tick)
Calls
- + diff --git a/templates/forum.tmpl b/templates/forum.tmpl index b74de1f..c0aa490 100644 --- a/templates/forum.tmpl +++ b/templates/forum.tmpl @@ -26,7 +26,7 @@ - + @@ -72,7 +72,7 @@ Move checked threads to: - + @@ -101,7 +101,7 @@ Move checked threads to: - + class="sticky">   diff --git a/templates/galaxyrankings.tmpl b/templates/galaxyrankings.tmpl index ef9b532..d7eb4e4 100644 --- a/templates/galaxyrankings.tmpl +++ b/templates/galaxyrankings.tmpl @@ -19,7 +19,7 @@ - + diff --git a/templates/hostileAlliances.tmpl b/templates/hostileAlliances.tmpl index 8a3fe3c..bb74b0e 100644 --- a/templates/hostileAlliances.tmpl +++ b/templates/hostileAlliances.tmpl @@ -16,7 +16,7 @@ - + diff --git a/templates/intel.tmpl b/templates/intel.tmpl index 20a4607..080233b 100644 --- a/templates/intel.tmpl +++ b/templates/intel.tmpl @@ -102,7 +102,7 @@ - + diff --git a/templates/main.tmpl b/templates/main.tmpl index 7dd2a46..671bb8d 100644 --- a/templates/main.tmpl +++ b/templates/main.tmpl @@ -17,7 +17,7 @@ - + @@ -41,7 +41,7 @@
TickScan
Last post
class="sticky">  
Mark threads as read
<TMPL_VAR NAME=SizeImg> <TMPL_VAR NAME=ScoreImg> <TMPL_VAR NAME=ValueImg> Hostile Counts
IngalReported by
XP
<TMPL_VAR NAME=SizeImg> <TMPL_VAR NAME=ScoreImg>
- + @@ -85,7 +85,7 @@
CallDCLanding tickRacesAmountShiptypesCurrent etaInital etaAttackers
- + @@ -96,7 +96,7 @@
TargetMissionAmountLanding TickBack homechange?
- + diff --git a/templates/memberIntel.tmpl b/templates/memberIntel.tmpl index 169a4ec..a290f10 100644 --- a/templates/memberIntel.tmpl +++ b/templates/memberIntel.tmpl @@ -8,7 +8,7 @@ - + @@ -23,7 +23,7 @@ - + @@ -43,7 +43,7 @@ - + diff --git a/templates/planetNaps.tmpl b/templates/planetNaps.tmpl index a6f6b0c..e1f99d0 100644 --- a/templates/planetNaps.tmpl +++ b/templates/planetNaps.tmpl @@ -5,7 +5,7 @@ - + diff --git a/templates/planetrankings.tmpl b/templates/planetrankings.tmpl index b656f43..8a71486 100644 --- a/templates/planetrankings.tmpl +++ b/templates/planetrankings.tmpl @@ -21,7 +21,7 @@ - + diff --git a/templates/points.tmpl b/templates/points.tmpl index 7b3484a..9136843 100644 --- a/templates/points.tmpl +++ b/templates/points.tmpl @@ -10,7 +10,7 @@ - + diff --git a/templates/raids.tmpl b/templates/raids.tmpl index 203d31c..64f7615 100644 --- a/templates/raids.tmpl +++ b/templates/raids.tmpl @@ -144,7 +144,7 @@

Def outside ND/Gal
XP (rank)Fleet (Resouce) valueNickHit usAlliance
()
<TMPL_VAR NAME=SizeImg> <TMPL_VAR NAME=ScoreImg> <TMPL_VAR NAME=ValueImg> ND Rank
- + diff --git a/templates/resources.tmpl b/templates/resources.tmpl index 1182112..69132f3 100644 --- a/templates/resources.tmpl +++ b/templates/resources.tmpl @@ -11,7 +11,7 @@ - + diff --git a/templates/targetList.tmpl b/templates/targetList.tmpl index f61701a..189e2c1 100644 --- a/templates/targetList.tmpl +++ b/templates/targetList.tmpl @@ -12,7 +12,7 @@ - + diff --git a/templates/users.tmpl b/templates/users.tmpl index edf633b..352b6a5 100644 --- a/templates/users.tmpl +++ b/templates/users.tmpl @@ -63,10 +63,10 @@ -
Estimated score[3]
()NF Value - Ally Value
+
- + -- 2.39.2
UserGroups