/** * Start constructing the page. * Prepare all the shared variables such as dates and check alliance ID. * */ function start() { $this->page = new Page('Related kills & losses'); $this->page->addHeader('<meta name="robots" content="index, nofollow" />'); $this->kll_id = (int) edkURI::getArg('kll_id', 1); if (!$this->kll_id) { $this->kll_external_id = (int) edkURI::getArg('kll_ext_id'); if (!$this->kll_external_id) { // internal and external ids easily overlap so we can't guess which $this->kll_id = (int) edkURI::getArg(null, 1); $this->kill = Kill::getByID($this->kll_id); } else { $this->kill = new Kill($this->kll_external_id, true); $this->kll_id = $this->kill->getID(); } } else { $this->kill = Kill::getByID($this->kll_id); } $this->adjacent = edkURI::getArg('adjacent'); $this->scl_id = (int) edkURI::getArg('scl_id'); $this->menuOptions = array(); if (!$this->kll_id || !$this->kill->exists()) { echo 'No valid kill id specified'; exit; } if ($this->kill->isClassified()) { Header("Location: " . htmlspecialchars_decode(edkURI::page('kill_detail', $this->kll_id, 'kll_id'))); die; } // $this->getInvolved(); // $this->buildStats(); }
function details() { global $smarty; $item = new dogma($this->typeID); if (!$item->isValid()) { $this->page->setTitle('Error'); return 'This ID is not a valid dogma ID.'; } $this->page->setTitle('Item details - ' . $item->get('typeName')); $this->page->addHeader('<meta name="robots" content="noindex, nofollow" />'); $smarty->assignByRef('item', $item); if ($item->get('itt_cat') == 6) { //we have a ship, so get it from the db $ship = Ship::getByID($item->get('typeID')); $smarty->assign('shipImage', $ship->getImage(64)); $smarty->assign('armour', array('armorHP', 'armorEmDamageResonance', 'armorExplosiveDamageResonance', 'armorKineticDamageResonance', 'armorThermalDamageResonance')); $smarty->assign('shield', array('shieldCapacity', 'shieldRechargeRate', 'shieldEmDamageResonance', 'shieldExplosiveDamageResonance', 'shieldKineticDamageResonance', 'shieldThermalDamageResonance')); $smarty->assign('propulsion', array('maxVelocity', 'agility', 'droneCapacity', 'capacitorCapacity', 'rechargeRate')); $smarty->assign('fitting', array('hiSlots', 'medSlots', 'lowSlots', 'rigSlots', 'upgradeCapacity', 'droneBandwidth', 'launcherSlotsLeft', 'turretSlotsLeft', 'powerOutput', 'cpuOutput')); $smarty->assign('targetting', array('maxTargetRange', 'scanResolution', 'maxLockedTargets', 'scanRadarStrength', 'scanLadarStrength', 'scanMagnetometricStrength', 'scanGravimetricStrength', 'signatureRadius')); $smarty->assign('miscellaneous', array('techLevel', 'propulsionFusionStrength', 'propulsionIonStrength', 'propulsionMagpulseStrength', 'propulsionPlasmaStrength')); $html = $smarty->fetch(get_tpl('invtype_ship')); } else { $i = new Item($this->typeID); $smarty->assign('itemImage', $i->getIcon(64, false)); $smarty->assign('akey', session::isAdmin() ? session::makeKey() : false); $html = $smarty->fetch(get_tpl('invtype_item')); } return $html; }
/** * Start constructing the page. * Prepare all the shared variables such as dates and check alliance ID. * */ function start() { $this->page = new Page(); $this->plt_id = (int) edkURI::getArg('plt_id'); if (!$this->plt_id) { $this->plt_external_id = (int) edkURI::getArg('plt_ext_id'); if (!$this->plt_external_id) { $id = (int) edkURI::getArg('id', 1); // Arbitrary number bigger than we expect to reach locally if ($id > 1000000) { $this->plt_external_id = $id; } else { $this->plt_id = $id; } } } $this->view = preg_replace('/[^a-zA-Z0-9_-]/', '', edkURI::getArg('view', 2)); if ($this->view) { $this->page->addHeader('<meta name="robots" content="noindex, nofollow" />'); } if (!$this->plt_id) { if ($this->plt_external_id) { $this->pilot = new Pilot(0, $this->plt_external_id); $this->plt_id = $this->pilot->getID(); } else { $html = 'That pilot doesn\'t exist.'; $this->page->generate($html); exit; } } else { $this->pilot = Cacheable::factory('Pilot', $this->plt_id); $this->plt_external_id = $this->pilot->getExternalID(); } $this->page->setTitle('Pilot details - ' . $this->pilot->getName()); if (!$this->pilot->exists()) { $html = 'That pilot doesn\'t exist.'; $this->page->setContent($html); $this->page->generate(); exit; } if ($this->plt_external_id) { $this->page->addHeader("<link rel='canonical' href='" . edkURI::page('pilot_detail', $this->plt_external_id, 'plt_ext_id') . "' />"); } else { $this->page->addHeader("<link rel='canonical' href='" . edkURI::page('pilot_detail', $this->plt_id, 'plt_id') . "' />"); } $this->corp = $this->pilot->getCorp(); $this->alliance = $this->corp->getAlliance(); }
/** * 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">'); }
/** * Start constructing the page. * Prepare all the shared variables such as dates and check alliance ID. * */ function start() { $this->sys_id = (int) edkURI::getArg('sys_id', 1, true); $this->view = preg_replace('/[^a-zA-Z0-9_-]/', '', edkURI::getArg('view', 2, true)); global $smarty; $this->smarty = $smarty; $this->viewList = array(); $this->menuOptions = array(); $this->page = new Page(); $this->page->addHeader('<meta name="robots" content="noindex, nofollow" />'); if (!$this->sys_id) { echo 'no valid id supplied<br/>'; exit; } $this->page->addHeader("<link rel='canonical' href='" . edkURI::build($this->args) . "' />"); $this->system = new SolarSystem($this->sys_id); $this->menuOptions = array(); $this->page->setTitle('System details - ' . $this->system->getName()); $this->smarty->assign('sys_id', $this->sys_id); }
<?php /* Requirements */ require_once "classes/Configurations.php"; require_once "classes/Page.php"; require_once "classes/SignupGadgets.php"; require_once "classes/Debugger.php"; require_once "classes/SignupGadget.php"; require_once "classes/CommonTools.php"; require_once "classes/SignupGadgetEditFormatter.php"; /* Implementations of the most critical classes */ $configurations = new Configurations(); $page = new Page(2); $debugger = new Debugger(); $database = new Database(); /* The code */ $signupId = $request->getSignupId(); $signupGadget = new SignupGadget($signupId); $page->addHeader("<script type=\"text/javascript\" src=\"../question_script.js\"></script>"); $page->addContent(SignupGadgetEditFormater::getSignupGadgetEditInPrintableFormat($signupGadget, true)); $page->printPage();
function topLists($filterArguments = array()) { if (empty($filterArguments)) { $whereSql = ""; } else { $whereSql = "WHERE " . implode(" AND ", $filterArguments); } $sql = "SELECT COUNT( bop.battle_id ) AS cnt, bop.plt_id\n FROM kb3_battles_owner_pilots bop\n INNER JOIN kb3_pilots plt ON ( plt.plt_id = bop.plt_id ) \n INNER JOIN kb3_battles_cache bc ON bc.battle_id = bop.battle_id\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 GROUP BY bop.plt_id ORDER BY 1 DESC LIMIT 15"; $query = DBFactory::getDBQuery(); $query->execute($sql); $tkbox = new AwardBoxLong($query, "Top Fleet Attendees", "Fleet attendances", "fleets", "eagle", $query->recordCount()); return $html = $tkbox->generate(); } // add filter toggling script $jsDir = config::get("cfg_kbhost") . '/mods/' . basename(dirname(__FILE__)) . '/js/'; $page->addHeader("<script type=\"text/javascript\" src=\"" . $jsDir . "toggleFilter.js\"></script>"); switch ($_GET['view']) { case '': echo "<!-- MOD VERSION -->\n"; $battlelist = new BattleList(); $page->setTitle('Fleet Battles'); $table = new BattleListTable($battlelist); // pagination only available for cached battles and non-filtered results if (config::get('fleet_battles_mod_cache') && !isset($_POST["filter"])) { $table->setPageSplit(config::get('killcount') * 2); $pagesplitter = new PageSplitter($table->getCount(), config::get('killcount') * 2); $pagesplit = $pagesplitter->generate(); $html .= $pagesplit . $table->generate() . $pagesplit . $table->getStatsHtml(); } else { $html .= $table->generate() . $table->getStatsHtml(); }
function start() { $this->page = new Page(); $this->page->addHeader("<link rel='canonical' href='" . edkURI::page() . "' />"); $this->view = preg_replace('/[^a-zA-Z0-9_-]/', '', edkURI::getArg('view', 1)); $period = edkURI::getArg('period'); $day = $week = $month = $year = 0; // First argument is either the view or the year if (is_numeric($this->view) || !$this->view || $this->view == 'day' || $this->view == 'week' || $this->view == 'month') { $this->view = ''; $datestart = 1; } else { $datestart = 2; } $year = edkURI::getArg('y', $datestart); if ((int) $year && !$period) { $year = (int) $year; $this->dateSet = true; if (config::get('show_monthly')) { $month = (int) edkURI::getArg('m', $datestart + 1); } else { $week = (int) edkURI::getArg('w', $datestart + 1); } } else { if ($year || $period) { if (!$period) { $period = $year; } $datestart++; switch ($period) { case "month": $year = (int) edkURI::getArg('y', $datestart); if ((int) $year) { $month = (int) edkURI::getArg('m', $datestart + 1); $this->dateSet = true; } break; case "week": $year = (int) edkURI::getArg('y', $datestart); if ((int) $year) { $week = (int) edkURI::getArg('w', $datestart + 1); $this->dateSet = true; } break; case "day": $year = (int) edkURI::getArg('y', $datestart); if ((int) $year) { $month = (int) edkURI::getArg('m', $datestart + 1); if ((int) $month) { $day = (int) edkURI::getArg('d', $datestart + 2); $this->dateSet = true; } } break; } } } $this->setTime($week, $year, $month, $day); if (edkURI::getArg('scl_id') === false || edkURI::getArg('y', 1) === false) { $this->page->addHeader('<meta name="robots" content="index, follow" />'); } $this->scl_id = (int) edkURI::getArg('scl_id'); $this->showcombined = config::get('show_comb_home') && (count(config::get('cfg_allianceid')) || count(config::get('cfg_corpid')) || count(config::get('cfg_pilotid'))); if ($this->view == 'kills') { $this->page->setTitle('Kills - ' . $this->getCurrentPeriod()); } else { if ($this->view == 'losses') { $this->page->setTitle('Losses - ' . $this->getCurrentPeriod()); } else { $this->page->setTitle($this->getCurrentPeriod()); } } }
$database = new Database(); /* Variables from outside */ $signupId = $request->getSignupId(); /* The code */ $signupGadget = new SignupGadget($signupId); $user = new User($signupId); if ($user->unconfirmedSignupExists) { if ($user->unconfirmedSignupIsNotTheSameAsThis) { $debugger->error("Olet ilmoittautunut johonkin toiseen ilmomasiinaan", "confirm.php"); } else { // Nice! User is signed up to this signup form! } } else { $debugger->error("Et ole vielä ilmoittautunut tai ilmoittautumisesi on vanhentunut. Ilmoittautumisen vahvistaminen epäonnistui.", "confirm.php"); } $page->addHeader("<script type=\"text/javascript\" src=\"javascript/jquery.js\"></script>"); $page->addHeader("<script type=\"text/javascript\" src=\"javascript/email_validation.js\"></script>"); $page->addContent("<div id=\"signup-position-info-div\">"); $page->addContent("<p id=\"signup-position-info\"><span>Olet sijalla <strong>" . $user->getPosition() . "</strong>. Edessäsi on <strong>" . $user->getUnconfirmedSignupsBefore() . "</strong> vahvistamatonta ilmoittautumista. Ilmoittautumisaikasi oli <strong>" . $user->getReadableSignupTime() . "</strong> ja aikaa ilmoittautumisen vahvistamiseen sinulla on <strong>" . $user->getSignupTimeLeftInMinutes() . "</strong> minuuttia</span></p>"); $page->addContent("</div>"); $page->addContent("<div id=\"questions\">"); $page->addContent("<form id=\"questions-form\" method=\"post\" action=\"" . $configurations->webRoot . "save\">"); $page->addContent("<input type=\"hidden\" name=\"signupid\" value=\"{$signupId}\">"); $page->addContent("<input type=\"hidden\" name=\"userid\" value=\"" . $user->getId() . "\">"); $page->addContent(SignupGadgetQuestionFormater::getQuestionsInPrintableFormat($signupGadget)); $page->addContent("<input type=\"hidden\" name=\"question_ids\" value=\"" . $signupGadget->getFormatedQuestionIds() . "\">"); $page->addContent("<input id=\"confirm-button\" type=\"submit\" value=\"Vahvista\">"); $page->addContent("</form>"); $page->addContent("<form id=\"cancel-form\" method=\"post\" action=\"" . $configurations->webRoot . "cancel\">"); $page->addContent("<input id=\"cancel-button\" type=\"submit\" value=\"Peru ilmoittautuminen\">"); $page->addContent("</form>");
/** * Start constructing the page. * Prepare all the shared variables such as dates and check alliance ID. */ function start() { $this->page = new Page(); $this->all_id = (int) edkURI::getArg('all_id'); $this->all_external_id = (int) edkURI::getArg('all_ext_id'); if (!$this->all_id && !$this->all_external_id) { $this->all_id = (int) edkURI::getArg('id', 1); // And now a bit of magic to test if this is an external ID if ($this->all_id > 500000 && $this->all_id < 500021 || $this->all_id > 1000000) { $this->all_external_id = $this->all_id; $this->all_id = 0; } } $this->view = preg_replace('/[^a-zA-Z0-9_-]/', '', edkURI::getArg('view', 2)); // Search engines should only index the main view. if ($this->view) { $this->page->addHeader('<meta name="robots" content="noindex, nofollow" />'); } if (!$this->all_id && !$this->all_external_id) { $html = 'No valid alliance id specified.'; $this->page->setContent($html); $this->page->generate(); exit; } if (!$this->all_id && $this->all_external_id) { $this->alliance = new Alliance($this->all_external_id, true); $this->all_id = $this->alliance->getID(); if (!$this->all_id) { echo 'No valid alliance id specified.'; exit; } } else { $this->alliance = Cacheable::factory('Alliance', $this->all_id); $this->all_external_id = $this->alliance->getExternalID(); } $this->page->addHeader("<link rel='canonical' href='" . $this->alliance->getDetailsURL() . "' />"); if ($this->view) { $this->year = (int) edkURI::getArg('y', 3); $this->month = (int) edkURI::getArg('m', 4); } else { $this->year = (int) edkURI::getArg('y', 2); $this->month = (int) edkURI::getArg('m', 3); } if (!$this->month) { $this->month = kbdate('m'); } if (!$this->year) { $this->year = kbdate('Y'); } if ($this->month == 12) { $this->nmonth = 1; $this->nyear = $this->year + 1; } else { $this->nmonth = $this->month + 1; $this->nyear = $this->year; } if ($this->month == 1) { $this->pmonth = 12; $this->pyear = $this->year - 1; } else { $this->pmonth = $this->month - 1; $this->pyear = $this->year; } $this->monthname = kbdate("F", strtotime("2000-" . $this->month . "-2")); global $smarty; $smarty->assign('monthname', $this->monthname); $smarty->assign('year', $this->year); $smarty->assign('pmonth', $this->pmonth); $smarty->assign('pyear', $this->pyear); $smarty->assign('nmonth', $this->nmonth); $smarty->assign('nyear', $this->nyear); if ($this->alliance->isFaction()) { $this->page->setTitle(Language::get('page_faction_det') . ' - ' . $this->alliance->getName()); } else { $this->page->setTitle(Language::get('page_all_det') . ' - ' . $this->alliance->getName()); } $smarty->assign('all_name', $this->alliance->getName()); $smarty->assign('all_id', $this->alliance->getID()); }
/** * Start constructing the page. * Prepare all the shared variables such as dates and check alliance ID. * */ function start() { $this->page = new Page('Corporation details'); $this->scl_id = (int) edkURI::getArg('scl_id'); $this->crp_id = (int) edkURI::getArg('crp_id'); if (!$this->crp_id) { $this->crp_external_id = (int) edkURI::getArg('crp_ext_id'); if (!$this->crp_external_id) { $id = (int) edkURI::getArg('id', 1); // True for NPC corps too, but NPC alliances recorded as corps // fail here. Use Jedi mind tricks? if ($id > 1000000) { $this->crp_external_id = $id; } else { $this->crp_id = $id; } } } $this->view = preg_replace('/[^a-zA-Z0-9_-]/', '', edkURI::getArg('view', 2)); if ($this->view) { $this->page->addHeader('<meta name="robots" content="noindex, nofollow" />'); } if (!$this->crp_id) { if ($this->crp_external_id) { $this->corp = new Corporation($this->crp_external_id, true); $this->crp_id = $this->corp->getID(); } else { $html = 'That corporation does not exist.'; $this->page->setContent($html); $this->page->generate(); exit; } } else { $this->corp = Cacheable::factory('Corporation', $this->crp_id); $this->crp_external_id = $this->corp->getExternalID(); } if ($this->crp_external_id) { $this->page->addHeader("<link rel='canonical' href='" . edkURI::build(array('crp_ext_id', $this->crp_external_id, true)) . "' />"); } else { $this->page->addHeader("<link rel='canonical' href='" . edkURI::build(array('crp_id', $this->crp_id, true)) . "' />"); } $this->alliance = $this->corp->getAlliance(); if ($this->view) { $this->year = (int) edkURI::getArg('y', 3); $this->month = (int) edkURI::getArg('m', 4); } else { $this->year = (int) edkURI::getArg('y', 2); $this->month = (int) edkURI::getArg('m', 3); } if (!$this->month) { $this->month = kbdate('m'); } if (!$this->year) { $this->year = kbdate('Y'); } if ($this->month == 12) { $this->nmonth = 1; $this->nyear = $this->year + 1; } else { $this->nmonth = $this->month + 1; $this->nyear = $this->year; } if ($this->month == 1) { $this->pmonth = 12; $this->pyear = $this->year - 1; } else { $this->pmonth = $this->month - 1; $this->pyear = $this->year; } $this->monthname = kbdate("F", strtotime("2000-" . $this->month . "-2")); }