<?php



//require_once("config.php");
//require_once("defs.php");
//require_once("modules/Event.php");
//require_once("modules/Gallery.php");
//require_once("modules/News.php");
//require_once("header.php");
?>
<div id="content">
<div id="homepage_panels">
	<div id="hero_panel">
		<img src="images/hero_2_landing.jpg" alt="Druchii ships landing on the coast of the Blighted Isle" />
		<span id="hero_alt_content"> 
			<h4>We've landed!</h4>
			<p>WAR has arrived! The Humberton Blackguard and the rest of the stranglehold alliance are staking their 
			   claim on the keeps and battlefields of the Karag Hirn server.</p> 
			<p>WAAAAAAAAAAAAAAAAAAAAGH! </p>
		</span>
		<a href="../phpBB2/viewtopic.php?t=6091" id="read_more"><img src="images/read_more.png" width="154" height="49" alt="Read more..." /></a>		
	</div>
	<div id="news_panel">
		<?php $news=News::getLatestNews();
		  foreach($news as $n){?>
				<div class="news_article">		
				<h4><a href="../phpBB2/<?php print $n->url?>"><?php print htmlentities($n->title)?></a></h4>
				<p><?php print htmlentities($n->intro)?></p>		
				<a href="../phpBB2/<?php print $n->url?>">Read more...</a>
				</div>
		<?php }?>			
		<a href="../phpBB2/" class="panel_link"><img src="images/visit_forums.png" width="192" height="47" alt="Visit the forums" /></a>		
	</div>
	<div id="feature_panel3" class="panel">
		<a href="roster.php"><img id="roster_float" src="images/panel_roster2.png" width="266" height="320" alt="Roster" /></a>
		<!--img id="coming_soon" src="images/coming_soon.png" alt="Coming soon" width="266" height="206" /-->
		
	</div>
	<div id="feature_panel1" class="panel wide_panel">
		<h4><img src="images/panel_title_gallery.jpg" alt="Gallery" width="95" height="25" /></h4>
		<div class="gallery_feature">
			<?php
			$g=Gallery::getLatestImage();
			$g=$g[0];
			?>
			
			<a class="lightbox_link" href="uploads/<?php print $g->id?>_main.png"><img src="uploads/<?php print $g->id?>_thumbnail.png" alt="<?php print htmlentities($g->title)?>" width="150" height="113" /></a>
			<h4><?php print htmlentities(stripslashes($g->title))?></h4>
			<p><?php print htmlentities(stripslashes($g->description))?></p>
			<span class="poster">Posted by <?php print $g->getAuthorName()?><br/> on <?php print date("jS F Y",$g->createDate)?></span> 
		</div>
		<a href="gallery.php" class="panel_link"><img src="images/view_gallery.png" width="160" height="49" alt="View gallery" /></a>				
	</div>
	
	<script>
	eventDays=[];
	monthStr='';
	</script>
	<div id="feature_panel2" class="panel last_panel">
		<h4><img src="images/panel_title_events.jpg" alt="Events" width="91" height="23" /></h4>
		<?php 
		  $events=Event::getLatestEvents();
			foreach($events as $ev){
			$dateStr=date("l jS F Y",$ev->eventDate);
			$desc=$ev->description;
			if(strlen($desc)>100) $desc=substr($desc,0,98,"...");
		?>
			<div class="event_article">
				<h4><?php print $dateStr?><br/><a href="#" onClick="showDay('<?php print $dateStr?>'); return false;"><?php print htmlentities($ev->title)?></a></h4>
				<p><?php print htmlentities($desc)?></p>		
				<a href="#" onClick="showDay('<?php print $dateStr?>'); return false;">Read more...</a>
				<script>addEvent('<?php print $dateStr?>','<h4><?php print $ev->getEventTime()?> UK time - <?php print htmlentities(stripslashes($ev->title))?></h4><p><?php print str_replace("\r","\\r",str_replace("\n","\\n",htmlentities($ev->description)))?></p><p class="poster">Posted by <?php print $ev->getAuthorName()?> on <?php print date("jS F Y",$ev->createDate)?></p>');</script>
			</div>
		<?php }?>		
		<a href="events.php" class="panel_link"><img src="images/event_calendar.png" width="181" height="45" alt="Event calendar" /></a>				
	</div>
	
	<div id="forum_link_fix"><a href="../phpBB2/">&nbsp;</a></div>			
		
</div>

<?php
//require_once("footer.php");