function generate() { global $smarty; $this->toplist->generate(); $i = 1; $rows = array(); while ($row = $this->toplist->getRow()) { $pilot = Pilot::getByID($row['plt_id']); $uri = edkURI::build(array('a', 'kill_detail', true), array('kll_id', $row['kll_id'], true)); if ($row['plt_externalid']) { $img = imageURL::getURL('Pilot', $row['plt_externalid'], 32); } else { $img = $pilot->getPortraitURL(32); } $ship = Ship::getByID($row['ship']); $shipUri = edkURI::build(array('a', 'invtype', true), array('id', $row['ship'], true)); if ((int) number_format($row["isk"], 0, "", "") > 1000000000) { $isk = number_format($row["isk"] / 1000000000, 2, ".", "") . " b"; } elseif ((int) number_format($row["isk"], 0, "", "") > 1000000) { $isk = number_format($row["isk"] / 1000000, 2, ".", "") . " M"; } else { $isk = number_format($row["isk"], 0, ".", ","); } $rows[] = array('rank' => $i, 'name' => $pilot->getName(), 'uri' => $uri, 'portrait' => $img, 'shipImage' => $ship->getImage(32), 'shipName' => $ship->getName(), 'shipId' => $row['ship'], 'shipURI' => $shipUri, 'isk' => $isk); $i++; } $smarty->assign('tl_name', 'Pilot'); $smarty->assign('tl_type', $this->entity_); $smarty->assignByRef('tl_rows', $rows); return $smarty->fetch(getcwd() . '/mods/most_expensive_toplist/templates/toplisttable_expensive.tpl'); }
function generate() { global $smarty; if (!$this->split_ || $this->max_ / $this->split_ <= 1) { return; } $endpage = ceil($this->max_ / $this->split_); $args = edkURI::parseURI(); if ($page = edkURI::getArg('page')) { if (edkURI::getArg('page')) { foreach ($args as $key => $value) { if ($value[0] == 'page') { unset($args[$key]); break; } } } } else { $page = 1; } $url = edkURI::build($args); if (strpos($url, '?') === false) { $url .= "?"; } else { $url .= "&"; } $smarty->assign('splitter_endpage', $endpage); $smarty->assign('splitter_page', $page); $smarty->assign('splitter_url', $url); return $smarty->fetch(get_tpl('pagesplitter')); }
/** * Add a menu item to the corp detail page. * @param pCorpDetail $home */ public static function addMenu($home) { $args = array(); $args[] = array('a', 'corp_detail', true); $args[] = array('crp_id', $home->crp_id, true); $args[] = array('view', "known_members", true); $home->addMenuItem("link", "Known Members", edkURI::build($args)); }
function generate() { global $smarty; $this->toplist->generate(); while ($row = $this->toplist->getRow()) { $item = new Item($row['itm_id']); $rows[] = array('rank' => false, 'name' => $item->getName(), 'uri' => edkURI::build(array('a', 'invtype', true), array('id', $item->getID(), true)), 'icon' => $item->getIcon(32), 'count' => $row['cnt']); } $smarty->assign('tl_name', Language::get('weapon')); $smarty->assign('tl_type', Language::get('kills')); $smarty->assignByRef('tl_rows', $rows); return $smarty->fetch(get_tpl('toplisttable')); }
/** * 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')); }
function generate() { global $smarty; $this->toplist->generate(); $i = 1; $rows = array(); while ($row = $this->toplist->getRow()) { $pilot = Pilot::getByID($row['plt_id']); if ($row['plt_externalid']) { $uri = edkURI::build(array('a', 'pilot_detail', true), array('plt_ext_id', $row['plt_externalid'], true)); $img = imageURL::getURL('Pilot', $row['plt_externalid'], 32); } else { $uri = edkURI::build(array('a', 'pilot_detail', true), array('plt_id', $row['plt_id'], true)); $img = $pilot->getPortraitURL(32); } $rows[] = array('rank' => $i, 'name' => $pilot->getName(), 'uri' => $uri, 'portrait' => $img, 'count' => $row['cnt']); $i++; } $smarty->assign('tl_name', 'Pilot'); $smarty->assign('tl_type', $this->entity_); $smarty->assignByRef('tl_rows', $rows); return $smarty->fetch(get_tpl('toplisttable')); }
function getTableStats() { // Don't use caching to save memory. These queries are once only. $qry = new DBQuery(true); $this->metric_total = $this->contractlist_->getCount(); for ($i = 0; $i < $this->contractlist_->getCount(); $i++) { $contract = $this->contractlist_->getBattle($i); if (!($contract->getKillISK() + $contract->getLossISK() > config::get('fleet_battles_mod_minisk') * 1000000)) { $this->metric_total = $this->metric_total - 1; continue 1; } // generate all necessary objects within the contract $contract->execQuery(); for ($j = 0; $j < 2; $j++) { if ($j == 0) { $list =& $contract->llist_; } else { $list =& $contract->klist_; } $isk = $list->getISK(); if ($j == 0) { $ldata = array('losses' => $list->getCount(), 'lossisk' => $isk / 1000); $this->lss_isk_all_time += $isk; } else { $kdata = array('kills' => $list->getCount(), 'killisk' => $isk / 1000); $this->kll_isk_all_time += $isk; } } if ($kdata['killisk']) { $efficiency = round($kdata['killisk'] / ($kdata['killisk'] + $ldata['lossisk']) * 100, 2); } else { $efficiency = 0; } $bar = new BarGraph($efficiency, 100); if (!config::get('fleet_battles_mod_cache')) { $this->inv_all_time += $contract->getInvolved(); $this->kll_all_time += $contract->getKills(); $this->lss_all_time += $contract->getLosses(); } $battle = array_merge(array('name' => $contract->getName(), 'startdate' => $contract->getStartDate(), 'enddate' => $contract->getEndDate(), 'bar' => $bar->generate(), 'endtime' => date('H:i:s', strtotime($contract->getEndDate())), 'efficiency' => $efficiency, 'involved' => $contract->getInvolved(), 'kll_id' => $contract->getKillID(), 'id' => $contract->getID(), 'numberOfOwnersInvolved' => $contract->getNumberOfOwnersInvolved(), 'ownerPilotIds' => $contract->getOwnersInvolved()), $kdata, $ldata); if (config::get('fleet_battles_mod_cache')) { $this->cacheBattle($battle); } else { $tbldata[] = $battle; } } if (config::get('fleet_battles_mod_cache')) { $cacheq = DBFactory::getDBQuery(); $whereSql = ""; if ($this->isFiltered) { $filterTerms = $this->getFilterArgumentsWhereSql(); // build filter-string if (!empty($filterTerms)) { $whereSql = "WHERE " . implode(" AND ", $filterTerms); } } $sql = "SELECT * \n FROM kb3_battles_cache bc\n INNER JOIN kb3_systems sys ON sys.sys_name = bc.system\n INNER JOIN kb3_constellations con ON con.con_id = sys.sys_con_id\n INNER JOIN kb3_regions reg ON reg.reg_id = con.con_reg_id\n {$whereSql} \n ORDER BY end DESC"; $cacheq->execute($sql); while ($cb = $cacheq->getRow()) { $args = array(); $args[] = array('a', 'kill_related', true); $tbldata[] = array('name' => $cb['system'], 'kll_id' => $cb['kll_id'], 'id' => $cb['battle_id'], 'enddate' => $cb['end'], 'startdate' => $cb['start'], 'endtime' => date('H:i:s', strtotime($cb['end'])), 'kills' => $cb['kills'], 'losses' => $cb['losses'], 'efficiency' => $cb['efficiency'], 'involved' => $cb['involved'], 'killisk' => $cb['killisk'], 'lossisk' => $cb['lossisk'], 'bar' => $cb['bar'], 'numberOfOwnersInvolved' => $cb['ownersInvolved'], 'battle_url' => edkURI::build($args, array('kll_id', $cb['kll_id'], true), array('battle', true, true))); } } return $tbldata; }
$page->setAdmin(); $kll_id = (int) edkURI::getArg('kll_id', 1); $page->setTitle('Administration - Deletion of Kill ID "' . $kll_id . '"'); if (isset($_GET['confirm'])) { $kill = Kill::getByID($kll_id); $kill->remove(true, false); $html .= "Kill ID \"" . $kll_id . "\" deleted!"; $html .= "<br><br><a href=\"javascript:window.close();\">[close]</a>"; } else { if (isset($_GET['permanent'])) { $kill = Kill::getByID($kll_id); $kill->remove(true, true); $html .= "Kill ID \"" . $kll_id . "\" deleted!"; $html .= "<br><br><a href=\"javascript:window.close();\">[close]</a>"; } else { $cargs = array(); $cargs[] = array("a", "admin_kill_delete", true); $cargs[] = array("kll_id", $kll_id, true); $pargs = $cargs; $cargs[] = array("confirm", "yes", false); $pargs[] = array("permanent", "yes", false); $html .= "Delete Kill ID \"" . $kll_id . "\": "; $html .= "<button onClick=\"window.location.href='" . edkURI::build($cargs) . "'\">Yes</button><br />"; $html .= "Delete and prevent reposting: "; $html .= "<button onClick=\"window.location.href='" . edkURI::build($pargs) . "'\">Yes</button><br />"; $html .= "Abort deletion and return: "; $html .= "<button onClick=\"window.close();\">No</button>"; } } $page->setContent($html); $page->generate();
/** * Generates the menu for the user * @return string */ public static function menu() { $box = new Box('User'); $box->setIcon('menu-item.gif'); if (!user::loggedin()) { $box->addOption('link', 'Login', edkURI::build(array('a', 'login', true))); $box->addOption('link', 'Register', edkURI::build(array('a', 'register', true))); } else { if (user::get('usr_pilot_id')) { $plt = Pilot::getByID((int) user::get('usr_pilot_id')); $box->addOption('link', $plt->getName(), edkURI::build(array('a', 'pilot_detail', true), array('plt_id', $plt->getID(), true))); } $box->addOption('link', 'Logout', edkURI::build(array('a', 'logout', true))); } event::call('user_menu_create', $box); return $box->generate(); }
/** * Set up the menu. * * Prepare all the base menu options. */ function menuSetup() { $args = array(); $args[] = array('a', 'system_detail', true); $args[] = array('sys_id', $this->sys_id, true); $this->addMenuItem("caption", "Navigation"); $this->addMenuItem("link", "All kills", edkURI::build($args, array('view', 'kills', true))); $this->addMenuItem("link", "All losses", edkURI::build($args, array('view', 'losses', true))); $this->addMenuItem("link", "Recent Activity", edkURI::build($args, array('view', 'recent', true))); return ""; }
function menuSetup() { $this->addMenuItem("caption", "View"); $this->addMenuItem("link", "Killmail", edkURI::page('kill_mail', $this->kill->getID(), 'kll_id'), 0, 0, "sndReq('" . edkURI::page('kill_mail', $this->kill->getID(), 'kll_id') . "');ReverseContentDisplay('popup')"); if (config::get('kd_EFT')) { $this->addMenuItem("link", "EFT Fitting", edkURI::page('eft_fitting', $this->kill->getID(), 'kll_id'), 0, 0, "sndReq('" . edkURI::page('eft_fitting', $this->kill->getID(), 'kll_id') . "');ReverseContentDisplay('popup')"); $this->addMenuItem("link", "EvE Fitting", edkURI::page('eve_fitting', $this->kill->getID(), 'kll_id')); } if ($this->kill->relatedKillCount() > 1 || $this->kill->relatedLossCount() > 1 || (config::get('cfg_allianceid') || config::get('cfg_corpid') || config::get('cfg_pilotid')) && $this->kill->relatedKillCount() + $this->kill->relatedLossCount() > 1) { $this->addMenuItem("link", "Related kills (" . $this->kill->relatedKillCount() . "/" . $this->kill->relatedLossCount() . ")", edkURI::build(array('a', 'kill_related', true), array('kll_id', $this->kill->getID(), true))); } if (!IS_IGB) { $this->addMenuItem("link", "Ship DNA", "javascript:alert('You need to use the EVE In Game Browser to use this feature')"); } else { $this->addMenuItem("link", "Ship DNA", "javascript:CCPEVE.showFitting('" . $this->generateShipDNA() . "')"); } if ($this->page->isAdmin()) { $this->addMenuItem("caption", "Admin"); $this->addMenuItem("link", "Delete", edkURI::page('admin_kill_delete', $this->kill->getID(), 'kll_id'), 0, 0, "openWindow('" . edkURI::page('admin_kill_delete', $this->kill->getID(), 'kll_id') . "', null, 420, 300, '' );"); } return ""; }
/** * Set up the menu. * * Additional options that have been set are added to the menu. */ function menuSetup() { if ($this->month == 12) { $nmonth = 1; $nyear = $this->year + 1; } else { $nmonth = $this->month + 1; $nyear = $this->year; } if ($this->month == 1) { $pmonth = 12; $pyear = $this->year - 1; } else { $pmonth = $this->month - 1; $pyear = $this->year; } $this->addMenuItem("caption", "Navigation"); $this->addMenuItem("link", "Previous month ", edkURI::build(array('y', $pyear, true), array('m', $pmonth, true))); if (!($this->month == kbdate("m") - 1 && $this->year == kbdate("Y"))) { $this->addMenuItem("link", "Next month", edkURI::build(array('y', $nyear, true), array('m', $nmonth, true))); } }
/** * Set up the menu. * * Prepare all the base menu options. */ function menuSetup() { $this->addMenuItem('link', 'Active campaigns', edkURI::page('campaigns')); $this->addMenuItem('link', 'Past campaigns', edkURI::build(array('view', 'past', false))); return ""; }
function generate() { global $smarty; $prevdate = ""; $this->kill_list_->rewind(); $smarty->assign('daybreak', $this->daybreak_); $smarty->assign('comments_count', config::get('comments_count')); // evil hardcode-hack, don't do this at home kids ! ;) if (config::get('style_name') == 'revelations') { $smarty->assign('comment_white', '_white'); } $c = 0; $kdpage = array('a', 'kill_detail', true); $krpage = array('a', 'kill_related', true); $kills = array(); while ($kill = $this->kill_list_->getKill()) { if ($this->limit_ && $c >= $this->limit_) { break; } else { $c++; } $curdate = substr($kill->getTimeStamp(), 0, 10); if ($curdate != $prevdate) { if (count($kills) && $this->daybreak_) { $kl[] = array('kills' => $kills, 'date' => strtotime($prevdate)); $kills = array(); } $prevdate = $curdate; } $kll = array(); $kll['id'] = $kill->getID(); $kll['victimshipimage'] = $kill->getVictimShipImage(32); $kll['victimshipname'] = $kill->getVictimShipName(); $kll['victimshipclass'] = $kill->getVictimShipClassName(); $kll['victim'] = $kill->getVictimName(); $kll['victimiskloss'] = $kill->getISKLoss(); if ($kll['victimiskloss'] > 1000000000) { $kll['victimiskloss'] = sprintf("%.01fb", $kll['victimiskloss'] / 1000000000); } elseif ($kll['victimiskloss'] > 1000000) { $kll['victimiskloss'] = sprintf("%.01fm", $kll['victimiskloss'] / 1000000); } elseif ($kll['victimiskloss'] > 1000) { $kll['victimiskloss'] = sprintf("%.0fk", $kll['victimiskloss'] / 1000); } $kll['victimcorp'] = $kill->getVictimCorpName(); $kll['victimalliancename'] = $kill->getVictimAllianceName(); $kll['fb'] = $kill->getFBPilotName(); $kll['fbcorp'] = $kill->getFBCorpName(); if ($kill->isClassified() && !Session::isAdmin()) { if (config::get('killlist_regionnames')) { $kll['region'] = Language::get("classified"); } $kll['systemsecurity'] = "-"; $kll['system'] = Language::get("classified"); } else { if (config::get('killlist_regionnames')) { $kll['region'] = $kill->getSystem()->getRegionName(); } $kll['systemsecurity'] = $kill->getSolarSystemSecurity(); $kll['system'] = $kill->getSolarSystemName(); } $kll['victimid'] = $kill->getVictimID(); $kll['victimcorpid'] = $kill->getVictimCorpID(); $kll['victimallianceid'] = $kill->getVictimAllianceID(); $kll['victimshipid'] = $kill->getVictimShipExternalID(); $kll['fbid'] = $kill->getFBPilotID(); $kll['fbcorpid'] = $kill->getFBCorpID(); $kll['inv'] = 0; if (config::get('killlist_involved')) { $kll['inv'] = $kill->getInvolvedPartyCount(); } $kll['timestamp'] = $kill->getTimeStamp(); if (config::get('killlist_alogo')) { // Need to return yet another value from killlists. $all = new Alliance($kill->getVictimAllianceID()); if (strcasecmp($all->getName(), "None") != 0) { $kll['allianceexists'] = true; $kll['victimallianceicon'] = $all->getPortraitURL(32); } else { $kll['allianceexists'] = true; $crp = new Corporation($kill->getVictimCorpID()); $kll['victimallianceicon'] = $crp->getPortraitURL(32); } } if (isset($kill->_tag)) { $kll['tag'] = $kill->_tag; } $kll['fbplext'] = $kill->getFBPilotExternalID(); $kll['plext'] = $kill->getFBPilotExternalID(); if (config::get('comments_count')) { $kll['commentcount'] = $kill->countComment(); } $kll['loss'] = false; $kll['kill'] = false; if ($this->combined_) { if (config::get('cfg_allianceid') && in_array($kill->getVictimAllianceID(), config::get('cfg_allianceid'))) { $kll['loss'] = true; } else { if (config::get('cfg_corpid') && in_array($kill->getVictimCorpID(), config::get('cfg_corpid'))) { $kll['loss'] = true; } else { if (config::get('cfg_pilotid') && in_array($kill->getVictimID(), config::get('cfg_pilotid'))) { $kll['loss'] = true; } } } $kll['kill'] = !$kll['loss']; } $kll['urldetail'] = edkURI::build($kdpage, array('kll_id', $kll['id'], true)); if (!$kill->isClassified()) { $kll['urlrelated'] = edkURI::build($krpage, array('kll_id', $kll['id'], true)); } $kll['victimextid'] = $kill->getVictimExternalID(); $kll['urlvictim'] = edkURI::page('pilot_detail', $kll['victimextid'] ? $kll['victimextid'] : $kll['victimid'], $kll['victimextid'] ? 'plt_ext_id' : 'plt_id'); $kll['urlfb'] = edkURI::page('pilot_detail', $kll['fbplext'] ? $kll['fbplext'] : $kll['fbid'], $kll['fbplext'] ? 'plt_ext_id' : 'plt_id'); if ($kll['allianceexists']) { $kll['urlvictimall'] = edkURI::page('alliance_detail', $kll['victimallianceid'], 'all_id'); } $kll['urlvictimcorp'] = edkURI::page('corp_detail', $kll['victimcorpid'], 'crp_id'); $kll['urlfbcorp'] = edkURI::page('corp_detail', $kll['fbcorpid'], 'crp_id'); event::call('killlist_table_kill', $kll); $kills[] = $kll; } event::call('killlist_table_kills', $kills); if (count($kills)) { $kl[] = array('kills' => $kills, 'date' => strtotime($prevdate)); } $smarty->assignByRef('killlist', $kl); $smarty->assign('killlist_iskloss', config::get('killlist_iskloss')); return $smarty->fetch(getcwd() . "/mods/highlight_capitals/templates/killlisttable.tpl"); }
/** * Set up the menu. * * Prepare all the base menu options. */ function menuSetup() { $args = array(); if ($this->plt_external_id) { $args[] = array('plt_ext_id', $this->plt_external_id, true); } else { $args[] = array('plt_id', $this->plt_id, true); } $this->addMenuItem("caption", "Kills & losses"); $this->addMenuItem("link", "Recent activity", edkURI::build($args, array('view', 'recent', true))); $this->addMenuItem("link", "Historical activity", edkURI::build($args, array('view', 'history', true))); $this->addMenuItem("link", "Kills", edkURI::build($args, array('view', 'kills', true))); $this->addMenuItem("link", "Losses", edkURI::build($args, array('view', 'losses', true))); $this->addMenuItem("caption", "Statistics"); $this->addMenuItem("link", "Ships & weapons", edkURI::build($args, array('view', 'ships_weapons', true))); return ""; }
/** * Set up the menu. * * Prepare all the base menu options. */ function menuSetup() { // Display the menu for previous and next weeks. $this->addMenuItem("caption", "Navigation"); $view = $sclarg = null; if ($this->view) { $view = array('view', $this->view, true); } if ($this->scl_id) { $sclarg = array('scl_id', $this->scl_id, false); } $previous = $this->pargs; $next = $this->nargs; if ($view) { array_unshift($previous, $view); array_unshift($next, $view); } $killLink = $this->cargs; array_unshift($killLink, array('view', 'kills', true)); $lossLink = $this->cargs; array_unshift($lossLink, array('view', 'losses', true)); $combinedLink = $this->cargs; if ($sclarg) { $previous[] = $sclarg; $next[] = $sclarg; $killLink[] = $sclarg; $lossLink[] = $sclarg; $combinedLink[] = $sclarg; } $this->addMenuItem("link", "Previous " . $this->getPeriodName(), edkURI::build($previous)); if (!$this->isCurrentPeriod()) { $this->addMenuItem("link", "Next " . $this->getPeriodName(), edkURI::build($next)); } $this->addMenuItem("link", "Kills", edkURI::build($killLink)); $this->addMenuItem("link", "Losses", edkURI::build($lossLink)); if (config::get('show_comb_home')) { $this->addMenuItem("link", $weektext . "All Kills", edkURI::build($combinedLink)); } return ""; }
public static function killListAlliance($allianceDetail) { require_once "toplist/class.expensivekills.php"; require_once "toptable/class.expensivekill.php"; global $smarty; // arguments for URL building $args = array(); if ($allianceDetail->all_external_id) { $args[] = array('all_ext_id', $allianceDetail->all_external_id, true); } else { $args[] = array('all_id', $allianceDetail->all_id, true); } // get context information $all_id = $allianceDetail->getAlliance()->getID(); $view = $allianceDetail->getView(); $month = $allianceDetail->getMonth(); $year = $allianceDetail->getYear(); $pmonth = $smarty->get_template_vars('pmonth'); $pyear = $smarty->get_template_vars('pyear'); $nmonth = $smarty->get_template_vars('nmonth'); $nyear = $smarty->get_template_vars('nyear'); $monthname = kbdate("F", strtotime("2000-" . $month . "-2")); if ($view == 'expensive_kills') { $smarty->assign('title', "Most Expensive Kills"); $smarty->assign('month', $monthname); $smarty->assign('year', $year); $smarty->assign('pmonth', $pmonth); $smarty->assign('pyear', $pyear); $smarty->assign('nmonth', $nmonth); $smarty->assign('nyear', $nyear); $smarty->assign('all_id', $all_id); $smarty->assign('value_class', 'kl-kill'); $smarty->assign('url_previous', edkURI::build($args, array('view', 'expensive_kills', true), array('y', $pyear, true), array('m', $pmonth, true))); $smarty->assign('url_next', edkURI::build($args, array('view', 'expensive_kills', true), array('y', $nyear, true), array('m', $nmonth, true))); $list = new TopList_ExpensiveKills(); $list->addInvolvedAlliance($allianceDetail->getAlliance()); $list->setPodsNoobShips(TRUE); $list->setMonth($month); $list->setYear($year); $table = new TopTable_ExpensiveKill($list, "ISK"); $smarty->assign('monthly_stats', $table->generate()); $list = new TopList_ExpensiveKills(); $list->addInvolvedAlliance($allianceDetail->getAlliance()); $list->setPodsNoobShips(TRUE); $table = new TopTable_ExpensiveKill($list, "ISK"); $smarty->assign('total_stats', $table->generate()); return $smarty->fetch(getcwd() . "/mods/most_expensive_toplist/templates/detail_kl_expensive.tpl"); } else { if ($view == 'expensive_losses') { $smarty->assign('title', "Most Expensive Losses"); $smarty->assign('month', $monthname); $smarty->assign('year', $year); $smarty->assign('pmonth', $pmonth); $smarty->assign('pyear', $pyear); $smarty->assign('nmonth', $nmonth); $smarty->assign('nyear', $nyear); $smarty->assign('all_id', $all_id); $smarty->assign('value_class', 'kl-loss'); $smarty->assign('url_previous', edkURI::build($args, array('view', 'expensive_losses', true), array('y', $pyear, true), array('m', $pmonth, true))); $smarty->assign('url_next', edkURI::build($args, array('view', 'expensive_losses', true), array('y', $nyear, true), array('m', $nmonth, true))); $list = new TopList_ExpensiveKills(); $list->addVictimAlliance($allianceDetail->getAlliance()); $list->setPodsNoobShips(TRUE); $list->setMonth($month); $list->setYear($year); $table = new TopTable_ExpensiveKill($list, "ISK"); $smarty->assign('monthly_stats', $table->generate()); $list = new TopList_ExpensiveKills(); $list->addVictimAlliance($allianceDetail->getAlliance()); $list->setPodsNoobShips(TRUE); $table = new TopTable_ExpensiveKill($list, "ISK"); $smarty->assign('total_stats', $table->generate()); return $smarty->fetch(getcwd() . "/mods/most_expensive_toplist/templates/detail_kl_expensive.tpl"); } } }
if (config::get('cfg_pilotid')) { foreach (config::get('cfg_corpid') as $owner) { $pilot = new Pilot($owner); $owners[] = htmlentities($pilot->getName()); } unset($pilot); } if (!$owners) { $smarty->assign('kb_owner', false); } else { $smarty->assign('kb_owner', implode(',', $owners)); } // Show a system message on all pages if the init stage has generated any. if (isset($boardMessage)) { $smarty->assign('message', $boardMessage); } if ($settingsPage) { if (!session::isAdmin()) { header('Location: ' . edkURI::build(array('a', 'login', true))); echo '<a href="' . edkURI::build(array('a', 'login', true)) . '">Login</a>'; exit; } if (@(include 'mods/' . substr($page, 9, strlen($page) - 9) . '/settings.php') === false) { header('Location: ' . edkURI::build(array('a', 'error', true))); exit; } } elseif ($modOverrides) { include 'mods/' . $modOverride . '/' . $page . '.php'; } else { include 'common/' . $page . '.php'; }
public function menuSetup() { $this->addMenuItem("caption", "View"); if ($this->adjacent) { $this->addMenuItem("link", "Remove adjacent", edkURI::build(array('kll_id', $this->kll_id, true))); } else { $this->addMenuItem("link", "Include adjacent", edkURI::build(array('kll_id', $this->kll_id, true), array('adjacent', true, true))); } $this->addMenuItem("link", "Back to Killmail", edkURI::build(array('a', 'kill_detail', true), array('kll_id', $this->kll_id, true))); }
} else { if ($flags & KB_APIKEY_LEGACY) { $html .= "Requires Updated Key"; } if ($flags & KB_APIKEY_BADAUTH) { $html .= "Bad Authentication"; } if ($flags & KB_APIKEY_EXPIRED) { $html .= "Expired Key"; } if ($flags & KB_APIKEY_BADCORP) { $html .= "Bad Corporation Key"; } } $html .= "</td>"; $html .= '<td><a href="' . edkURI::build(array('delete', $row['key_id'], false)) . '">Del</a></td>'; $html .= "</tr>"; $cycle = !$cycle; } $html .= "</table>"; $html .= "<div class='block-header2'>Add a new API Key</div>"; $html .= "<i> Your API key ID and verification Code can be obtained <a href=\"http://support.eveonline.com/api/Key/CreatePredefined/256\">here</a></i><br /><br />"; $html .= "<table style='width: 100%' class='kb-subtable'>"; $html .= "<thead><tr><td>Name</td><td>ID</td><td>Verification Code</td><td></td></tr></thead>"; $html .= "<tbody><tr>"; $html .= "<td><input type='text' name='keyname' id='keyname' size='20' /></td>"; $html .= "<td><input type='text' name='keyid' id='keyid' size='10' maxlength='64' /></td>"; $html .= "<td><input type='text' name='keycode' id='keycode' size='64' maxlength='64' /></td><td colspan='3'><input id='add' name='add' type='submit' value='Add' /></td></tr>"; $html .= "<tr><td colspan='6'> </td></tr></tbody></table>"; $html .= "<div class='block-header2'>Options</div><table>"; $html .= "<tr><td style='padding: 10px 0' colspan='2'>(" . $deld . " files with a total size of " . number_format($dsize, "0", ".", ",") . " bytes)</td></tr>";
/** * Set up the menu. * * Prepare all the base menu options. */ function menuSetup() { $this->addMenuItem("caption", "Overview"); $this->addMenuItem("link", "Target overview", edkURI::build(array('ctr_id', $this->ctr_id, true))); $this->addMenuItem("caption", "Kills & losses"); $this->addMenuItem("link", "Recent activity", edkURI::build(array(array('ctr_id', $this->ctr_id, true), array('view', 'recent_activity', true)))); $this->addMenuItem("link", "All kills", edkURI::build(array(array('ctr_id', $this->ctr_id, true), array('view', 'kills', true)))); $this->addMenuItem("link", "All losses", edkURI::build(array(array('ctr_id', $this->ctr_id, true), array('view', 'losses', true)))); return ""; }
/** * Generate admin menu. * * @return string HTML for a menu of admin links. */ public static function genAdminMenu() { // sort the menu alphabetically ksort(self::$data); // create a standardbox to print all links into $menubox = new Box('Options'); $menubox->setIcon('menu-item.gif'); foreach (self::$data as $field => $subfields) { $menubox->addOption('caption', $field); foreach ($subfields as $subfield => $array) { // if this subfield has no options then it is a category if (!is_array($array)) { $menubox->addOption('link', $subfield, $array); continue; } // we're not a category, make it clickable $menubox->addOption('link', $subfield, edkURI::build(array(array('a', 'admin', true), array('field', urlencode($field), true), array('sub', urlencode($subfield), true)))); } $lastfield = $field; } return $menubox->generate(); }
</tr> <tr> <td valign="top">Constellations:</td> <td>'; foreach ($constellation as $const) { $html .= $const . '<br>'; } $html .= '</td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td valign="top">Systems: </td> <td>'; foreach ($systems as $sys) { $systemLink = edkURI::build(array(array('region_id', $regionID, true), array('sys', intval($sys['id']), false))); $html .= '<a href="' . $systemLink . '">' . $sys['name'] . '</a> ( <span style="color:' . $sec_color[$sys['sec'] * 10] . '"> ' . $sys['sec'] . '</span> )<br>'; } $html .= '</td> </tr> </table></td> </tr> <tr> <td colspan="2"> </td> </tr> </table>'; } $page->setContent($html); $page->generate();
/** * Set up the menu. * * Additional options that have been set are added to the menu. */ function menuSetup() { $args = array(); if ($this->all_external_id) { $args[] = array('all_ext_id', $this->all_external_id, true); } else { $args[] = array('all_id', $this->all_id, true); } $menubox = new Box("Menu"); $menubox->setIcon("menu-item.gif"); $this->addMenuItem("caption", "Kills & losses"); $this->addMenuItem("link", "Recent activity", edkURI::build($args)); $this->addMenuItem("link", "Historical activity", edkURI::build($args, array('view', 'history', true))); $this->addMenuItem("link", "Kills", edkURI::build($args, array('view', 'kills', true))); $this->addMenuItem("link", "Losses", edkURI::build($args, array('view', 'losses', true))); $this->addMenuItem("caption", "Corp statistics"); $this->addMenuItem("link", "Corp List", edkURI::build($args, array('view', 'corp_list', true))); $this->addMenuItem("link", "Top killers", edkURI::build($args, array('view', 'corp_kills', true))); $this->addMenuItem("link", "Top losers", edkURI::build($args, array('view', 'corp_losses', true))); $this->addMenuItem("link", "Destroyed ships", edkURI::build($args, array('view', 'corp_kills_class', true))); $this->addMenuItem("link", "Lost ships", edkURI::build($args, array('view', 'corp_losses_class', true))); $this->addMenuItem("caption", "Pilot statistics"); $this->addMenuItem("link", "Top killers", edkURI::build($args, array('view', 'pilot_kills', true))); if (config::get('kill_points')) { $this->addMenuItem('link', "Top scorers", edkURI::build($args, array('view', 'pilot_scores', true))); } $this->addMenuItem("link", "Top losers", edkURI::build($args, array('view', 'pilot_losses', true))); $this->addMenuItem("link", "Destroyed ships", edkURI::build($args, array('view', 'kills_class', true))); $this->addMenuItem("link", "Lost ships", edkURI::build($args, array('view', 'losses_class', true))); $this->addMenuItem("caption", "Global statistics"); $this->addMenuItem("link", "Ships & weapons", edkURI::build($args, array('view', 'ships_weapons', true))); $this->addMenuItem("link", "Most violent systems", edkURI::build($args, array('view', 'violent_systems', true))); }
function generate() { if ($this->klist) { $entry = array(); // build array $sql = "select scl_id, scl_class\n from kb3_ship_classes\n where scl_class not in ( 'Drone', 'Unknown' )\n order by scl_class"; $qry = DBFactory::getDBQuery(); $qry->execute($sql) or die($qry->getErrorMsg()); while ($row = $qry->getRow()) { if (!$row['scl_id']) { continue; } $entry[$row['scl_class']]['id'] = $row['scl_id']; $entry[$row['scl_class']]['kills'] = 0; $entry[$row['scl_class']]['kills_isk'] = 0; } while ($kill = $this->klist->getKill()) { $classname = $kill->getVictimShipClassName(); $entry[$classname]['kills']++; $entry[$classname]['kills_isk'] += $kill->getISKLoss(); $this->tkcount++; $this->tkisk += $kill->getISKLoss(); } } else { $this->getkills(); $entry =& $this->entry; } // Don't count noobships. $num = count($entry) - 1; $summary = array(); $count = 0; $args = edkURI::parseURI(); if (edkURI::getArg('scl_id')) { foreach ($args as $key => $value) { if ($value[0] == 'scl_id') { unset($args[$key]); break; } } } $qrystring = edkURI::build($args); $clearfilter = $qrystring; if (strpos($qrystring, '?') === false) { $qrystring .= "?"; } else { $qrystring .= "&"; } foreach ($entry as $k => $v) { if ($v['id'] == 3) { continue; } $v['break'] = 0; if ($_GET['scl_id'] && $_GET['scl_id'] == $v['id']) { $v['hl'] = 1; } else { $v['hl'] = 0; } $v['qry'] = $qrystring; $v['kisk'] = round($v['kills_isk'] / 1000000, 2); $v['name'] = $k; $summary[] = $v; $this->tkcount += $kcount; $this->tkisk += $kisk; $this->tkpoints += $kpoints; $count++; } global $smarty; $smarty->assign('summary', $summary); $smarty->assign('count', $num); $smarty->assign('verbose', $this->verbose); $smarty->assign('filter', $this->filter); if (config::get('summarytable_summary')) { $smarty->assign('summarysummary', 1); $smarty->assign('efficiency', 0); $smarty->assign('kiskB', round($this->tkisk / 1000000000, 2)); $smarty->assign('kiskM', round($this->tkisk / 1000000, 2)); $smarty->assign('kcount', $this->tkcount); if (config::get('summarytable_collapsed')) { $smarty->assign('summarycollapsed', 1); } } if (edkURI::getArg('scl_id')) { $smarty->assign('clearfilter', $clearfilter); } $html .= $smarty->fetch(get_tpl('summarytable')); return $html; }
/** * adds meta tags for Twitter Summary Card and OpenGraph tags * to the HTML header */ function metaTags() { $referenceSystem = SolarSystem::getByID(reset($this->systems)); // meta tag: title $metaTagTitle = $referenceSystem->getName() . " | " . $referenceSystem->getRegionName() . " | Battle Report"; $this->page->addHeader('<meta name="og:title" content="' . $metaTagTitle . '">'); $this->page->addHeader('<meta name="twitter:title" content="' . $metaTagTitle . '">'); // build description $date = gmdate("Y-m-d", strtotime($this->firstts)); $startTime = gmdate("H:i", strtotime($this->firstts)); $endTime = gmdate("H:i", strtotime($this->lastts)); $totalIskDestroyedM = round(($this->summaryTable->getTotalKillISK() + $this->summaryTable->getTotalLossISK()) / 1000000, 2); $metaTagDescription = "Battle Report for " . $referenceSystem->getName() . " (" . $referenceSystem->getRegionName() . ") from " . $date . " (" . $startTime . " - " . $endTime . "): "; $metaTagDescription .= "Involved Pilots: " . (count($this->pilots['a']) + count($this->pilots['e'])) . ", Total ISK destroyed: " . $totalIskDestroyedM . "M ISK"; $this->page->addHeader('<meta name="description" content="' . $metaTagDescription . '">'); $this->page->addHeader('<meta name="og:description" content="' . $metaTagDescription . '">'); // meta tag: image $this->page->addHeader('<meta name="og:image" content="' . imageURL::getURL('Type', 3802, 64) . '">'); $this->page->addHeader('<meta name="twitter:image" content="' . imageURL::getURL('Type', 3802, 64) . '">'); $this->page->addHeader('<meta name="og:site_name" content="EDK - ' . config::get('cfg_kbtitle') . '">'); // meta tag: URL $this->page->addHeader('<meta name="og:url" content="' . edkURI::build(array('kll_id', $this->kll_id, true)) . '">'); // meta tag: Twitter summary $this->page->addHeader('<meta name="twitter:card" content="summary">'); }
<?php /** * @package EDK */ require_once 'common/xajax/xajax_core/xajax.inc.php'; $xajax = new xajax(); event::register('page_assembleheader', 'edk_xajax::insertHTML'); // if mods depend on xajax they can register to xajax_initialised // it gets called after all mods have been initialized //event::register('smarty_displayindex', 'edk_xajax::lateProcess'); //event::register('page_assembleheader', 'edk_xajax::lateProcess'); event::register('mods_initialised', 'edk_xajax::lateProcess'); //event::register('page_initialisation', 'edk_xajax::lateProcess'); $uri = html_entity_decode(edkURI::build(edkURI::parseURI())); if (strpos($uri, "?") === false) { $uri .= "?xajax=1"; } else { $uri .= "&xajax=1"; } $xajax->configure('requestURI', $uri); /** * @package EDK */ class edk_xajax { public static function xajax() { global $xajax_enable; $xajax_enable = true; }
/** * Set up the menu. * * Prepare all the base menu options. */ function menuSetup() { $args = array(); if ($this->crp_external_id) { $args[] = array('crp_ext_id', $this->crp_external_id, true); } else { $args[] = array('crp_id', $this->crp_id, true); } $this->addMenuItem("caption", "Kills & losses"); $this->addMenuItem("link", "Recent activity", edkURI::build($args)); $this->addMenuItem("link", "Historical activity", edkURI::build($args, array('view', 'history', true))); $this->addMenuItem("link", "Kills", edkURI::build($args, array('view', 'kills', true))); $this->addMenuItem("link", "Losses", edkURI::build($args, array('view', 'losses', true))); $this->addMenuItem("caption", "Pilot statistics"); $this->addMenuItem("link", "Top killers", edkURI::build($args, array('view', 'pilot_kills', true))); if (config::get('kill_points')) { $this->addMenuItem("link", "Top scorers", edkURI::build($args, array('view', 'pilot_scores', true))); } $this->addMenuItem("link", "Top solokillers", edkURI::build($args, array('view', 'pilot_solo', true))); $this->addMenuItem("link", "Top damagedealers", edkURI::build($args, array('view', 'pilot_damage', true))); $this->addMenuItem("link", "Top griefers", edkURI::build($args, array('view', 'pilot_griefer', true))); $this->addMenuItem("link", "Top losers", edkURI::build($args, array('view', 'pilot_losses', true))); $this->addMenuItem("caption", "Global statistics"); $this->addMenuItem("link", "Ships & weapons", edkURI::build($args, array('view', 'ships_weapons', true))); $this->addMenuItem("link", "Most violent systems", edkURI::build($args, array('view', 'violent_systems', true))); return ""; }