Ejemplo n.º 1
0
 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'));
 }
Ejemplo n.º 2
0
        $plt_id = edkURI::getArg('id');
        if (!$plt_id) {
            errorPic('No pilot id specified.');
            $pilot = new Pilot();
        } else {
            if ($plt_id < 1000000) {
                $pilot = Cacheable::factory('Pilot', $plt_id);
            } else {
                $pilot = new Pilot(0, $plt_id);
                $plt_id = $pilot->getID();
            }
        }
    }
}
if (!$plt_ext_id) {
    $plt_ext_id = $pilot->getExternalID();
}
// If we still don't have an external ID then just use the internal for names.
if (!$plt_ext_id) {
    $plt_ext_id = $plt_id;
}
if (!$pilot->exists()) {
    errorPic('That pilot doesnt exist.');
}
$corp = $pilot->getCorp();
$alliance = $corp->getAlliance();
// we dont generate pictures for non-members
if (array_search($alliance->getID(), config::get('cfg_allianceid')) === false && !array_search($corp->getID(), config::get('cfg_corpid')) === false && !array_search($pilot->getID(), config::get('cfg_pilotid')) === false) {
    errorPic('Invalid pilot');
}
$id = abs(crc32($sig_name));
Ejemplo n.º 3
0
 /**
  * Set the type and ID of the feed to retrieve.
  * @param string $type pilot/corp/alliance.
  * @param integer $id
  * @return boolean false on failure.
  */
 function setID($type = '', $id = 0)
 {
     //Check id is int.
     $id = (int) $id;
     //Set to board owner.
     if ($type == '') {
         if (config::get('cfg_allianceid')) {
             $alls = array();
             foreach (config::get('cfg_allianceid') as $val) {
                 $all = new Alliance($val);
                 if (!$all->getExternalID()) {
                     return false;
                 }
                 $alls[] = $all->getExternalID();
             }
             $this->options['alliance'] = implode(',', $alls);
         }
         if (config::get('cfg_corpid')) {
             $crps = array();
             foreach (config::get('cfg_corpid') as $val) {
                 $crp = new Corporation($val);
                 if (!$crp->getExternalID()) {
                     return false;
                 }
                 $crps[] = $crp->getExternalID();
             }
             $this->options['corp'] = implode(',', $crps);
         }
         if (config::get('cfg_pilotid')) {
             $pilots = array();
             foreach (config::get('cfg_pilotid') as $val) {
                 $pilot = new Pilot($val);
                 if (!$pilot->getExternalID()) {
                     return false;
                 }
                 $pilots[] = $pilot->getExternalID();
             }
             $this->options['pilot'] = implode(',', $pilots);
         }
         return true;
     } else {
         if ($id > 0) {
             if ($type == 'alliance') {
                 $this->options['alliance'] = $id;
             } else {
                 if ($type == 'corporation') {
                     $this->options['corp'] = $id;
                 } else {
                     if ($type == 'pilot') {
                         $this->options['pilot'] = $id;
                     } else {
                         return false;
                     }
                 }
             }
             return true;
         }
     }
     return false;
 }
Ejemplo n.º 4
0
 function thumbInt($int_id, $size, $type)
 {
     $this->size = $size;
     switch ($this->type) {
         case 'pilot':
         case '':
             $pilot = new Pilot($int_id);
             $this->id = $pilot->getExternalID();
             if ($this->id) {
                 $url = imageURL::getURL('Pilot', $this->id, $size);
                 header(html_entity_decode("Location: {$url}"));
                 die;
             }
             $this->type = 'pilot';
             $this->encoding = 'jpeg';
             $this->validate();
             break;
         case 'corp':
         case 'npc':
             $this->type = 'corp';
             $corp = new Corporation($int_id);
             if (!$corp->getExternalID()) {
                 $this->id = 0;
             }
             $this->id = $corp->getExternalID();
             if ($this->id) {
                 $url = imageURL::getURL('Corporation', $this->id, $size);
                 header("Location: {$url}");
                 die;
             }
             $this->encoding = 'png';
             if ($this->type == 'npc') {
                 $this->type = 'npc';
                 //$this->encoding = 'png';
             }
             $this->validate();
             break;
         default:
             $this->id = $str_id;
             $this->type = $type;
             $this->encoding = 'jpeg';
             $this->validate();
     }
 }
Ejemplo n.º 5
0
 /**
  * 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'));
 }
Ejemplo n.º 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;
 }