<div class="mt2cms2-c-l">
    <div class="page-hd">
        <div class="bd-c">
				<div id="filters">
					<?php
						$cat = 0;
						if(isset($_GET['category']) && (int)$_GET['category']>0 && (int)$_GET['category']<=3)
							$cat = $_GET['category'];
						$categories = array("ALL", "NEWS", "EVENTS", "UPDATES");
						
						foreach($categories as $key=>$value)
							if($key==$cat)
								print '<a href="'.$site_url.'news/'.$key.'/1"><button id="button_news_active">'.$value.'</button></a>';
							else
								print '<a href="'.$site_url.'news/'.$key.'/1"><button id="button_news">'.$value.'</button></a>';
					?>
				</div>
			<?php if($offline) print '</br><div id="page_title"><strong><font color="red">'.$lang['server-offline'].'</font></strong></div>' ?>
        </div>
    </div>
	<div id="page_content">
		<div class="bd-c">
			<div class="post fade_in article">
				<div id="page_title"><a href="<?php print $social_links['facebookgroup']; ?>">Join our Facebook Group</a> <img src="<?php print $site_url; ?>img/buttons/icon_facebookg.png"></img></div>
				<div id="page_title"><a href="<?php print $social_links['twitch']; ?>">Follow us on Twitch</a> <img src="<?php print $site_url; ?>img/buttons/icon_twitch.png"></img></div>
				<div id="page_title"><a href="<?php print $social_links['facebook']; ?>">Follow us on Facebook</a> <img src="<?php print $site_url; ?>img/buttons/icon_facebook.png"></img></div>
				<div class="post_content">
				</div>
			</div>
			</br>
		<?php
			if(!$offline && $database->is_loggedin())
				if($web_admin>=$jsondataPrivileges['news'])
					include 'include/functions/add-news.php';
		?>
				<?php
				if (version_compare($php_version = phpversion(), '5.6.0', '<')) {
				?>
				<div class="alert alert-danger alert-dismissible fade in" role="alert">
					<button type="button" class="close" data-dismiss="alert" aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
					<span>Metin2CMS works with a PHP version >= 5.6.0. At this time, the server is running version <?php print $php_version; ?>.</span>
				</div>
				<?php
				}
					$query = "SELECT * FROM news ORDER BY id DESC";
					if($cat)
						$query = "SELECT * FROM news WHERE category = ".$cat." ORDER BY id DESC";

					$records_per_page=intval(getJsonSettings("news"));
					$newquery = $paginate->paging($query,$records_per_page);
					$paginate->dataview($newquery, $lang['sure?'], $web_admin, $jsondataPrivileges['news'], $site_url, $lang['read-more']);
					$paginate->paginglink($query,$records_per_page,$lang['first-page'],$lang['last-page'],$site_url, $cat);		
				?>
		</div>
    </div>
</div>