コード例 #1
0
ファイル: self_detail.php プロジェクト: biow0lf/evedev-kb
 function display()
 {
     global $smarty;
     $alls = $corps = $pilots = false;
     if (config::get('cfg_allianceid')) {
         $alls = array();
         foreach (config::get('cfg_allianceid') as $entity) {
             $alliance = new Alliance($entity);
             if ($alliance->getExternalID()) {
                 $url = edkURI::page('alliance_detail', $alliance->getExternalID(), 'all_ext_id');
             } else {
                 $url = edkURI::page('alliance_detail', $alliance->getID(), 'all_id');
             }
             $alls[] = array('id' => $alliance->getID(), 'extid' => $alliance->getExternalID(), 'name' => $alliance->getName(), 'portrait' => $alliance->getPortraitURL(128), 'url' => $url);
         }
     }
     if (config::get('cfg_corpid')) {
         $corps = array();
         foreach (config::get('cfg_corpid') as $entity) {
             $corp = new Corporation($entity);
             if ($corp->getExternalID()) {
                 $url = edkURI::page('corp_detail', $corp->getExternalID(), 'crp_ext_id');
             } else {
                 $url = edkURI::page('corp_detail', $corp->getID(), 'crp_id');
             }
             $corps[] = array('id' => $corp->getID(), 'extid' => $corp->getExternalID(), 'name' => $corp->getName(), 'portrait' => $corp->getPortraitURL(128), 'url' => $url);
         }
     }
     if (config::get('cfg_pilotid')) {
         $pilots = array();
         foreach (config::get('cfg_pilotid') as $entity) {
             $pilot = new Pilot($entity);
             if ($pilot->getExternalID()) {
                 $url = edkURI::page('pilot_detail', $pilot->getExternalID(), 'plt_ext_id');
             } else {
                 $url = edkURI::page('pilot_detail', $pilot->getID(), 'plt_id');
             }
             $pilots[] = array('id' => $pilot->getID(), 'extid' => $pilot->getExternalID(), 'name' => $pilot->getName(), 'portrait' => $pilot->getPortraitURL(128), 'url' => $url);
         }
     }
     $smarty->assignByRef('alliances', $alls);
     $smarty->assignByRef('corps', $corps);
     $smarty->assignByRef('pilots', $pilots);
     return $smarty->fetch(get_tpl('self'));
 }
コード例 #2
0
ファイル: class.scout.php プロジェクト: jjlupa/edk-mods
 function getPilotData($pilotID, $scoutID = 0)
 {
     if (!isset($pilotID) || !is_numeric($pilotID)) {
         return;
     }
     $pilot = new Pilot($pilotID);
     $pilot->exists();
     //required for r604 to r1027 edk code (also including up to 3.1.5 releases)
     $corp = $pilot->getCorp();
     $corpID = $corp->getID();
     $alliance = $corp->getAlliance();
     $allianceID = $alliance->getID();
     $pilotName = $pilot->getName();
     $corpName = $corp->getName();
     $allianceName = $alliance->getName();
     $img = $pilot->getPortraitURL(64);
     return array('pilotid' => $pilotID, 'scoutid' => $scoutID, 'pilotname' => $pilotName, 'corp' => $corpName, 'corpid' => $corpID, 'alliance' => $allianceName, 'allianceid' => $allianceID, 'pilotimg' => $img, 'killid' => $this->killID_);
 }
コード例 #3
0
 /**
  * Generate the output html from the template file.
  */
 function generate()
 {
     global $smarty;
     $rows = array();
     $max = 0;
     for ($i = 1; $i <= $this->length_; $i++) {
         $row = $this->toplist_->getRow();
         if ($row) {
             $rows[] = $row;
         }
         if ($row['cnt'] > $max) {
             $max = $row['cnt'];
         }
     }
     if (empty($rows)) {
         return;
     }
     $pilot = new Pilot($rows[0]['plt_id']);
     $smarty->assign('title', $this->title_);
     $smarty->assign('pilot_portrait', $pilot->getPortraitURL(64));
     $smarty->assign('award_img', config::get('cfg_img') . "/awards/" . $this->award_ . ".png");
     $smarty->assign('url', edkURI::build(array('a', 'pilot_detail', true), array('plt_id', $rows[0]['plt_id'], true)));
     $smarty->assign('name', $pilot->getName());
     $bar = new BarGraph($rows[0]['cnt'], $max);
     $smarty->assign('bar', $bar->generate());
     $smarty->assign('cnt', $rows[0]['cnt']);
     for ($i = 2; $i < $this->length_ + 1; $i++) {
         if (!$rows[$i - 1]['plt_id']) {
             break;
         } else {
             if (!$rows[$i - 1]['plt_name']) {
                 $pilot = new Pilot($rows[$i - 1]['plt_id']);
                 $pilotname = $pilot->getName();
             } else {
                 $pilotname = $rows[$i - 1]['plt_name'];
             }
         }
         $bar = new BarGraph($rows[$i - 1]['cnt'], $max);
         $top[$i] = array('url' => edkURI::build(array('a', 'pilot_detail', true), array('plt_id', $rows[$i - 1]['plt_id'], true)), 'name' => $pilotname, 'bar' => $bar->generate(), 'cnt' => $rows[$i - 1]['cnt']);
     }
     $smarty->assign('top', $top);
     $smarty->assign('comment', $this->comment_);
     return $smarty->fetch(get_tpl('award_box'));
 }
コード例 #4
0
 public static function GenerateRow($pods = false, $header = true)
 {
     global $smarty;
     $klist = new KillList();
     $klist->setOrdered(true);
     $klist->setOrderBy("kll_isk_loss DESC");
     if ($pods == false) {
         $klist->setPodsNoobShips(false);
     } else {
         $klist->addVictimShipClass(2);
     }
     $klist->setLimit(self::NUM_DISPLAYED);
     if (isset($_GET["w"])) {
         self::$week = intval($_GET["w"]);
     }
     if (isset($_GET["m"])) {
         self::$month = intval($_GET["m"]);
     }
     if (isset($_GET["y"])) {
         self::$year = intval($_GET["y"]);
     }
     self::setTime(self::$week, self::$year, self::$month);
     $view = preg_replace('/[^a-zA-Z0-9_-]/', '', $_GET['view']);
     if (config::get('show_monthly')) {
         $start = makeStartDate(0, self::$year, self::$month);
         $end = makeEndDate(0, self::$year, self::$month);
         $klist->setStartDate(gmdate('Y-m-d H:i', $start));
         $klist->setEndDate(gmdate('Y-m-d H:i', $end));
         $smarty->assign("displaylist", date('F', mktime(0, 0, 0, self::$month, 1, self::$year)) . ", " . self::$year);
     } else {
         $klist->setWeek(self::$week);
         $klist->setYear(self::$year);
         $plist->setWeek(self::$week);
         $plist->setYear(self::$year);
         $smarty->assign("displaylist", "Week " . self::$week . ", " . self::$year);
     }
     if (config::get("exp_incloss")) {
         $smarty->assign("displaytype", "Kills and Losses");
         involved::load($klist, "combined");
     } else {
         $smarty->assign("displaytype", "Kills");
         involved::load($klist, "kill");
     }
     $kills = array();
     while ($kill = $klist->getKill()) {
         $kll = array();
         $plt = new Pilot($kill->getVictimID());
         if ($kill->isClassified() && !Session::isAdmin()) {
             $kll['systemsecurity'] = "-";
             $kll['system'] = Language::get("classified");
         } else {
             $kll['systemsecurity'] = $kill->getSolarSystemSecurity();
             $kll['system'] = $kill->getSolarSystemName();
         }
         $kll["id"] = $kill->getID();
         $kll["victim"] = $kill->getVictimName();
         $kll["victimid"] = $kill->getVictimID();
         $kll["victimship"] = $kill->getVictimShipName();
         $kll["victimshipid"] = $kill->getVictimShipExternalID();
         $kll["victimshipclass"] = $kill->getVictimShipClassName();
         $kll["victimcorp"] = $kill->getVictimCorpName();
         $kll["victimcorpid"] = $kill->getVictimCorpID();
         $alliance = Alliance::getByID($kill->getVictimAllianceID());
         if ($pods == false) {
             $kll["victimimageurl"] = $kill->getVictimShipImage(128);
         } else {
             $kll["victimimageurl"] = $plt->getPortraitURL(128);
         }
         $kll["victimallimage"] = $alliance->getPortraitURL(32);
         $kll["victimallname"] = $alliance->getName();
         if ((int) number_format($kill->getISKLoss(), 0, "", "") > 1000000000) {
             $kll["isklost"] = number_format($kill->getISKLoss() / 1000000000, 2, ".", "") . " Billion";
         } elseif ((int) number_format($kill->getISKLoss(), 0, "", "") > 1000000) {
             $kll["isklost"] = number_format($kill->getISKLoss() / 1000000, 2, ".", "") . " Million";
         } else {
             $kll["isklost"] = number_format($kill->getISKLoss(), 0, ".", ",");
         }
         if (config::get('cfg_allianceid') && in_array($kill->getVictimAllianceID(), config::get('cfg_allianceid'))) {
             $kll["class"] = "kl-loss";
             $kll["classlink"] = '<font color="#AA0000">&bull;</font>';
         } elseif (config::get('cfg_corpid') && in_array($kill->getVictimCorpID(), config::get('cfg_corpid'))) {
             $kll["class"] = "kl-loss";
             $kll["classlink"] = '<font color=\\"#AA0000\\">&bull;</font>';
         } elseif (config::get('cfg_pilotid') && in_array($kill->getVictimID(), config::get('cfg_pilotid'))) {
             $kll["class"] = "kl-loss";
             $kll["classlink"] = '<font color="#AA0000">&bull;</font>';
         } else {
             $kll["class"] = "kl-kill";
             $kll["classlink"] = '<font color="#00AA00">&bull;</font>';
         }
         $kills[] = $kll;
     }
     if ($header == true) {
         $smarty->assign("header", true);
     } else {
         $smarty->assign("header", false);
     }
     $smarty->assign("killlist", $kills);
     $smarty->assign("width", 100 / self::NUM_DISPLAYED);
     return $smarty->fetch(get_tpl('most_expensive_summary'));
 }
コード例 #5
0
ファイル: kill_detail.php プロジェクト: biow0lf/evedev-kb
 /**
  * Return HTML to describe the victim
  *
  * @global Smarty $smarty
  * @return string HTML to describe the victim
  */
 function victim()
 {
     global $smarty;
     $smarty->assign('killID', $this->kill->getID());
     $plt = new Pilot($this->kill->getVictimID());
     $item = new dogma($this->kill->getVictimShip()->getID());
     // itt_cat = 6 for ships. Assume != 6 is a structure.
     if ($item->get('itt_cat') != 6) {
         $corp = new Corporation($this->kill->getVictimCorpID());
         $smarty->assign('victimPortrait', $corp->getPortraitURL(64));
         $smarty->assign('victimExtID', 0);
         $smarty->assign('victimURL', edkURI::page('invtype', $item->getID()));
     } else {
         $smarty->assign('victimPortrait', $plt->getPortraitURL(64));
         $smarty->assign('victimExtID', $plt->getExternalID());
         $smarty->assign('victimURL', edkURI::page('pilot_detail', $this->kill->getVictimID(), 'plt_id'));
     }
     $smarty->assign('victimName', $this->kill->getVictimName());
     $smarty->assign('victimCorpURL', edkURI::page('corp_detail', $this->kill->getVictimCorpID(), 'crp_id'));
     $smarty->assign('victimCorpName', $this->kill->getVictimCorpName());
     $smarty->assign('victimAllianceURL', edkURI::page('alliance_detail', $this->kill->getVictimAllianceID(), 'all_id'));
     $smarty->assign('victimAllianceName', $this->kill->getVictimAllianceName());
     $smarty->assign('victimDamageTaken', $this->kill->getDamageTaken());
     return $smarty->fetch(get_tpl('kill_detail_victim'));
 }
コード例 #6
0
 function displayFitting($home)
 {
     global $smarty;
     //require_once("common/includes/class.dogma.php");
     $kll_id = $home->kll_id;
     //echo "here";
     //echo self::$oper;
     self::$shipStats = new shipstats();
     $urlsettings = edkURI::parseURI();
     self::$simpleurl = $urlsettings[0][2];
     //echo "-> ".self::$simpleurl;
     $fitter = new fitting($kll_id);
     $theFit = $fitter->displayFitting();
     if ($home->kll_id) {
         $km = Cacheable::factory('Kill', $home->kll_id);
     } else {
         $km = new Kill($home->kll_external_id, true);
         $km = $home->kill->getID();
     }
     if (!$km->exists()) {
         $html = "That kill doesn't exist.";
         $home->page->setContent($html);
         $home->page->generate($html);
         exit;
     }
     //echo "-->".$km->getExternalID()."<br />";
     if ($km->getExternalID() != 0) {
         //echo "Yes<br />";
         self::$extid = $km->getExternalID();
     } else {
         //echo "No<br />";
         $qry = new DBQuery();
         $qry->execute("SELECT kll_external_id FROM kb3_kills WHERE kll_id = '" . $home->kll_id . "';");
         $row = $qry->getRow();
         if ($row['kll_external_id'] != 0) {
             //echo "Yes ".$row['kll_external_id']."br />";
             self::$extid = $row['kll_external_id'];
         } else {
             //echo "No<br />";
             self::$extid = 0;
         }
     }
     fittingTools::source($kll_id, $km->getExternalID());
     $corp = "";
     $alli = "";
     $char = "";
     $ship = "";
     $weap = "";
     $topdamage = 0;
     $maxdamage = -1;
     foreach ($km->getInvolved() as $inv) {
         /*echo "<pre>";
         		print_r($inv);
         		echo "</pre>";*/
         if ($inv->getDamageDone() > $maxdamage) {
             if ($km->getFBPilotID() == $inv->getPilotID()) {
                 $maxdamage = $inv->getDamageDone();
                 //$topdamage = $inv;
                 $corp = $inv->getCorpID();
                 $alli = $inv->getAllianceID();
                 $char = $inv->getPilotID();
                 $ship = $inv->getShipID();
                 $weap = $inv->getWeaponID();
                 $fcorp = $inv->getCorpID();
                 $falli = $inv->getAllianceID();
                 $fchar = $inv->getPilotID();
                 $fship = $inv->getShipID();
                 $fweap = $inv->getWeaponID();
             } else {
                 $maxdamage = $inv->getDamageDone();
                 //$topdamage = $inv;
                 $corp = $inv->getCorpID();
                 $alli = $inv->getAllianceID();
                 $char = $inv->getPilotID();
                 $ship = $inv->getShipID();
                 $weap = $inv->getWeaponID();
             }
         } else {
             if ($km->getFBPilotID() == $inv->getPilotID()) {
                 $fcorp = $inv->getCorpID();
                 $falli = $inv->getAllianceID();
                 $fchar = $inv->getPilotID();
                 $fship = $inv->getShipID();
                 $fweap = $inv->getWeaponID();
             }
         }
     }
     $plt = new Pilot($char);
     $charIcon = $plt->getPortraitURL(64);
     $charName = $plt->getName();
     $charURL = edkURI::page('pilot_detail', $char, 'plt_id');
     $clt = new Corporation($corp, false);
     $corpIcon = $clt->getPortraitURL(32);
     $corpName = $clt->getName();
     $corpURL = edkURI::page('corp_detail', $corp, 'crp_id');
     $alt = new Alliance($alli, false);
     $alliIcon = $alt->getPortraitURL(32);
     $alliName = $alt->getName();
     $alliURL = edkURI::page('alliance_detail', $corp, 'all_id');
     $slt = new Ship($ship);
     $shipIcon = $slt->getImage(32);
     $shipName = $slt->getName();
     $shipURL = edkURI::page('invtype', $ship, 'id');
     $ilt = new Item($weap);
     $weapIcon = $ilt->getIcon(32);
     $weapURL = edkURI::page('invtype', $weap, 'id');
     $smarty->assign('topgetCorpID', $corp);
     $smarty->assign('topgetAllianceID', $alli);
     $smarty->assign('topgetPilotID', $char);
     $smarty->assign('topgetShipID', $ship);
     $smarty->assign('topgetWeaponID', $weap);
     $smarty->assign('topgetCorpIcon', $corpIcon);
     $smarty->assign('topgetAllianceIcon', $alliIcon);
     $smarty->assign('topgetPilotIcon', $charIcon);
     $smarty->assign('topgetShipIcon', $shipIcon);
     $smarty->assign('topgetWeaponIcon', $weapIcon);
     $smarty->assign('topgetCorpName', $corpName);
     $smarty->assign('topgetAllianceName', $alliName);
     $smarty->assign('topgetPilotName', $charName);
     $smarty->assign('topgetShipName', $shipName);
     $smarty->assign('topgetCorpURL', $corpURL);
     $smarty->assign('topgetAllianceURL', $alliURL);
     $smarty->assign('topgetPilotURL', $charURL);
     $smarty->assign('topgetShipURL', $shipURL);
     $smarty->assign('topgetWeaponURL', $weapURL);
     $fplt = new Pilot($fchar);
     $fcharIcon = $fplt->getPortraitURL(64);
     $fcharName = $fplt->getName();
     $fcharURL = edkURI::page('pilot_detail', $fchar, 'plt_id');
     $fclt = new Corporation($fcorp, false);
     $fcorpIcon = $fclt->getPortraitURL(32);
     $fcorpName = $fclt->getName();
     $fcorpURL = edkURI::page('corp_detail', $fcorp, 'crp_id');
     $falt = new Alliance($falli, false);
     $falliIcon = $falt->getPortraitURL(32);
     $falliName = $falt->getName();
     $falliURL = edkURI::page('alliance_detail', $fcorp, 'all_id');
     $fslt = new Ship($fship);
     $fshipIcon = $fslt->getImage(32);
     $fshipName = $fslt->getName();
     $fshipURL = edkURI::page('invtype', $fship, 'id');
     $filt = new Item($fweap);
     $fweapIcon = $filt->getIcon(32);
     $fweapURL = edkURI::page('invtype', $fweap, 'id');
     $smarty->assign('fingetCorpID', $fcorp);
     $smarty->assign('fingetAllianceID', $falli);
     $smarty->assign('fingetPilotID', $fchar);
     $smarty->assign('fingetShipID', $fship);
     $smarty->assign('fingetWeaponID', $fweap);
     $smarty->assign('fingetCorpIcon', $fcorpIcon);
     $smarty->assign('fingetAllianceIcon', $falliIcon);
     $smarty->assign('fingetPilotIcon', $fcharIcon);
     $smarty->assign('fingetShipIcon', $fshipIcon);
     $smarty->assign('fingetWeaponIcon', $fweapIcon);
     $smarty->assign('fingetCorpName', $fcorpName);
     $smarty->assign('fingetAllianceName', $falliName);
     $smarty->assign('fingetPilotName', $fcharName);
     $smarty->assign('fingetShipName', $fshipName);
     $smarty->assign('fingetCorpURL', $fcorpURL);
     $smarty->assign('fingetAllianceURL', $falliURL);
     $smarty->assign('fingetPilotURL', $fcharURL);
     $smarty->assign('fingetShipURL', $fshipURL);
     $smarty->assign('fingetWeaponURL', $fweapURL);
     //echo self::$extid."<br />";
     //echo "-> ".edkURI::page('pilot_detail', $km->getVictimID(), 'plt_id');
     $plt = new Pilot($km->getVictimID());
     $victimPortrait = $plt->getPortraitURL(64);
     $victimURL = edkURI::page('pilot_detail', $km->getVictimID(), 'plt_id');
     $victimExtID = $plt->getExternalID();
     $victimCorpURL = edkURI::page('corp_detail', $km->getVictimCorpID(), 'crp_id');
     $victimCorpName = $km->getVictimCorpName();
     $victimAllianceURL = edkURI::page('alliance_detail', $km->getVictimAllianceID(), 'all_id');
     $victimAllianceName = $km->getVictimAllianceName();
     $victimDamageTaken = $km->getDamageTaken();
     $getISKLoss = number_format($km->getISKLoss());
     $smarty->assign('victimDamageTaken', $victimDamageTaken);
     $corp = new Corporation($km->getVictimCorpID(), false);
     //echo $corp->getPortraitURL(32);
     $alliance = new Alliance($km->getVictimAllianceID(), false);
     //echo $alliance->getPortraitURL(32);
     if ($km->isClassified()) {
         //Admin is able to see classified Systems
         if ($home->page->isAdmin()) {
             $system = $km->getSystem()->getName() . ' (Classified)';
             $region = $km->getSystem()->getRegionName();
             $systemURL = edkURI::page('system_detail', $km->getSystem()->getID(), 'sys_id');
             $systemSecurity = $km->getSystem()->getSecurity(true);
         } else {
             $system = 'Classified';
             $region = $km->getSystem()->getRegionName();
             $systemURL = "";
             $systemSecurity = '0.0';
         }
     } else {
         $system = $km->getSystem()->getName();
         $region = $km->getSystem()->getRegionName();
         $systemURL = edkURI::page('system_detail', $km->getSystem()->getID(), 'sys_id');
         $systemSecurity = $km->getSystem()->getSecurity(true);
     }
     // Ship detail
     $ship = $km->getVictimShip();
     $shipclass = $ship->getClass();
     $shipname = $ship->getName();
     $victimShipClassName = $shipclass->getName();
     $timeStamp = $km->getTimeStamp();
     $victimShipID = edkURI::page('invtype', $ship->getExternalID(), 'id');
     if ($home->page->isAdmin()) {
         $smarty->assign('ship', $ship);
     }
     self::$shipStats->setPilotName($km->getVictimName());
     self::$shipStats->setPilotCorp($victimCorpName);
     self::$shipStats->setPilotAlliance($victimAllianceName);
     self::$shipStats->setPilotShip($shipname);
     self::$shipStats->setPilotLoc($system);
     self::$shipStats->setPilotLocReg($region);
     self::$shipStats->setPilotLocSec($systemSecurity);
     self::$shipStats->setPilotDate($timeStamp);
     self::$shipStats->setPilotDam($victimDamageTaken);
     self::$shipStats->setPilotCos($getISKLoss);
     self::$shipStats->setPilotShipClass($victimShipClassName);
     self::$shipStats->setCorpPort($corp->getPortraitURL(32));
     self::$shipStats->setAlliPort($alliance->getPortraitURL(32));
     self::$shipStats->setPilotPort($victimPortrait);
     self::$shipStats->setPilotNameURL($victimURL);
     self::$shipStats->setPilotCorpURL($victimCorpURL);
     self::$shipStats->setPilotAllianceURL($victimAllianceURL);
     self::$shipStats->setPilotShipURL($victimShipID);
     self::$shipStats->setPilotLocURL($systemURL);
     fittingTools::getShipStats($shipname);
     fittingTools::moduleInfo($theFit);
     /*fittingTools::getModuleStats();*/
     fittingTools::returnShipSkills();
     fittingTools::shipEffects();
     fittingTools::setlevel5Skills();
     fittingTools::getExtraStats();
     fittingTools::getCPUandPowerValues();
     $html = fittingTools::displayShipStats($shipname, 100, 100);
     return $html;
 }