Example #1
0
 /**
  * Start constructing the page.
  * Prepare all the shared variables such as dates and check alliance ID.
  *
  */
 function start()
 {
     $this->page = new Page('Related kills & losses');
     $this->page->addHeader('<meta name="robots" content="index, nofollow" />');
     $this->kll_id = (int) edkURI::getArg('kll_id', 1);
     if (!$this->kll_id) {
         $this->kll_external_id = (int) edkURI::getArg('kll_ext_id');
         if (!$this->kll_external_id) {
             // internal and external ids easily overlap so we can't guess which
             $this->kll_id = (int) edkURI::getArg(null, 1);
             $this->kill = Kill::getByID($this->kll_id);
         } else {
             $this->kill = new Kill($this->kll_external_id, true);
             $this->kll_id = $this->kill->getID();
         }
     } else {
         $this->kill = Kill::getByID($this->kll_id);
     }
     $this->adjacent = edkURI::getArg('adjacent');
     $this->scl_id = (int) edkURI::getArg('scl_id');
     $this->menuOptions = array();
     if (!$this->kll_id || !$this->kill->exists()) {
         echo 'No valid kill id specified';
         exit;
     }
     if ($this->kill->isClassified()) {
         Header("Location: " . htmlspecialchars_decode(edkURI::page('kill_detail', $this->kll_id, 'kll_id')));
         die;
     }
     //		$this->getInvolved();
     //		$this->buildStats();
 }
 /**
  * @return string HTML string for the summary overview of the battle.
  */
 public function overview()
 {
     global $smarty;
     $smarty->assignByRef('pilots_a', $this->pilots['a']);
     $smarty->assignByRef('pilots_e', $this->pilots['e']);
     $pod = Ship::getByID(670);
     $smarty->assign('podpic', $pod->getImage(32));
     $smarty->assign('friendlycnt', count($this->pilots['a']));
     $smarty->assign('hostilecnt', count($this->pilots['e']));
     if ($this->kill->isClassified()) {
         $smarty->assign('system', 'Classified System');
     } else {
         if (!$this->adjacent) {
             $smarty->assign('system', $this->kill->getSolarSystemName());
         } else {
             $sysnames = array();
             foreach ($this->systems as $sys_id) {
                 $system = SolarSystem::getByID($sys_id);
                 $sysnames[] = $system->getName();
             }
             $smarty->assign('system', implode(', ', $sysnames));
         }
     }
     $smarty->assign('firstts', $this->firstts);
     $smarty->assign('lastts', $this->lastts);
     $smarty->assign("battleOverviewTableTemplate", $this->templateDir . "battle_overview_table.tpl");
     return $smarty->fetch($this->templateDir . "battle_overview.tpl");
 }