# get the last 50 final blows # $fbids = $ft->dbh->_select_column('SELECT killid FROM tbl:summary WHERE k_pilotid = ? AND type = "kill" ' . # 'ORDER BY killtime DESC LIMIT 10', array($pilotid)); # $fbs = load_kills_by_id($fbids); # us killing them $kids = $ft->dbh->_select_column('SELECT DISTINCT s.killid FROM tbl:killers k, tbl:summary s WHERE k.corpid = ? ' . 'AND s.killid = k.killid AND s.type = "kill" ' . 'ORDER BY s.killtime DESC LIMIT 10', array($corpid)); $ks = load_kills_by_id($kids); # us losing to them $lids = $ft->dbh->_select_column('SELECT DISTINCT killid FROM tbl:summary WHERE v_corpid = ? AND type = "loss" ' . 'ORDER BY killtime DESC LIMIT 10', array($corpid)); $ls = load_kills_by_id($lids); # them killing us (FOR THEIR SIDE) $xkids = $ft->dbh->_select_column('SELECT DISTINCT killid FROM tbl:summary WHERE k_corpid = ? AND type = "loss" ' . 'ORDER BY killtime DESC LIMIT 10', array($corpid)); $xks = load_kills_by_id($xkids); # us killing them (FOR THEIR SIDE) $xlids = $ft->dbh->_select_column('SELECT DISTINCT s.killid FROM tbl:killers k, tbl:summary s WHERE k_corpid = ? ' . 'AND s.killid = k.killid AND s.type = "kill" ' . 'ORDER BY s.killtime DESC LIMIT 10', array($corpid)); $xls = load_kills_by_id($xlids); # now, let's build this up, give them the information $ft->assign('iter', array('week', 'month', 'year', 'ever')); $ft->assign('headers', array('finalblows' => 'Final Blows', 'solokills' => 'Solo Kills', 'killgive' => 'Participations', 'lossrecv' => 'Ships Lost', '1' => '', 'murdergive' => 'People Murdered', 'murderrecv' => 'Times Murdered', '2' => '', 'bountypoints' => 'Bounty Taken', 'iskdestroyed' => 'ISK Destroyed', 'isklost' => 'ISK Lost')); $ft->assign('corp', $corp); $ft->assign('corpid', $corpid); $ft->assign('stats', $stats); $ft->assign('killids2', $kids); $ft->assign('kills2', $ks); $ft->assign('lossids', $lids); $ft->assign('losses', $ls); $ft->assign('xkillids', $xkids); $ft->assign('xkills', $xks); $ft->assign('xlossids', $xlids); $ft->assign('xlosses', $xls); $ft->assign('finalblowids', $fbids);
$colx = "{$col} = ? AND "; array_push($bind, $id); } # okay, can do by id/col $extra = ""; if ($which == 'finalblows') { $extra = " AND finalblow = 1"; } # do the select array_push($bind, $startdate, $enddate, $type); $data = $ft->dbh->_select_column("SELECT DISTINCT k.killid FROM tbl:killers k, tbl:summary s " . "WHERE {$colx} " . " s.killtime >= UNIX_TIMESTAMP(?) " . " AND s.killtime <= UNIX_TIMESTAMP(?) " . " AND s.killid = k.killid " . " AND s.type = ? " . " {$extra} " . "ORDER BY s.killtime DESC " . "LIMIT {$limit}", $bind); if (count($data) == $limit) { $ft->assign('error', 'The maximum of 300 kills was reached and we had to abort. Sorry!'); } # good, now we have the right rows in our data set, load the kills $kills = load_kills_by_id($data); # if they want a bounty list, we have to do further consolidation if ($output == 'kills') { # simple, then we're done $ft->assign('killids', $data); $ft->assign('kills', $kills); $ft->makepage('search'); return; } # now we have to pull together bounty information $bounties = array(); # id -> bountyamt total $earliest = array(); $latest = array(); $finals = array(); $parts = array();
<?php include 'lib/fortissimo.php'; $killid = $_GET['killid']; if (is_null($killid) || !is_numeric($killid) || $killid <= 0) { return $ft->errorpage('Sorry, it seems you got to this page in an invalid way. Please try again.'); } # if it's raw, fix it if ($_GET['raw']) { $mailid = $killid; $killid = $ft->dbh->_select_one('SELECT killid FROM tbl:summary WHERE mailid = ?', array($mailid)); } # now load the kill $kills = load_kills_by_id(array($killid)); $kill = $kills[$killid]; # now dump it if we're raw if ($_GET['raw']) { if ($kill && hide_location($kill)) { $mail = "Sorry, this mail is secured due to war mode. Please try again later."; } else { $mail = $ft->dbh->_select_one('SELECT mail FROM tbl:rawmail WHERE mailid = ?', array($mailid)); } echo "<html><body><pre>{$mail}</pre></body></html>"; exit; } # if admin, get more information if ($remote && $remote->manager()) { $info = $ft->dbh->_select_row_as_object('SELECT pilotid, FROM_UNIXTIME(submittime) AS "date", submitip ' . 'FROM tbl:rawmail WHERE mailid = ?', array($kill->raw_id)); $ft->assign('submitip', $info->submitip); $ft->assign('submittime', $info->date); $ft->assign('submitpilot', new Party($info->pilotid));
if ($which == 'kill') { $ft->message('Last 50 Kills'); $ft->title('Last 50 Kills'); # also show the finalblows/lossrecv by group $groups = $ft->dbh->_select_rows_as_objects('SELECT var1, killrecv, lossrecv FROM tbl:stats ' . 'WHERE type = "group" AND dtype = "week" AND var2 = ?', array(this_week())); $gout = array(); if ($groups) { foreach ($groups as $grow) { $name = get_group_name($grow->var1); if ($name) { $gout[$name] = array($grow->killrecv, $grow->lossrecv, $grow->var1); } } } } elseif ($which == 'loss') { $ft->message('Last 50 Losses'); $ft->title('Last 50 Losses'); } else { $which = 'murder'; $ft->message('Last 50 Murders'); $ft->title('Last 50 Murders'); } $ids = $ft->dbh->_select_column('SELECT killid FROM tbl:summary WHERE type = ? ORDER BY killtime DESC LIMIT 50', array($which)); # now prepare the page $kills = load_kills_by_id($ids); $ft->assign('summary', $gout); $ft->assign('classes', array('Battlecruiser', 'Destroyer', 'Elite Frigate', 'Industrial', 'Battleship', 'Dreadnought', 'Elite Industrial', 'Mining Barge', 'Capsule', 'Elite Battlecruiser', 'Elite Mining Barge', 'Mothership', 'Carrier', 'Elite Cruiser', 'Freighter', 'Rookie Ship', 'Cruiser', 'Elite Destroyer', 'Frigate', 'Shuttle')); $ft->assign('kills', $kills); $ft->assign('killids', $ids); # dump the page $ft->makepage('index');
array_push($args, "pilotid={$pilotid}"); array_push($message, "involving pilot <strong>" . get_pilot_name($pilotid) . "</strong>"); } # reassign the args $a = implode('&', $args); $ft->assign('args', $a); # and criteria messaging $m = implode(' and ', $message); # show the last 50 somethings $ft->message('Recent activity ' . $m . '.'); $ft->title('Recent Activity'); # now do the select $crit = implode(' AND ', $criteria); # now prepare the page $ids = $ft->dbh->_select_column("SELECT killid FROM tbl:summary WHERE {$crit} AND type = 'kill' ORDER BY killtime DESC LIMIT 25", $bind); $kills = load_kills_by_id($ids, 0, 0); $ft->assign('kills', $kills); $ft->assign('killids', $ids); # now prepare the page $ids = $ft->dbh->_select_column("SELECT killid FROM tbl:summary WHERE {$crit} AND type = 'loss' ORDER BY killtime DESC LIMIT 25", $bind); $kills = load_kills_by_id($ids, 0, 0); $ft->assign('lkills', $kills); $ft->assign('lkillids', $ids); # now prepare the page $ids = $ft->dbh->_select_column("SELECT killid FROM tbl:summary WHERE {$crit} AND type = 'murder' ORDER BY killtime DESC LIMIT 25", $bind); $kills = load_kills_by_id($ids, 0, 0); $ft->assign('mkills', $kills); $ft->assign('mkillids', $ids); # dump the page $ft->title('Celestial Horizon Killboard'); $ft->makepage('show');