X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=index.pl;h=537f46fed29ab15cd2f93772da02c22d66f60c7a;hb=d0c7c398c7c8f53a2847b36871d540b48055b0c5;hp=3937831a738e81695fbfe29e681184ee0d442956;hpb=f9988de5abba670c799cb616d55897a2ff723e54;p=ndwebbie.git diff --git a/index.pl b/index.pl index 3937831..537f46f 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,23 +82,27 @@ 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()); $TEMPLATE->param(isDC => isDC()); $TEMPLATE->param(isBC => isBC()); + $TEMPLATE->param(isIntel => isBC()); $TEMPLATE->param(isAttacker => $ATTACKER && (!isMember() || ((($TICK - $fleetupdate < 24) || isScanner()) && $PLANET))); 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);