/** * @see Page::readData */ public function readData() { global $user; parent::readData(); $features = unserialize(WCF::getUser()->diliziumFeatures); if (!isset($features['galaxyScans']) || $features['galaxyScans'] <= TIME_NOW) { message('Dir steht diese Funktion nicht zur Verfügung!'); } // get planet $this->planetObj = Planet::getInstance($this->planetID); $subject = 'Spionagebericht von ' . $this->planetObj; $this->reports = EspionageFleet::searchReports(WCF::getUser()->userID, $this->planetID); if (!count($this->reports)) { message('Kein Spionagebericht gefunden!'); } }
/** * Reads a report from the database and saves it * * @return str file name */ protected function getReport() { if (empty($this->planetID)) { return ''; } $this->planetObj = Planet::getInstance($this->planetID); $reports = EspionageFleet::searchReports(WCF::getUser()->userID, $this->planetID, 1); $report = end($reports); $report = $report['report']; $report = str_replace(array('ä', 'ö', 'ü', 'ß', '�', '&'), array('ae', 'oe', 'ue', 'ss', 'ss', '&'), $report); $report = "<?xml version=\"1.0\" encoding=\"iso-8859-1\" ?>\n<div>" . $report . '</div>'; $fileName = FileUtil::getTemporaryFilename('report_'); $file = new File($fileName); $file->write($report); $file->close(); return $fileName; }
/** * View action links * * @param int position */ protected function viewActions($position) { global $user; $planet = $this->getPlanet($position); if ($planet === null || $planet->userID == $user['id']) { return ''; } $lang = array('g' => $planet->galaxy, 's' => $planet->system, 'i' => $planet->planet, 'spio_anz' => $user['spio_anz'], 'userID' => $planet->id_owner); // reports $features = unserialize($user['diliziumFeatures']); if (@$features['galaxyScans'] > TIME_NOW && count(EspionageFleet::searchReports(WCF::getUser()->userID, $planet->planetID))) { $lang['reportLink'] = '<a onclick="f(\'game/index.php?page=viewScan&planetID=' . $planet->planetID . '\');"><img src="{dpath}img/s.gif" alt="Spionagebericht anzeigen" title="Spionagebericht anzeigen" border="0"></a>'; } else { $lang['reportLink'] = ''; } return parsetemplate(gettemplate('galaxy_row_action'), $lang); }
/** * View action links * * @param int position */ protected function viewActions($position) { global $user; $planet = $this->getPlanet($position); if ($planet === null || $planet->userID == $user['id']) { return ''; } $lang = array('g' => $planet->galaxy, 's' => $planet->system, 'i' => $planet->planet, 'spio_anz' => $user['spio_anz'], 'userID' => $planet->id_owner); // reports $features = unserialize($user['diliziumFeatures']); if (@$features['galaxyScans'] > TIME_NOW && count(EspionageFleet::searchReports(WCF::getUser()->userID, $planet->planetID))) { $lang['reportLink'] = '<a onclick="f(\'game/index.php?page=viewScan&planetID=' . $planet->planetID . '\');"><img src="{dpath}img/s.gif" alt="Spionagebericht anzeigen" title="Spionagebericht anzeigen" border="0"></a>'; } else { $lang['reportLink'] = ''; } // interplanetaries $maxSystems = WCF::getUser()->impulse_motor_tech * 4; $systemsDistance = abs(LWCore::getPlanet()->system - $planet->system); if ($systemsDistance <= $maxSystems && LWCore::getPlanet()->galaxy == $planet->galaxy && LWCore::getPlanet()->interplanetary_misil) { $lang['interplanetaryBit'] = "<a style=\"cursor: pointer;\" onclick=\"document.getElementById('interplanetaryrmissilestable').style.display = ''; document.getElementById('ipmplanet').value = '" . $planet->planet . "';\"><img src=\"{dpath}img/r.gif\" alt=\"Interplanetarraketen-Angriff\" title=\"Interplanetarraketen-Angriff\" border=\"0\"></a>"; } else { $lang['interplanetaryBit'] = ""; } return parsetemplate(gettemplate('galaxy_row_action'), $lang); }