/**
  * @see Mission::check()
  */
 public static function check(FleetQueue $fleetQueue)
 {
     $alliance = Alliance::getByUserID($fleetQueue->getTargetPlanet()->id_owner);
     $foreignPlanet = $fleetQueue->getTargetPlanet()->id_owner != WCF::getUser()->userID;
     $isBuddy = WCF::getUser()->hasBuddy($fleetQueue->getTargetPlanet()->id_owner);
     $isInAlliance = $alliance !== null && LWCore::getAlliance() !== null && $alliance->allianceID == LWCore::getAlliance()->allianceID;
     if ($fleetQueue->pageNo == 2) {
         WCF::getTPL()->assign('availableTimes', self::$availableTimes);
     }
     if ($fleetQueue->pageNo == 3) {
         $selectedTime = intval(@$_REQUEST['standByTime']);
         if (!in_array($selectedTime, self::$availableTimes)) {
             return false;
         }
     }
     if ($foreignPlanet && ($isBuddy || $isInAlliance)) {
         return true;
     }
     return false;
 }
Exemple #2
0
            }
            $s['position'] = $s['rank'] == 0 ? '' : "<a href=\"stat.php?start={$s['rank']}\">{$s['rank']}</a>";
            $s['dpath'] = $dpath;
            $s['coordinated'] = "{$s['galaxy']}:{$s['system']}:{$s['planet']}";
            $s['buddy_request'] = $lang['buddy_request'];
            $s['write_a_messege'] = $lang['write_a_messege'];
            $result_list .= parsetemplate($row, $s);
        } elseif ($_POST['type'] == 'allytag' || $_POST['type'] == 'allyname') {
            $s = $r;
            //$s['ally_tag'] = "<a href=\"alliance.php?mode=ainfo&tag={$s['ally_tag']}\">{$s['ally_tag']}</a>";
            $s['ally_tag'] = "<a href=\"game/index.php?page=Alliance&amp;allianceID=" . $s['id'] . "\">{$s['ally_tag']}</a>";
            if (!WCF::getUser()->ally_id && !WCF::getUser()->ally_request_id) {
                $s['ally_actions'] = '<th><a href="game/index.php?form=AllianceApply&amp;allianceID=' . $r['id'] . '"><img src="' . DPATH . 'pic/key.gif" alt="Diplomatie" /></a></th>';
                // interrelation apply
            } else {
                if (WCF::getUser()->ally_id && LWCore::getAlliance()->getRank(true, 6)) {
                    $s['ally_actions'] = '<th><a href="game/index.php?form=AllianceInterrelationApply&amp;allianceID=' . $r['id'] . '&amp;allianceID2=' . WCF::getUser()->ally_id . '"><img src="' . DPATH . 'pic/key.gif" alt="Diplomatie" /></a></th>';
                    // no actions
                } else {
                    $s['ally_actions'] = '<th></th>';
                }
            }
            $result_list .= parsetemplate($row, $s);
        }
    }
    if ($result_list != '') {
        $lang['result_list'] = $result_list;
        $search_results = parsetemplate($table, $lang);
    }
}
//el resto...
 /**
  * View user information
  *
  * @param	int		position
  */
 protected function viewUserInformation($position)
 {
     global $game_config, $user;
     $planet = $this->getPlanet($position);
     if ($planet === null) {
         return '';
     }
     $lang = array('T_TEMP' => $user["settings_tooltiptime"] * 1000, 'user_id' => $planet->id_owner, 'userID' => $planet->id_owner, 'username' => $planet->username);
     // ( normal ) ------+
     // inactive			|
     // longinactive		|
     // confederation	|
     // war enemy		|
     // noob/strong		|
     // banned			|
     // vacation			|
     // admin			|
     //		<-----------+
     $class = '';
     $flag = '';
     // inactive
     if ($planet->onlinetime < time() - 24 * 60 * 60 * 7) {
         if (empty($class)) {
             $class = 'inactive ' . $class;
         } else {
             $class = 'inactive ' . $class;
         }
         if (empty($flag)) {
             $flag .= '(<span class="inactive">i</span>';
         } else {
             $flag .= ' <span class="inactive">i</span>';
         }
     }
     // long inactive
     if ($planet->onlinetime < time() - 24 * 60 * 60 * 28) {
         if (empty($class)) {
             $class = 'longinactive ' . $class;
         } else {
             $class = 'longinactive ' . $class;
         }
         if (empty($flag)) {
             $flag .= '(<span class="longinactive">l</span>';
         } else {
             $flag .= ' <span class="longinactive">l</span>';
         }
     }
     if (WCF::getUser()->ally_id) {
         // confederation
         if (@LWCore::getAlliance()->getInterrelation($planet->ally_id, 1) || LWCore::getAlliance()->getInterrelation($planet->ally_id, 2)) {
             if (empty($class)) {
                 $class = 'confederation ' . $class;
             } else {
                 $class = 'confederation ' . $class;
             }
             if (empty($flag)) {
                 $flag .= '(<span class="confederation">b</span>';
             } else {
                 $flag .= ' <span class="confederation">b</span>';
             }
         }
         // war enemy
         if (@LWCore::getAlliance()->getInterrelation($planet->ally_id, 3)) {
             if (empty($class)) {
                 $class = 'enemy ' . $class;
             } else {
                 $class = 'enemy ' . $class;
             }
             if (empty($flag)) {
                 $flag .= '(<span class="enemy">k</span>';
             } else {
                 $flag .= ' <span class="enemy">k</span>';
             }
         }
     }
     if ($game_config['noobProtection']) {
         // noob
         if (WCF::getUser()->points > $planet->noobProtectionLimit() && $planet->onlinetime > time() - 24 * 60 * 60 * 7 && !$planet->banned) {
             if (empty($class)) {
                 $class = 'noob ' . $class;
             } else {
                 $class = 'noob ' . $class;
             }
             if (empty($flag)) {
                 $flag .= '(<span class="noob">n</span>';
             } else {
                 $flag .= ' <span class="noob">n</span>';
             }
             // strong
         } else {
             if ($planet->points > LWCore::getPlanet()->noobProtectionLimit() && $planet->onlinetime > time() - 24 * 60 * 60 * 7 && !$planet->banned) {
                 if (empty($class)) {
                     $class = 'strong ' . $class;
                 } else {
                     $class = 'strong ' . $class;
                 }
                 if (empty($flag)) {
                     $flag .= '(<span class="strong">s</span>';
                 } else {
                     $flag .= ' <span class="strong">s</span>';
                 }
             }
         }
     }
     // banned
     if ($planet->banned) {
         if (empty($class)) {
             $class = 'banned ' . $class;
         } else {
             $class = 'banned ' . $class;
         }
         if (empty($flag)) {
             $flag .= '(<a href="banned.php"><span class="banned">g</span></a>';
         } else {
             $flag .= ' <a href="banned.php"><span class="banned">g</span></a>';
         }
     }
     // vacation
     if ($planet->urlaubs_modus) {
         if (empty($class)) {
             $class = 'vacation ' . $class;
         } else {
             $class = 'vacation ' . $class;
         }
         if (empty($flag)) {
             $flag .= '(<span class="vacation">u</span>';
         } else {
             $flag .= ' <span class="vacation">u</span>';
         }
     }
     // vacation
     if ($planet->authlevel) {
         if (empty($class)) {
             $class = 'admin ' . $class;
         } else {
             $class = 'admin ' . $class;
         }
         if (empty($flag)) {
             $flag .= '(<span class="admin">a</span>';
         } else {
             $flag .= ' <span class="admin">a</span>';
         }
     }
     // normal
     if (!empty($flag)) {
         $flag = '<span class="flag">' . $flag . ')</span>';
     } else {
         $class .= 'normal ' . $class;
     }
     $lang['class'] = $class;
     $lang['flag'] = $flag;
     $lang['rank'] = $planet->getOwner()->wotRank;
     return parsetemplate(gettemplate('galaxy_row_user'), $lang);
 }