array('http://www.wowwiki.com/Midsummer_Fire_Festival', 'http://www.worldofwarcraft.com/info/events/midsummer/'), 2 => array('http://www.wowwiki.com/Feast_of_Winter_Veil', 'http://www.worldofwarcraft.com/info/events/winterveil/'), 3 => array('http://www.wowwiki.com/Darkmoon_Faire', 'http://www.worldofwarcraft.com/info/basics/factions/darkmoon/'), 4 => array('http://www.wowwiki.com/Darkmoon_Faire', 'http://www.worldofwarcraft.com/info/basics/factions/darkmoon/'), 5 => array('http://www.wowwiki.com/Darkmoon_Faire', 'http://www.worldofwarcraft.com/info/basics/factions/darkmoon/'), 6 => array('http://www.wowwiki.com/New_Year', 'http://www.worldofwarcraft.com/info/events/newyears/'), 7 => array('http://www.wowwiki.com/Lunar_Festival', 'http://www.worldofwarcraft.com/info/events/lunarnewyears/'), 8 => array('http://www.wowwiki.com/Love_is_in_the_Air', 'http://www.worldofwarcraft.com/info/events/loveisintheair/'), 9 => array('http://www.wowwiki.com/Noblegarden', 'http://www.worldofwarcraft.com/community/ingameevents.html#noblegarden'), 10 => array('http://www.wowwiki.com/Children%27s_Week', 'http://www.worldofwarcraft.com/info/events/childrensweek/'), 11 => array('http://www.wowwiki.com/Harvest_Festival', 'http://www.worldofwarcraft.com/info/events/harvestfestival/'), 12 => array('http://www.wowwiki.com/Hallow%27s_End', 'http://www.worldofwarcraft.com/info/events/hallowsend/'), 13 => array('http://www.wowwiki.com/Elemental_Invasions', 'http://www.worldofwarcraft.com/community/ingameevents.html#elemental'), 14 => array('http://www.wowwiki.com/Stranglethorn_Fishing_Extravaganza', 'http://www.worldofwarcraft.com/info/events/fishing/'), 15 => array('http://www.wowwiki.com/Stranglethorn_Fishing_Extravaganza', 'http://www.worldofwarcraft.com/info/events/fishing/'), 16 => array('http://www.wowwiki.com/Gurubashi_Arena#Gurubashi_Arena_Booty_Run', 'http://www.worldofwarcraft.com/community/ingameevents.html#gurubashi'), 17 => array('http://www.wowwiki.com/The_Scourge_Invasion', 'http://www.worldofwarcraft.com/info/events/scourgeinvasion/'), 18 => array('', 'http://www.worldofwarcraft.com/community/ingameevents.html#calltoarms'), 19 => array('', 'http://www.worldofwarcraft.com/community/ingameevents.html#calltoarms'), 20 => array('', 'http://www.worldofwarcraft.com/community/ingameevents.html#calltoarms'), 21 => array('', 'http://www.worldofwarcraft.com/community/ingameevents.html#calltoarms'), 22 => array('http://www.wowwiki.com/Ahn%27Qiraj_War_Effort', 'http://www.worldofwarcraft.com/wareffort/servers.html'), 23 => array('', ''), 24 => array('', ''), 25 => array('', 'http://www.worldofwarcraft.com/community/ingameevents.html#calltoarms'), 26 => array('http://www.wowwiki.com/Brewfest', 'http://www.worldofwarcraft.com/info/events/brewfest/'), 27 => array('', ''), 28 => array('http://www.wowwiki.com/Noblegarden', 'http://www.worldofwarcraft.com/community/ingameevents.html#noblegarden'), 29 => array('http://www.wowwiki.com/Edge_of_Madness', ''), 30 => array('http://www.wowwiki.com/Edge_of_Madness', ''), 31 => array('http://www.wowwiki.com/Edge_of_Madness', ''), 32 => array('http://www.wowwiki.com/Edge_of_Madness', ''), 33 => array('http://www.wowwiki.com/Arena_Tournament', ''), 34 => array('http://www.wowwiki.com/L70ETC', ''), ); function Events() { global $Database, $EventsLinks, $Config; $Events = array('Running' => array(), 'Planned' => array()); $Database->select_db($Config['Mangos']['DatabaseMangos']); // Add already started events $DbResult = $Database->select('game_event', '*, UNIX_TIMESTAMP(start_time) as start', 'end_time > NOW() AND start_time < NOW()'); while($Row = $DbResult->fetch_array()) { if(!array_key_exists($Row['entry'], $EventsLinks)) $EventsLinks[$Row['entry']] = array('', ''); $Start = (floor((time() - $Row['start']) / ($Row['occurence'] * 60))) * $Row['occurence'] * 60 + $Row['start']; $End = $Start + $Row['length'] * 60; if((time() > $Start) and (time() < $End)) $EventState = 'Running'; else { $EventState = 'Planned'; $Start += $Row['occurence'] * 60; $End += $Row['occurence'] * 60; } $Events[$EventState][$Row['start']] = array('StartTime' => $Start, 'EndTime' => $End, 'Title' => $Row['description'], 'WoWWiki' => $EventsLinks[$Row['entry']][0], 'Official' => $EventsLinks[$Row['entry']][1]); } // Add events not started so far $DbResult = $Database->select('game_event', '*, UNIX_TIMESTAMP(start_time) as start', 'start_time > NOW()'); while($Row = $DbResult->fetch_array()) { if(!array_key_exists($Row['entry'], $EventsLinks)) $EventsLinks[$Row['entry']] = array('', ''); $Events['Planned'][$Row['start']] = array('StartTime' => $Row['start'], 'EndTime' => ($Row['start'] + $Row['length'] * 60), 'Title' => $Row['description'], 'WoWWiki' => $EventsLinks[$Row['entry']][0], 'Official' => $EventsLinks[$Row['entry']][1]); } sort($Events['Running']); sort($Events['Planned']); return($Events); } function ShowEventList($Events) { foreach($Events as $Event) { echo(''.$Event['Title'].''.date('j.n.Y H:i', $Event['StartTime']).''.date('j.n.Y H:i', $Event['EndTime']).''); if($Event['WoWWiki'] != '') echo('wowwiki'); else echo(' '); if($Event['Official'] != '') echo('worldofwarcraft'); else echo(' '); echo(''); } } ShowHeader(); echo('

Události ve hře:

'); $Events = Events(); echo(''); echo(''); echo(''); ShowEventList($Events['Running']); echo(''); ShowEventList($Events['Planned']); echo('
NázevZačátekKonecInformaceInformace
Aktuálně běžící akce
Plánované akce
'); ShowFooter(); ?>