X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=index.pl;h=31beaf5ce486f3a2159fb571bf263ea700825ea0;hb=6eacbf94cc13b8b6df3018df1159065fc9a5140e;hp=3937831a738e81695fbfe29e681184ee0d442956;hpb=f9988de5abba670c799cb616d55897a2ff723e54;p=ndwebbie.git diff --git a/index.pl b/index.pl index 3937831..31beaf5 100755 --- a/index.pl +++ b/index.pl @@ -32,6 +32,7 @@ chdir $ENV{'DOCUMENT_ROOT'}; our $DBH = undef; our $USER = $ENV{'REMOTE_USER'}; +my $error; our $TEMPLATE = HTML::Template->new(filename => 'templates/skel.tmpl'); @@ -63,7 +64,7 @@ while (my ($name,$attack,$gid) = $query->fetchrow()){ our $LOG = $DBH->prepare('INSERT INTO log (uid,text) VALUES(?,?)'); my $page = 'main'; -if (param('page') =~ /^(main|check|motd|points|covop|top100|launchConfirmation|addintel|defrequest|raids|editRaid|calls)$/){ +if (param('page') =~ /^(main|check|motd|points|covop|top100|launchConfirmation|addintel|defrequest|raids|editRaid|calls|intel|users|alliances|memberIntel|resources)$/){ $page = $1; } @@ -81,14 +82,15 @@ if ($XML){ unless (my $return = do "${page}.pl"){ - print "

couldn't parse $page: $@

" if $@; - print "

couldn't do $page: $!

" unless defined $return; - print "

couldn't run $page

" unless $return; + $error .= "

couldn't parse $page: $@

" if $@; + $error .= "

couldn't do $page: $!

" unless defined $return; + $error .= "

couldn't run $page

" unless $return; } unless ($XML){ my $fleetupdate = $DBH->selectrow_array('SELECT landing_tick FROM fleets WHERE uid = ? AND fleet = 0',undef,$UID); + $TEMPLATE->param(Tick => $TICK); $TEMPLATE->param(isMember => (($TICK - $fleetupdate < 24) || isScanner()) && $PLANET && isMember()); $TEMPLATE->param(isHC => isHC()); @@ -98,6 +100,8 @@ unless ($XML){ if ($ATTACKER && (!isMember() || ((($TICK - $fleetupdate < 24) || isScanner()) && $PLANET))){ $ND::TEMPLATE->param(Targets => listTargets()); } + $TEMPLATE->param(Coords => param('coords') ? param('coords') : '1:1:1'); + $TEMPLATE->param(Error => $error); } $ND::TEMPLATE->param(BODY => $ND::BODY->output);