static function allowPhalanx($toGalaxy, $toSystem) { global $PLANET, $resource; if ($PLANET['galaxy'] != $toGalaxy || $PLANET[$resource[42]] == 0 || !isModuleAvailable(MODULE_PHALANX) || $PLANET[$resource[903]] < PHALANX_DEUTERIUM) { return false; } $PhRange = self::GetPhalanxRange($PLANET[$resource[42]]); $systemMin = max(1, $PLANET['system'] - $PhRange); $systemMax = $PLANET['system'] + $PhRange; return $toSystem >= $systemMin && $toSystem <= $systemMax; }
$dbTableNames = Database::get()->getDbTableNames(); $dbTableNames = array_combine($dbTableNames['keys'], $dbTableNames['names']); foreach ($dbTableNames as $dbAlias => $dbName) { define(substr($dbAlias, 2, -2), $dbName); } } $config = Config::get(); date_default_timezone_set($config->timezone); if (MODE === 'INGAME' || MODE === 'ADMIN') { $session = Session::load(); if (!$session->isValidSession()) { HTTP::redirectTo('index.php?code=3'); } require 'includes/classes/class.BuildFunctions.php'; require 'includes/classes/class.PlanetRessUpdate.php'; if (!AJAX_REQUEST && MODE === 'INGAME' && isModuleAvailable(MODULE_FLEET_EVENTS)) { require 'includes/FleetHandler.php'; } $db = Database::get(); $sql = "SELECT \n\tuser.*,\n\tCOUNT(message.message_id) as messages\n\tFROM %%USERS%% as user\n\tLEFT JOIN %%MESSAGES%% as message ON message.message_owner = user.id AND message.message_unread = :unread\n\tWHERE user.id = :userId\n\tGROUP BY message.message_owner;"; $USER = $db->selectSingle($sql, array(':unread' => 1, ':userId' => $session->userId)); if (empty($USER)) { HTTP::redirectTo('index.php?code=3'); } $LNG = new Language($USER['lang']); $LNG->includeData(array('L18N', 'INGAME', 'TECH', 'CUSTOM')); $THEME->setUserTheme($USER['dpath']); if ($config->game_disable == 0 && $USER['authlevel'] == AUTH_USR) { ShowErrorPage::printError($LNG['sys_closed_game'] . '<br><br>' . $config->close_reason, false); } if ($USER['bana'] == 1) {
public function show() { global $USER, $PLANET, $resource, $LNG, $pricelist; $UserDeuterium = $PLANET['deuterium']; $planetID = HTTP::_GP('planetID', 0); $targetMission = HTTP::_GP('mission', 0); $activeSlots = FleetFunctions::GetCurrentFleets($USER['id']); $maxSlots = FleetFunctions::GetMaxFleetSlots($USER); $this->returnData['slots'] = $activeSlots; if (IsVacationMode($USER)) { $this->sendData(620, $LNG['fa_vacation_mode_current']); } if (empty($planetID)) { $this->sendData(601, $LNG['fa_planet_not_exist']); } if ($maxSlots <= $activeSlots) { $this->sendData(612, $LNG['fa_no_more_slots']); } $fleetArray = array(); $db = Database::get(); switch ($targetMission) { case 6: if (!isModuleAvailable(MODULE_MISSION_SPY)) { $this->sendData(699, $LNG['sys_module_inactive']); } $ships = min($USER['spio_anz'], $PLANET[$resource[210]]); if (empty($ships)) { $this->sendData(611, $LNG['fa_no_spios']); } $fleetArray = array(210 => $ships); $this->returnData['ships'][210] = $PLANET[$resource[210]] - $ships; break; case 8: if (!isModuleAvailable(MODULE_MISSION_RECYCLE)) { $this->sendData(699, $LNG['sys_module_inactive']); } $sql = "SELECT (der_metal + der_crystal) as sum FROM %%PLANETS%% WHERE id = :planetID;"; $totalDebris = $db->selectSingle($sql, array(':planetID' => $planetID), 'sum'); $recElementIDs = array(219, 209); $fleetArray = array(); foreach ($recElementIDs as $elementID) { $shipsNeed = min(ceil($totalDebris / $pricelist[$elementID]['capacity']), $PLANET[$resource[$elementID]]); $totalDebris -= $shipsNeed * $pricelist[$elementID]['capacity']; $fleetArray[$elementID] = $shipsNeed; $this->returnData['ships'][$elementID] = $PLANET[$resource[$elementID]] - $shipsNeed; if ($totalDebris <= 0) { break; } } if (empty($fleetArray)) { $this->sendData(611, $LNG['fa_no_recyclers']); } break; default: $this->sendData(610, $LNG['fa_not_enough_probes']); break; } $fleetArray = array_filter($fleetArray); if (empty($fleetArray)) { $this->sendData(610, $LNG['fa_not_enough_probes']); } $sql = "SELECT planet.id_owner as id_owner,\n\t\tplanet.galaxy as galaxy,\n\t\tplanet.system as system,\n\t\tplanet.planet as planet,\n\t\tplanet.planet_type as planet_type,\n\t\ttotal_points, onlinetime, urlaubs_modus, banaday, authattack\n\t\tFROM %%PLANETS%% planet\n\t\tINNER JOIN %%USERS%% user ON planet.id_owner = user.id\n\t\tLEFT JOIN %%STATPOINTS%% as stat ON stat.id_owner = user.id AND stat.stat_type = '1'\n\t\tWHERE planet.id = :planetID;"; $targetData = $db->selectSingle($sql, array(':planetID' => $planetID)); if (empty($targetData)) { $this->sendData(601, $LNG['fa_planet_not_exist']); } if ($targetMission == 6) { if (Config::get()->adm_attack == 1 && $targetData['authattack'] > $USER['authlevel']) { $this->sendData(619, $LNG['fa_action_not_allowed']); } if (IsVacationMode($targetData)) { $this->sendData(605, $LNG['fa_vacation_mode']); } $sql = 'SELECT total_points FROM %%STATPOINTS%% WHERE id_owner = :userId AND stat_type = :statType'; $USER += Database::get()->selectSingle($sql, array(':userId' => $USER['id'], ':statType' => 1)); $IsNoobProtec = CheckNoobProtec($USER, $targetData, $targetData); if ($IsNoobProtec['NoobPlayer']) { $this->sendData(603, $LNG['fa_week_player']); } if ($IsNoobProtec['StrongPlayer']) { $this->sendData(604, $LNG['fa_strong_player']); } if ($USER['id'] == $targetData['id_owner']) { $this->sendData(618, $LNG['fa_not_spy_yourself']); } } $SpeedFactor = FleetFunctions::GetGameSpeedFactor(); $Distance = FleetFunctions::GetTargetDistance(array($PLANET['galaxy'], $PLANET['system'], $PLANET['planet']), array($targetData['galaxy'], $targetData['system'], $targetData['planet'])); $SpeedAllMin = FleetFunctions::GetFleetMaxSpeed($fleetArray, $USER); $Duration = FleetFunctions::GetMissionDuration(10, $SpeedAllMin, $Distance, $SpeedFactor, $USER); $consumption = FleetFunctions::GetFleetConsumption($fleetArray, $Duration, $Distance, $USER, $SpeedFactor); $UserDeuterium -= $consumption; if ($UserDeuterium < 0) { $this->sendData(613, $LNG['fa_not_enough_fuel']); } if ($consumption > FleetFunctions::GetFleetRoom($fleetArray)) { $this->sendData(613, $LNG['fa_no_fleetroom']); } if (connection_aborted()) { exit; } $this->returnData['slots']++; $fleetResource = array(901 => 0, 902 => 0, 903 => 0); $fleetStartTime = $Duration + TIMESTAMP; $fleetStayTime = $fleetStartTime; $fleetEndTime = $fleetStayTime + $Duration; $shipID = array_keys($fleetArray); FleetFunctions::sendFleet($fleetArray, $targetMission, $USER['id'], $PLANET['id'], $PLANET['galaxy'], $PLANET['system'], $PLANET['planet'], $PLANET['planet_type'], $targetData['id_owner'], $planetID, $targetData['galaxy'], $targetData['system'], $targetData['planet'], $targetData['planet_type'], $fleetResource, $fleetStartTime, $fleetStayTime, $fleetEndTime); $this->sendData(600, $LNG['fa_sending'] . " " . array_sum($fleetArray) . " " . $LNG['tech'][$shipID[0]] . " " . $LNG['gl_to'] . " " . $targetData['galaxy'] . ":" . $targetData['system'] . ":" . $targetData['planet'] . " ..."); }
* * @package Antarium * @author Danter14 * @copyright 2015 Danter14 * @license GNU GENERAL PUBLIC LICENSE * @version 1.0 (12/12/2015) * @info Fichier: game.php */ define('MODE', 'INGAME'); define('ROOT_PATH', str_replace('\\', '/', dirname(__FILE__)) . '/'); set_include_path(ROOT_PATH); require 'includes/common.php'; /** @var $LNG Language */ $page = HTTP::_GP('page', 'overview'); $mode = HTTP::_GP('mode', 'show'); $page = str_replace(array('_', '\\', '/', '.', ""), '', $page); $pageClass = 'Show' . ucwords($page) . 'Page'; $pageObj = new $pageClass(); // PHP 5.2 FIX // can't use $pageObj::$requireModule $pageProps = get_class_vars(get_class($pageObj)); if (isset($pageProps['requireModule']) && $pageProps['requireModule'] !== 0 && !isModuleAvailable($pageProps['requireModule'])) { ShowErrorPage::printError($LNG['sys_module_inactive']); } if (!is_callable(array($pageObj, $mode))) { if (!isset($pageProps['defaultController']) || !is_callable(array($pageObj, $pageProps['defaultController']))) { ShowErrorPage::printError($LNG['page_doesnt_exist']); } $mode = $pageProps['defaultController']; } $pageObj->{$mode}();
protected function getPageData() { global $USER, $THEME; if ($this->getWindow() === 'full') { $this->getNavigationData(); $this->getCronjobsTodo(); } $dateTimeServer = new DateTime("now"); if (isset($USER['timezone'])) { try { $dateTimeUser = new DateTime("now", new DateTimeZone($USER['timezone'])); } catch (Exception $e) { $dateTimeUser = $dateTimeServer; } } else { $dateTimeUser = $dateTimeServer; } $config = Config::get(); $this->assign(array('vmode' => $USER['urlaubs_modus'], 'authlevel' => $USER['authlevel'], 'userID' => $USER['id'], 'bodyclass' => $this->getWindow(), 'game_name' => $config->game_name, 'uni_name' => $config->uni_name, 'ga_active' => $config->ga_active, 'ga_key' => $config->ga_key, 'debug' => $config->debug, 'VERSION' => $config->VERSION, 'date' => explode("|", date('Y\\|n\\|j\\|G\\|i\\|s\\|Z', TIMESTAMP)), 'isPlayerCardActive' => isModuleAvailable(MODULE_PLAYERCARD), 'REV' => substr($config->VERSION, -4), 'Offset' => $dateTimeUser->getOffset() - $dateTimeServer->getOffset(), 'queryString' => $this->getQueryString(), 'themeSettings' => $THEME->getStyleSettings())); }
private function GetUserShotcut() { global $USER; if (!isModuleAvailable(MODULE_SHORTCUTS)) { return array(); } $db = Database::get(); $sql = "SELECT * FROM %%SHORTCUTS%% WHERE ownerID = :userID;"; $ShortcutResult = $db->select($sql, array(':userID' => $USER['id'])); $ShortcutList = array(); foreach ($ShortcutResult as $ShortcutRow) { $ShortcutList[$ShortcutRow['shortcutID']] = $ShortcutRow; } return $ShortcutList; }
protected function getPlanetData() { $this->galaxyData[$this->galaxyRow['planet']]['planet'] = array('id' => $this->galaxyRow['id'], 'name' => htmlspecialchars($this->galaxyRow['name'], ENT_QUOTES, "UTF-8"), 'image' => $this->galaxyRow['image'], 'phalanx' => isModuleAvailable(MODULE_PHALANX) && ShowPhalanxPage::allowPhalanx($this->galaxyRow['galaxy'], $this->galaxyRow['system'])); }
function TargetEvent() { global $pricelist, $reslist, $resource; $db = Database::get(); $sql = 'SELECT * FROM %%USERS%% WHERE id = :userId;'; $senderUser = $db->selectSingle($sql, array(':userId' => $this->_fleet['fleet_owner'])); $targetUser = $db->selectSingle($sql, array(':userId' => $this->_fleet['fleet_target_owner'])); $sql = 'SELECT * FROM %%PLANETS%% WHERE id = :planetId;'; $targetPlanet = $db->selectSingle($sql, array(':planetId' => $this->_fleet['fleet_end_id'])); $sql = 'SELECT name FROM %%PLANETS%% WHERE id = :planetId;'; $senderPlanetName = $db->selectSingle($sql, array(':planetId' => $this->_fleet['fleet_start_id']), 'name'); $LNG = $this->getLanguage($senderUser['lang']); $senderUser['factor'] = getFactors($senderUser, 'basic', $this->_fleet['fleet_start_time']); $targetUser['factor'] = getFactors($targetUser, 'basic', $this->_fleet['fleet_start_time']); $planetUpdater = new ResourceUpdate(); list($targetUser, $targetPlanet) = $planetUpdater->CalcResource($targetUser, $targetPlanet, true, $this->_fleet['fleet_start_time']); $sql = 'SELECT * FROM %%FLEETS%% WHERE fleet_end_id = :planetId AND fleet_mission = 5 AND fleet_end_stay > :time;'; $targetStayFleets = $db->select($sql, array(':planetId' => $this->_fleet['fleet_end_id'], ':time' => $this->_fleet['fleet_start_time'])); foreach ($targetStayFleets as $fleetRow) { $fleetData = FleetFunctions::unserialize($fleetRow['fleet_array']); foreach ($fleetData as $shipId => $shipAmount) { $targetPlanet[$resource[$shipId]] += $shipAmount; } } $fleetAmount = $this->_fleet['fleet_amount'] * (1 + $senderUser['factor']['SpyPower']); $senderSpyTech = max($senderUser['spy_tech'], 1); $targetSpyTech = max($targetUser['spy_tech'], 1); $techDifference = abs($senderSpyTech - $targetSpyTech); $MinAmount = ($senderSpyTech > $targetSpyTech ? -1 : 1) * pow($techDifference * SPY_DIFFENCE_FACTOR, 2); $SpyFleet = $fleetAmount >= $MinAmount; $SpyDef = $fleetAmount >= $MinAmount + 1 * SPY_VIEW_FACTOR; $SpyBuild = $fleetAmount >= $MinAmount + 3 * SPY_VIEW_FACTOR; $SpyTechno = $fleetAmount >= $MinAmount + 5 * SPY_VIEW_FACTOR; $classIDs[900] = array_merge($reslist['resstype'][1], $reslist['resstype'][2]); if ($SpyFleet) { $classIDs[200] = $reslist['fleet']; } if ($SpyDef) { $classIDs[400] = array_merge($reslist['defense'], $reslist['missile']); } if ($SpyBuild) { $classIDs[0] = $reslist['build']; } if ($SpyTechno) { $classIDs[100] = $reslist['tech']; } $targetChance = mt_rand(0, min($fleetAmount / 4 * ($targetSpyTech / $senderSpyTech), 100)); $spyChance = mt_rand(0, 100); $spyData = array(); foreach ($classIDs as $classID => $elementIDs) { foreach ($elementIDs as $elementID) { if (isset($targetUser[$resource[$elementID]])) { $spyData[$classID][$elementID] = $targetUser[$resource[$elementID]]; } else { $spyData[$classID][$elementID] = $targetPlanet[$resource[$elementID]]; } } if ($senderUser['spyMessagesMode'] == 1) { $spyData[$classID] = array_filter($spyData[$classID]); } } // I'm use template class here, because i want to exclude HTML in PHP. require_once 'includes/classes/class.template.php'; $template = new template(); $template->caching = true; $template->compile_id = $senderUser['lang']; $template->loadFilter('output', 'trimwhitespace'); list($tplDir) = $template->getTemplateDir(); $template->setTemplateDir($tplDir . 'game/'); $template->assign_vars(array('spyData' => $spyData, 'targetPlanet' => $targetPlanet, 'targetChance' => $targetChance, 'spyChance' => $spyChance, 'isBattleSim' => ENABLE_SIMULATOR_LINK == true && isModuleAvailable(MODULE_SIMULATOR), 'title' => sprintf($LNG['sys_mess_head'], $targetPlanet['name'], $targetPlanet['galaxy'], $targetPlanet['system'], $targetPlanet['planet'], _date($LNG['php_tdformat'], $this->_fleet['fleet_end_time'], $targetUser['timezone'], $LNG)))); $template->assign_vars(array('LNG' => $LNG), false); $spyReport = $template->fetch('shared.mission.spyReport.tpl'); PlayerUtil::sendMessage($this->_fleet['fleet_owner'], 0, $LNG['sys_mess_qg'], 0, $LNG['sys_mess_spy_report'], $spyReport, $this->_fleet['fleet_start_time'], NULL, 1, $this->_fleet['fleet_universe']); $LNG = $this->getLanguage($targetUser['lang']); $targetMessage = $LNG['sys_mess_spy_ennemyfleet'] . " " . $senderPlanetName; if ($this->_fleet['fleet_start_type'] == 3) { $targetMessage .= $LNG['sys_mess_spy_report_moon'] . ' '; } $text = '<a href="game.php?page=galaxy&galaxy=%1$s&system=%2$s">[%1$s:%2$s:%3$s]</a> %7$s %8$s <a href="game.php?page=galaxy&galaxy=%4$s&system=%5$s">[%4$s:%5$s:%6$s]</a> %9$s'; $targetMessage .= sprintf($text, $this->_fleet['fleet_start_galaxy'], $this->_fleet['fleet_start_system'], $this->_fleet['fleet_start_planet'], $this->_fleet['fleet_end_galaxy'], $this->_fleet['fleet_end_system'], $this->_fleet['fleet_end_planet'], $LNG['sys_mess_spy_seen_at'], $targetPlanet['name'], $LNG['sys_mess_spy_seen_at2']); PlayerUtil::sendMessage($this->_fleet['fleet_target_owner'], 0, $LNG['sys_mess_spy_control'], 0, $LNG['sys_mess_spy_activity'], $targetMessage, $this->_fleet['fleet_start_time'], NULL, 1, $this->_fleet['fleet_universe']); if ($targetChance >= $spyChance) { $config = Config::get($this->_fleet['fleet_universe']); $whereCol = $this->_fleet['fleet_end_type'] == 3 ? "id_luna" : "id"; $sql = 'UPDATE %%PLANETS%% SET der_metal = der_metal + :metal, der_crystal = der_crystal + :crystal WHERE ' . $whereCol . ' = :planetId;'; $db->update($sql, array(':metal' => $fleetAmount * $pricelist[210]['cost'][901] * $config->Fleet_Cdr / 100, ':crystal' => $fleetAmount * $pricelist[210]['cost'][902] * $config->Fleet_Cdr / 100, ':planetId' => $this->_fleet['fleet_end_id'])); $this->KillFleet(); } else { $this->setState(FLEET_RETURN); $this->SaveFleet(); } }
function getUserImLink($sUserId) { return isModuleAvailable("messenger", $sUserId, ACTION_ID_USE_MESSENGER) ? "im/sender=#owner#&password=#password#&recipient=#user#/#nick#/10,10,550,500/true" : ""; }
public static function GetAvailableMissions($USER, $MissionInfo, $GetInfoPlanet) { $YourPlanet = !empty($GetInfoPlanet['id_owner']) && $GetInfoPlanet['id_owner'] == $USER['id'] ? true : false; $UsedPlanet = !empty($GetInfoPlanet['id_owner']) ? true : false; $availableMissions = array(); if ($MissionInfo['planet'] == Config::get($USER['universe'])->max_planets + 1 && isModuleAvailable(MODULE_MISSION_EXPEDITION)) { $availableMissions[] = 15; } elseif ($MissionInfo['planettype'] == 2) { if ((isset($MissionInfo['Ship'][209]) || isset($MissionInfo['Ship'][219])) && isModuleAvailable(MODULE_MISSION_RECYCLE) && !($GetInfoPlanet['der_metal'] == 0 && $GetInfoPlanet['der_crystal'] == 0)) { $availableMissions[] = 8; } } else { if (!$UsedPlanet) { if (isset($MissionInfo['Ship'][208]) && $MissionInfo['planettype'] == 1 && isModuleAvailable(MODULE_MISSION_COLONY)) { $availableMissions[] = 7; } } else { if (isModuleAvailable(MODULE_MISSION_TRANSPORT)) { $availableMissions[] = 3; } if (!$YourPlanet && self::OnlyShipByID($MissionInfo['Ship'], 210) && isModuleAvailable(MODULE_MISSION_SPY)) { $availableMissions[] = 6; } if (!$YourPlanet) { if (isModuleAvailable(MODULE_MISSION_ATTACK)) { $availableMissions[] = 1; } if (isModuleAvailable(MODULE_MISSION_HOLD)) { $availableMissions[] = 5; } } elseif (isModuleAvailable(MODULE_MISSION_STATION)) { $availableMissions[] = 4; } if (!empty($MissionInfo['IsAKS']) && !$YourPlanet && isModuleAvailable(MODULE_MISSION_ATTACK) && isModuleAvailable(MODULE_MISSION_ACS)) { $availableMissions[] = 2; } if (!$YourPlanet && $MissionInfo['planettype'] == 3 && isset($MissionInfo['Ship'][214]) && isModuleAvailable(MODULE_MISSION_DESTROY)) { $availableMissions[] = 9; } if ($YourPlanet && $MissionInfo['planettype'] == 3 && self::OnlyShipByID($MissionInfo['Ship'], 220) && isModuleAvailable(MODULE_MISSION_DARKMATTER)) { $availableMissions[] = 11; } } } return $availableMissions; }
public function show() { global $USER, $PLANET, $resource, $reslist, $LNG, $pricelist; $updateID = HTTP::_GP('id', 0); if (!empty($updateID) && $_SERVER['REQUEST_METHOD'] === 'POST' && $USER['urlaubs_modus'] == 0) { if (isModuleAvailable(MODULE_OFFICIER) && in_array($updateID, $reslist['officier'])) { $this->UpdateOfficier($updateID); } elseif (isModuleAvailable(MODULE_DMEXTRAS) && in_array($updateID, $reslist['dmfunc'])) { $this->UpdateExtra($updateID); } } $darkmatterList = array(); $officierList = array(); if (isModuleAvailable(MODULE_DMEXTRAS)) { foreach ($reslist['dmfunc'] as $Element) { if ($USER[$resource[$Element]] > TIMESTAMP) { $this->tplObj->execscript("GetOfficerTime(" . $Element . ", " . ($USER[$resource[$Element]] - TIMESTAMP) . ");"); } $costResources = BuildFunctions::getElementPrice($USER, $PLANET, $Element); $buyable = BuildFunctions::isElementBuyable($USER, $PLANET, $Element, $costResources); $costOverflow = BuildFunctions::getRestPrice($USER, $PLANET, $Element, $costResources); $elementBonus = BuildFunctions::getAvalibleBonus($Element); $darkmatterList[$Element] = array('timeLeft' => max($USER[$resource[$Element]] - TIMESTAMP, 0), 'costResources' => $costResources, 'buyable' => $buyable, 'time' => $pricelist[$Element]['time'], 'costOverflow' => $costOverflow, 'elementBonus' => $elementBonus); } } if (isModuleAvailable(MODULE_OFFICIER)) { foreach ($reslist['officier'] as $Element) { if (!BuildFunctions::isTechnologieAccessible($USER, $PLANET, $Element)) { continue; } $costResources = BuildFunctions::getElementPrice($USER, $PLANET, $Element); $buyable = BuildFunctions::isElementBuyable($USER, $PLANET, $Element, $costResources); $costOverflow = BuildFunctions::getRestPrice($USER, $PLANET, $Element, $costResources); $elementBonus = BuildFunctions::getAvalibleBonus($Element); $officierList[$Element] = array('level' => $USER[$resource[$Element]], 'maxLevel' => $pricelist[$Element]['max'], 'costResources' => $costResources, 'buyable' => $buyable, 'costOverflow' => $costOverflow, 'elementBonus' => $elementBonus); } } $this->assign(array('officierList' => $officierList, 'darkmatterList' => $darkmatterList, 'of_dm_trade' => sprintf($LNG['of_dm_trade'], $LNG['tech'][921]))); $this->display('page.officier.default.tpl'); }
* @author Jan Kröpke <*****@*****.**> * @copyright 2012 Jan Kröpke <*****@*****.**> * @licence MIT * @version 1.7.2 (2013-03-18) * @info $Id$ * @link http://2moons.cc/ */ define('MODE', 'BANNER'); define('ROOT_PATH', str_replace('\\', '/', dirname(__FILE__)) . '/'); set_include_path(ROOT_PATH); if (!extension_loaded('gd')) { clearGIF(); } require 'includes/common.php'; $id = HTTP::_GP('id', 0); if (!isModuleAvailable(MODULE_BANNER) || $id == 0) { clearGIF(); } $LNG = new Language(); $LNG->getUserAgentLanguage(); $LNG->includeData(array('L18N', 'BANNER', 'CUSTOM')); require 'includes/classes/class.StatBanner.php'; $banner = new StatBanner(); $Data = $banner->GetData($id); if (!isset($Data) || !is_array($Data)) { clearGIF(); } $ETag = md5(implode('', $Data)); header('ETag: ' . $ETag); if (isset($_SERVER['HTTP_IF_NONE_MATCH']) && $_SERVER['HTTP_IF_NONE_MATCH'] == $ETag) { HTTP::sendHeader('HTTP/1.0 304 Not Modified');