From 8bd21c625add06fed135d3ce99208c7a94b44882 Mon Sep 17 00:00:00 2001 From: Michael Andreen Date: Tue, 19 Dec 2006 13:13:24 +0000 Subject: [PATCH] minor things --- alliances.pl | 6 +++--- calls.pl | 2 +- covop.pl | 2 +- include.pl | 6 ++++-- index.pl | 2 +- intel.pl | 6 +++--- memberIntel.pl | 4 ++-- nd.css | 13 ++++++++----- points.pl | 2 +- raid.js | 2 +- resources.pl | 2 +- templates/skel.tmpl | 4 ++-- templates/targetlist.tmpl | 8 +++++++- top100.pl | 2 +- users.pl | 2 +- 15 files changed, 37 insertions(+), 26 deletions(-) diff --git a/alliances.pl b/alliances.pl index 62aae64..66ecfd6 100644 --- a/alliances.pl +++ b/alliances.pl @@ -84,9 +84,9 @@ ORDER BY $order}); $members->execute($alliance->{id}); my $i = 0; while (my $member = $members->fetchrow_hashref){ + $i++; $member->{ODD} = $i % 2; push @members,$member; - $i++; } $BODY->param(Members => \@members); @@ -105,9 +105,9 @@ ORDER BY $order}); }else{ $intel->{missionclass} = $intel->{mission}; } + $i++; $intel->{ODD} = $i % 2; push @intel,$intel; - $i++; } $BODY->param(Intel => \@intel); }else{ @@ -131,10 +131,10 @@ ORDER BY $order my @alliances; my $i = 0; while (my $alliance = $query->fetchrow_hashref){ + $i++; next if ($alliance->{score} < 1 && $alliance->{kscore} < 1); $alliance->{ODD} = $i % 2; push @alliances, $alliance; - $i++; } $BODY->param(Alliances => \@alliances); } diff --git a/calls.pl b/calls.pl index ad7e13c..e6153a1 100644 --- a/calls.pl +++ b/calls.pl @@ -190,10 +190,10 @@ ORDER BY c.landing_tick DESC my @calls; my $i = 0; while (my $call = $query->fetchrow_hashref){ + $i++; $call->{ODD} = $i % 2; $call->{shiptype} = escapeHTML($call->{shiptype}); push @calls, $call; - $i++; } $BODY->param(Calls => \@calls); } diff --git a/covop.pl b/covop.pl index 9c8284d..0614da0 100644 --- a/covop.pl +++ b/covop.pl @@ -59,10 +59,10 @@ $query->execute($ND::PLANET); my @targets; my $i = 0; while (my ($id,$coords,$metal,$crystal,$eonium,$seccents,$dists,$lastcovop,$user,$max) = $query->fetchrow){ + $i++; push @targets,{Username => $user, Target => $id, Coords => $coords , Metal => $metal, Crystal => $crystal, Eonium => $eonium, SecCents => $seccents , Dists => $dists, MaxResHack => $max, LastCovOp => $lastcovop, List => $list, ODD => $i % 2}; - $i++; } $BODY->param(Targets => \@targets); diff --git a/include.pl b/include.pl index c5a5acf..0bf16a8 100644 --- a/include.pl +++ b/include.pl @@ -67,7 +67,7 @@ sub max { } sub listTargets { - my $query = $ND::DBH->prepare(qq{SELECT t.id, r.id AS raid, r.tick+c.wave-1 AS landingtick, released_coords, coords(x,y,z),c.launched,c.wave + my $query = $ND::DBH->prepare(qq{SELECT t.id, r.id AS raid, r.tick+c.wave-1 AS landingtick, released_coords, coords(x,y,z),c.launched,c.wave,c.joinable FROM raid_claims c JOIN raid_targets t ON c.target = t.id JOIN raids r ON t.raid = r.id @@ -80,7 +80,9 @@ ORDER BY r.tick+c.wave,x,y,z}); my $coords = "Target $target->{id}"; $coords = $target->{coords} if $target->{released_coords}; push @targets,{Coords => $coords, Launched => $target->{launched}, Raid => $target->{raid} - , Target => $target->{id}, Tick => $target->{landingtick}, Wave => $target->{wave}, AJAX => $ND::AJAX}; + , Target => $target->{id}, Tick => $target->{landingtick}, Wave => $target->{wave} + , AJAX => $ND::AJAX, JoinName => $target->{joinable} ? 'N' : 'J' + , Joinable => $target->{joinable} ? 'FALSE' : 'TRUE'}; } my $template = HTML::Template->new(filename => "templates/targetlist.tmpl"); $template->param(Targets => \@targets); diff --git a/index.pl b/index.pl index 3d32460..ecb27a2 100755 --- a/index.pl +++ b/index.pl @@ -120,7 +120,7 @@ $USER = undef; $PLANET = undef; $TEMPLATE = undef; $TICK = undef; -%GROUPS = undef; +undef %GROUPS; $ND::BODY = undef; exit; diff --git a/intel.pl b/intel.pl index c1beff4..90498c2 100644 --- a/intel.pl +++ b/intel.pl @@ -143,9 +143,9 @@ if ($planet){ }else{ $intel->{missionclass} = $intel->{mission}; } + $i++; $intel->{ODD} = $i % 2; push @intel,$intel; - $i++; } push @intellists,{Message => 'Incoming fleets', Intel => \@intel, Origin => 1}; @@ -159,9 +159,9 @@ if ($planet){ }else{ $intel->{missionclass} = $intel->{mission}; } + $i++; $intel->{ODD} = $i % 2; push @intel,$intel; - $i++; } push @intellists,{Message => 'Outgoing Fleets', Intel => \@intel, Target => 1}; @@ -184,9 +184,9 @@ if ($planet){ }else{ $intel->{missionclass} = $intel->{mission}; } + $i++; $intel->{ODD} = $i % 2; push @intel,$intel; - $i++; } push @intellists,{Message => q{Intel where alliances doesn't match}, Intel => \@intel, Origin => 1, Target => 1}; $BODY->param(IntelLIsts => \@intellists); diff --git a/memberIntel.pl b/memberIntel.pl index 98d6738..db7c939 100644 --- a/memberIntel.pl +++ b/memberIntel.pl @@ -47,9 +47,9 @@ while (my $intel = $query->fetchrow_hashref){ }else{ $intel->{missionclass} = $intel->{mission}; } + $i++; $intel->{ODD} = $i % 2; push @intel,$intel; - $i++; } push @intellists,{Message => 'Incoming fleets', Intel => \@intel, Origin => 1}; @@ -63,9 +63,9 @@ while (my $intel = $query->fetchrow_hashref){ }else{ $intel->{missionclass} = $intel->{mission}; } + $i++; $intel->{ODD} = $i % 2; push @intel,$intel; - $i++; } push @intellists,{Message => 'Outgoing Fleets', Intel => \@intel, Target => 1}; diff --git a/nd.css b/nd.css index 1d1d9ac..869c7ba 100644 --- a/nd.css +++ b/nd.css @@ -1,5 +1,5 @@ body { - padding-left: 12em; + padding-left: 14em; /*padding-right: 12em;*/ font-family: sans-serif; color: black; @@ -9,7 +9,7 @@ body { padding: 0; margin: 0; position: absolute; - width: 10em; + width: 14em; top: 1em; } #leftbar{ @@ -28,7 +28,7 @@ p.claimlinks{ ul.linkbar { list-style-type: none; - width: 10em; + width: 13.5em; padding: 0; margin: 0; } @@ -42,8 +42,11 @@ ul.linkbar li { ul.linkbar a { text-decoration: none; } -input.coord { - width: 3.5em; +input.coordsinput { + width: 4em; +} +input.small { + width: 1.7em; } tr.odd { background: white; diff --git a/points.pl b/points.pl index 464ad18..6d33689 100644 --- a/points.pl +++ b/points.pl @@ -45,9 +45,9 @@ $query->execute; my @members; my $i = 0; while (my ($username,$defense,$attack,$scan,$humor,$total,$rank) = $query->fetchrow){ + $i++; push @members,{Username => $username, Defense => $defense, Attack => $attack , Scan => $scan, Humor => $humor, Total => $total, Rank => $rank, ODD => $i % 2}; - $i++; } $BODY->param(Members => \@members); diff --git a/raid.js b/raid.js index 99204f4..ecebcbd 100644 --- a/raid.js +++ b/raid.js @@ -65,7 +65,7 @@ function listTargets(dataSource){ var obj = document.getElementById("targets"); if (obj){ clearObject(obj); - var re = new RegExp("targetlist>(.*)((.|\\n)*)execute; my @alliances; my $i = 0; while (my $alliance = $query->fetchrow_hashref){ + $i++; $alliance->{ODD} = $i % 2; push @alliances,$alliance; - $i++ } $BODY->param(Alliances => \@alliances); diff --git a/templates/skel.tmpl b/templates/skel.tmpl index e4bb019..c554c28 100644 --- a/templates/skel.tmpl +++ b/templates/skel.tmpl @@ -31,8 +31,8 @@ diff --git a/templates/targetlist.tmpl b/templates/targetlist.tmpl index 0fd2a73..a3584ff 100644 --- a/templates/targetlist.tmpl +++ b/templates/targetlist.tmpl @@ -1,3 +1,6 @@ +

+

@@ -8,8 +11,11 @@ diff --git a/top100.pl b/top100.pl index 20b0bd1..455312c 100644 --- a/top100.pl +++ b/top100.pl @@ -68,9 +68,9 @@ 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; - $i++; } $BODY->param(Planets => \@planets); diff --git a/users.pl b/users.pl index 3425c24..6ed91d8 100644 --- a/users.pl +++ b/users.pl @@ -115,9 +115,9 @@ $BODY->param(AddGroups => \@addgroups); my @users; my $i = 0; while (my $user = $query->fetchrow_hashref){ + $i++; $user->{ODD} = $i % 2; push @users, $user; - $i++; } $BODY->param(Users => \@users); } -- 2.39.2
TargetTick
U - + + ',,,'set&joinable=')"/>