$extra['location'] = @$killdata['info']['location']['itemName']; $extra['totalisk'] = $killdata['info']['zkb']['totalValue']; $extra['droppedisk'] = droppedIsk(md5($id), $killdata['items']); $extra['shipprice'] = Price::getItemPrice($killdata['victim']['shipTypeID'], date('Ymd', strtotime($killdata['info']['dttm']))); $extra['lostisk'] = $extra['shipprice'] + destroyedIsk(md5($id), $killdata['items']); $extra['fittedisk'] = fittedIsk(md5($id), $killdata['items']); $extra['relatedtime'] = date('YmdH00', strtotime($killdata['info']['dttm'])); $extra['fittingwheel'] = Detail::eftarray(md5($id), $killdata['items'], @$killdata['victim']['characterID']); $extra['involvedships'] = involvedships($killdata['involved']); $extra['involvedshipscount'] = count($extra['involvedships']); $extra['totalprice'] = usdeurgbp($killdata['info']['zkb']['totalValue']); $extra['destroyedprice'] = usdeurgbp($extra['lostisk']); $extra['droppedprice'] = usdeurgbp($extra['droppedisk']); $extra['fittedprice'] = usdeurgbp($extra['fittedisk']); $extra['efttext'] = Fitting::EFT($extra['fittingwheel']); $extra['dnatext'] = Fitting::DNA($killdata['items'], $killdata['victim']['shipTypeID']); $extra['edkrawmail'] = 'deprecated - use CREST'; $extra['zkbrawmail'] = 'deprecated - use CREST'; $extra['slotCounts'] = Info::getSlotCounts($killdata['victim']['shipTypeID']); $extra['commentID'] = $id; $extra['crest'] = $mdb->findDoc('crestmails', ['killID' => $id, 'processed' => true]); $extra['prevKillID'] = $mdb->findField('killmails', 'killID', ['cacheTime' => 300, 'killID' => ['$lt' => $id]], ['killID' => -1]); $extra['nextKillID'] = $mdb->findField('killmails', 'killID', ['cacheTime' => 300, 'killID' => ['$gt' => $id]], ['killID' => 1]); $extra['warInfo'] = War::getKillIDWarInfo($id); //$extra["insertTime"] = Db::queryField("select insertTime from zz_killmails where killID = :killID", "insertTime", array(":killID" => $id), 300); $systemID = $killdata['info']['system']['solarSystemID']; $data = Info::getWormholeSystemInfo($systemID); $extra['wormhole'] = $data; $url = 'https://' . $_SERVER['SERVER_NAME'] . "/detail/{$id}/"; if ($killdata['victim']['groupID'] == 29) { $query = ['$and' => [['involved.characterID' => (int) $killdata['victim']['characterID']], ['killID' => ['$gte' => $id - 200]], ['killID' => ['$lt' => $id]], ['vGroupID' => ['$ne' => 29]]]];
$extra["cmtChars"] = Api::getCharacters($userID); $extra["cmtChars"][] = array("characterID" => 0, "characterName" => "Anonymous"); } $extra["droppedisk"] = droppedIsk(md5($id), $killdata["items"]); $extra["lostisk"] = $killdata["info"]["total_price"] - $extra["droppedisk"]; $extra["fittedisk"] = fittedIsk(md5($id), $killdata["items"]); $extra["relatedtime"] = date("YmdH00", strtotime($killdata["info"]["killTime"])); $extra["fittingwheel"] = eftarray(md5($id), $killdata["items"], $killdata["victim"]["characterID"]); $extra["involvedships"] = involvedships($killdata["involved"]); $extra["involvedshipscount"] = count($extra["involvedships"]); $extra["totalprice"] = usdeurgbp($killdata["info"]["total_price"]); $extra["destroyedprice"] = usdeurgbp($extra["lostisk"]); $extra["droppedprice"] = usdeurgbp($extra["droppedisk"]); $extra["fittedprice"] = usdeurgbp($extra["fittedisk"]); $extra["efttext"] = Fitting::EFT($extra["fittingwheel"]); $extra["dnatext"] = Fitting::DNA($killdata["items"], $killdata["info"]["shipTypeID"]); $extra["edkrawmail"] = Kills::getRawMail($id); $extra["zkbrawmail"] = Kills::getRawMail($id, array(), false); $extra["reports"] = Db::queryField("SELECT count(*) as cnt FROM zz_tickets WHERE killID = :killid", "cnt", array(":killid" => $id), 0); $extra["slotCounts"] = Info::getSlotCounts($killdata["victim"]["shipTypeID"]); $extra["commentID"] = Info::commentID($id); $extra["crest"] = Db::queryRow("select killID, hash from zz_crest_killmail where killID = :killID and processed = 1", array(":killID" => $id), 300); $systemID = $killdata["info"]["solarSystemID"]; $data = Info::getWormholeSystemInfo($systemID); $extra["wormhole"] = $data; $url = "https://" . $_SERVER["SERVER_NAME"] . "/detail/{$id}/"; $app->render("detail.html", array("pageview" => $pageview, "killdata" => $killdata, "extra" => $extra, "message" => $message, "flags" => Info::$effectToSlot, "topDamage" => $topDamage, "finalBlow" => $finalBlow, "url" => $url)); function involvedships($array) { $involved = array(); foreach ($array as $inv) {
* (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ //make sure the requester is not being a naughty boy Util::scrapeCheck(); //set the headers to cache the request properly $dna = array(); $parameters = Util::convertUriToParameters(); $page = 1; if (isset($parameters["page"])) { $page = $parameters["page"]; } $kills = Feed::getKills(array("limit" => 200, "cacheTime" => 3600, "page" => $page)); foreach ($kills as $kill) { $kill = json_decode($kill, true); $killdata = Kills::getKillDetails($kill["killID"]); $dna[][] = array("killtime" => $killdata["info"]["dttm"], "SolarSystemName" => $killdata["info"]["solarSystemName"], "solarSystemID" => $killdata["info"]["solarSystemID"], "regionID" => $killdata["info"]["regionID"], "regionName" => $killdata["info"]["regionName"], "victimCharacterID" => isset($killdata["victim"]["characterID"]) ? isset($killdata["victim"]["characterID"]) : null, "victimCharacterName" => isset($killdata["victim"]["characterName"]) ? isset($killdata["victim"]["characterName"]) : null, "victimCorporationID" => isset($killdata["victim"]["corporationID"]) ? isset($killdata["victim"]["corporationID"]) : null, "victimCorporationName" => isset($killdata["victim"]["corporationName"]) ? isset($killdata["victim"]["corporationName"]) : null, "victimAllianceID" => isset($killdata["victim"]["allianceID"]) ? isset($killdata["victim"]["allianceID"]) : null, "victimAllianceName" => isset($killdata["victim"]["allianceName"]) ? isset($killdata["victim"]["allianceName"]) : null, "victimFactionID" => isset($killdata["victim"]["factionID"]) ? isset($killdata["victim"]["factionID"]) : null, "victimFactionName" => isset($killdata["victim"]["factionName"]) ? isset($killdata["victim"]["factionName"]) : null, "dna" => Fitting::DNA($killdata["items"], $killdata["victim"]["shipTypeID"])); } $app->etag(md5(serialize($dna))); $app->expires("+1 hour"); header("Access-Control-Allow-Origin: *"); header("Access-Control-Allow-Methods: GET"); $app->contentType("application/json; charset=utf-8"); echo json_encode($dna, JSON_NUMERIC_CHECK);
<?php //set the headers to cache the request properly $dna = array(); $parameters = Util::convertUriToParameters(); $page = 1; if (isset($parameters['page'])) { $page = $parameters['page']; } $kills = Feed::getKills(array('limit' => 200, 'cacheTime' => 3600, 'page' => $page)); foreach ($kills as $kill) { $kill = json_decode($kill, true); $killdata = Kills::getKillDetails($kill['killID']); $dna[][] = array('killtime' => $killdata['info']['dttm'], 'SolarSystemName' => $killdata['info']['solarSystemName'], 'solarSystemID' => $killdata['info']['solarSystemID'], 'regionID' => $killdata['info']['regionID'], 'regionName' => $killdata['info']['regionName'], 'victimCharacterID' => isset($killdata['victim']['characterID']) ? isset($killdata['victim']['characterID']) : null, 'victimCharacterName' => isset($killdata['victim']['characterName']) ? isset($killdata['victim']['characterName']) : null, 'victimCorporationID' => isset($killdata['victim']['corporationID']) ? isset($killdata['victim']['corporationID']) : null, 'victimCorporationName' => isset($killdata['victim']['corporationName']) ? isset($killdata['victim']['corporationName']) : null, 'victimAllianceID' => isset($killdata['victim']['allianceID']) ? isset($killdata['victim']['allianceID']) : null, 'victimAllianceName' => isset($killdata['victim']['allianceName']) ? isset($killdata['victim']['allianceName']) : null, 'victimFactionID' => isset($killdata['victim']['factionID']) ? isset($killdata['victim']['factionID']) : null, 'victimFactionName' => isset($killdata['victim']['factionName']) ? isset($killdata['victim']['factionName']) : null, 'dna' => Fitting::DNA($killdata['items'], $killdata['victim']['shipTypeID'])); } $app->etag(md5(serialize($dna))); $app->expires('+1 hour'); header('Access-Control-Allow-Origin: *'); header('Access-Control-Allow-Methods: GET'); $app->contentType('application/json; charset=utf-8'); echo json_encode($dna, JSON_NUMERIC_CHECK);