From 6a365a7f7bfedc7b7d45991445bda2eb7d44d39b Mon Sep 17 00:00:00 2001 From: Michael Andreen Date: Tue, 12 Dec 2006 09:39:08 +0000 Subject: [PATCH] small fix with the menu --- include.pl | 4 ++++ index.pl | 16 ++++++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/include.pl b/include.pl index cb27693..0f85f92 100644 --- a/include.pl +++ b/include.pl @@ -40,6 +40,10 @@ sub isOfficer { return exists $ND::GROUPS{Officers}; } +sub isScanner { + return exists $ND::GROUPS{Scanner}; +} + sub parseMarkup { my ($text) = @_; diff --git a/index.pl b/index.pl index 1b55a13..f19ced9 100755 --- a/index.pl +++ b/index.pl @@ -51,6 +51,7 @@ for my $file ("db.pl","include.pl"){ ($TICK) = $DBH->selectrow_array('SELECT tick()',undef); + my $query = $DBH->prepare('SELECT groupname,attack,gid from groupmembers NATURAL JOIN groups WHERE uid = ?'); $query->execute($UID); @@ -61,12 +62,6 @@ while (my ($name,$attack,$gid) = $query->fetchrow()){ $ATTACKER = 1 if $attack; } -$TEMPLATE->param(Tick => $TICK); -$TEMPLATE->param(isMember => isMember()); -$TEMPLATE->param(isHC => isHC()); -$TEMPLATE->param(isDC => isDC()); -$TEMPLATE->param(isBC => isBC()); -$TEMPLATE->param(isAttacker => $ATTACKER); our $LOG = $DBH->prepare('INSERT INTO log (uid,text) VALUES(?,?)'); @@ -84,6 +79,15 @@ unless (my $return = do "${page}.pl"){ print "

couldn't run $page

" unless $return; } +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(isAttacker => $ATTACKER && (!isMember() || ((($TICK - $fleetupdate < 24) || isScanner()) && $PLANET))); + $ND::TEMPLATE->param(BODY => $ND::BODY->output); print $TEMPLATE->output; -- 2.39.2