<?php
/**
 * WebEngine CMS
 * https://webenginecms.org/
 * 
 * @version 1.2.2
 * @author Lautaro Angelico <http://lautaroangelico.com/>
 * @copyright (c) 2013-2020 Lautaro Angelico, All Rights Reserved
 * 
 * Licensed under the MIT license
 * http://opensource.org/licenses/MIT
 */

if(!defined('access') or !access) die();
?>
<!DOCTYPE html>
<html>
	<head>
	<meta charset="utf-8"/>
	<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-F4T4VHJHFZ"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'G-F4T4VHJHFZ');
</script>
	<title><?php $handler->websiteTitle(); ?></title>
	<meta name="generator" content="WebEngine <?php echo __WEBENGINE_VERSION__; ?>"/>
	<meta name="author" content="Lautaro Angelico"/>
	<meta name="description" content="<?php config('website_meta_description'); ?>"/>
	<meta name="keywords" content="<?php config('website_meta_keywords'); ?>"/>
	<meta property="og:type" content="website" />
	<meta property="og:title" content="<?php $handler->websiteTitle(); ?>" />
	<meta property="og:description" content="<?php config('website_meta_description'); ?>" />
	<meta property="og:image" content="<?php echo __PATH_IMG__; ?>webengine.jpg" />
	<meta property="og:url" content="<?php echo __BASE_URL__; ?>" />
	<meta property="og:site_name" content="<?php $handler->websiteTitle(); ?>" />
	<link rel="shortcut icon" href="<?php echo __PATH_TEMPLATE_IMG__; ?>logo-mini.png">
	<meta name="viewport" content="width=1240, maximum-scale=1">
	
	<link href="<?php echo __PATH_TEMPLATE_CSS__; ?>bootstrap.min.css" rel="stylesheet" media="screen">	
	<link href="<?php echo __PATH_TEMPLATE_CSS__; ?>slick.css" rel="stylesheet" media="screen">
	<link href="<?php echo __PATH_TEMPLATE_CSS__; ?>slick-theme.css" rel="stylesheet" media="screen">
	<link href="<?php echo __PATH_TEMPLATE_CSS__; ?>webengine.css" rel="stylesheet" media="screen">
	<link href="<?php echo __PATH_TEMPLATE_CSS__; ?>profiles.css" rel="stylesheet" media="screen">
	<link href="<?php echo __PATH_TEMPLATE_CSS__; ?>override.css" rel="stylesheet" media="screen">	
	<link href="<?php echo __PATH_TEMPLATE_CSS__; ?>heaven-swiper.min.css" rel="stylesheet" media="screen">	
	<link href="<?php echo __PATH_TEMPLATE_CSS__; ?>heaven-style.css" rel="stylesheet" media="screen">	
	<script src="<?php echo __PATH_TEMPLATE_JS__; ?>heaven-modalx.js"></script>
	

	<script>
			var baseUrl = '<?php echo __BASE_URL__; ?>';
	</script>
</head>

<body>
	<div class="topPanel">
		<div class="topPanel-wrapper flex-s-c">
			<div class="topPanel-wrapper_left flex-c">
				<a href="<?php echo __BASE_URL__; ?>" class="logo-mini bright"><img src="<?php echo __PATH_TEMPLATE_IMG__; ?>logo-mini.png" alt="logo"></a>
				
				<?php templateBuildNavbar(); ?>
			</div>
				<div class="topPanel-wrapper_right flex-c">
				<?php if(isLoggedIn()) { ?>
					<a href="<?php echo __BASE_URL__; ?>usercp/myaccount" class="button"><?php echo lang('menu_txt_5'); ?></a>
					<a href="<?php echo __BASE_URL__; ?>logout" class="button";><?php echo lang('menu_txt_6'); ?></a>
					<?php } else { ?>
					<a href="<?php echo __BASE_URL__; ?>register" class="button"><?php echo lang('menu_txt_3'); ?></a>
					<a href="" class="button" onclick="new modal('#signin_modal');return false";><?php echo lang('menu_txt_4'); ?></a>
					<?php } ?>
				</div>	
		</div>
		<!--topPanel-wrapper-->
	</div>
	<!--topPanel-->
	<div class="wrapper">
		<header>
			<div class="ani stone s1 on"></div>
			<div class="ani stone s2 on"></div>
			<div class="ani stone s3 on"></div>
			<div class="ani stone s4 on"></div>
			<div class="small-light">
			</div>
			<div class="logo">
				<a href="<?php echo __BASE_URL__; ?>" class="bright"><img src="<?php echo __PATH_TEMPLATE_IMG__; ?>logo.png" alt="Logo"></a>
			</div>
			<!--logo-->
			<div class="headerBlock flex-s-c">
				<div class="headerButtons radial">
					<div class="radial-stat ">
						<div class="circle-online">
							<div class="serverInfo">
								<span class="serverInfo__name">MuFUN<br>players<br></span>
								<span class="serverInfo__online"><?php echo number_format($srvInfo[3]); ?><br>ONLINE</span>
							</div>
							 <div class="circlestat" data-dimension="124" data-width="3.5" data-fontsize="12" data-percent="<?php echo number_format($srvInfo[3]); ?>" data-fgcolor="#08CB17" data-bgcolor="rgba(192, 209, 7, 0.2)" style="width: 124px;"></div> 
						</div>
			<!-- circle-online -->
					</div>
					<!-- radial-stat -->
				</div>
				<!--headerButtons-->
				<div class="download-buttons flex-s-c">
					<style>
						.header-info-container {
							display: inline-block;
							width: 350px;
							background: rgba(0, 0, 0, 0.3);
							backdrop-filter: blur(5px);
							margin: 0px;
							padding: 20px;
							overflow: auto;
							-moz-box-shadow: 0 0 15px rgba(0, 0, 0, 0.7);
							-webkit-box-shadow: 0 0 15px rgba(0, 0, 0, 0.7);
							box-shadow: 0 0 15px rgba(0, 0, 0, 0.7);
							-webkit-border-radius: 5px;
							-moz-border-radius: 5px;
							border-radius: 5px;
							-khtml-border-radius: 5px;
							text-shadow: 1px 1px 3px #000000;
							color: #ffffff;
							border: 1px solid rgba(255, 255, 255, 0.1);
							font-size: 12px;
						}
					</style>
					<div class="status-block header-info-container">
						<div class="server-bottom">
							<div class="flex-s-c" style="margin-bottom: 10px;">
								<span class="server-name">Server Time</span> <span><time id="tServerTime">&nbsp;</time> <span id="tServerDate">&nbsp;</span></span>
							</div>

							<div class="flex-s-c" style="margin-bottom: 10px;">
								<span class="server-name">Your Time</span> <span><time id="tLocalTime">&nbsp;</time> <span id="tLocalDate">&nbsp;</span></span>
							</div>

							 <br> 
							 	<div class="flex-s-c" style="width: 300px;"> 
							 		<span style="color:#fff;" class="server-name">Switch Language</span> 
							 		<div> 
							 			<a class="server-name" href="<?php echo __BASE_URL__; ?>language/switch/to/en" data-toggle="tooltip" data-placement="top" title="" data-original-title="English"><img src="<?php echo __PATH_IMG__; ?>flags/us.gif"></a>  
							 			<a class="server-name" href="<?php echo __BASE_URL__; ?>language/switch/to/es" data-toggle="tooltip" data-placement="top" title="" data-original-title="Español"><img src="<?php echo __PATH_IMG__; ?>flags/es.gif"></a>  
							 			<a class="server-name" href="<?php echo __BASE_URL__; ?>language/switch/to/ph" data-toggle="tooltip" data-placement="top" title="" data-original-title="Filipino"><img src="<?php echo __PATH_IMG__; ?>flags/ph.gif"></a> 
							 			<a class="server-name" href="<?php echo __BASE_URL__; ?>language/switch/to/pt" data-toggle="tooltip" data-placement="top" title="" data-original-title="Português"><img src="<?php echo __PATH_IMG__; ?>flags/br.gif"></a>
							 			<a class="server-name" href="<?php echo __BASE_URL__; ?>language/switch/to/ro" data-toggle="tooltip" data-placement="top" title="" data-original-title="Romanian"><img src="<?php echo __PATH_IMG__; ?>flags/ro.gif"></a> 
							 			<a class="server-name" href="<?php echo __BASE_URL__; ?>language/switch/to/ru" data-toggle="tooltip" data-placement="top" title="" data-original-title="Russian"><img src="<?php echo __PATH_IMG__; ?>flags/ru.gif"></a>  
							 		</div> 
							 	</div>

							<div class="col-xs-12">                                                                                         
								<div class="webengine-online-bar">                                                                          
									<div class="webengine-online-bar-progress" style="width:<?php echo $onlinePlayersPercent; ?>%;"></div>  
								</div>                                                                                                      
							</div>                                                                                                           
							
					</div>
					</div>
					
					<div class="status-block header-info-container">
<div class="lunatico">
  <div class="lunatico_dev2"> <a href="https://discord.gg/Qffv5PC4AR"><img src="<?php echo __PATH_TEMPLATE_IMG__; ?>discord.png" alt=""></a></div>
  <div class="lunatico_dev2"> <a href="<?php echo __BASE_URL__; ?>"><img src="<?php echo __PATH_TEMPLATE_IMG__; ?>instagram.png" alt=""></a></div>
  <div class="lunatico_dev2"> <a href="https://www.facebook.com/MuFUN.Season6Plus" target="_blank"><img src="<?php echo __PATH_TEMPLATE_IMG__; ?>facebook.png" alt=""></a></div>
  <div class="lunatico_dev2"> <a href="https://api.whatsapp.com/send?phone=37379166405&text=HELLO%20MuFUN" target="_blank"><img src="<?php echo __PATH_TEMPLATE_IMG__; ?>whatsapp.png" alt=""></a></div>  
</div>
					</div>
					
					<a href="<?php echo __BASE_URL__; ?>downloads" class="h-button download">
						<p><?php echo lang('menu_txt_7'); ?></p>
						<span>Game client 932.3 MB</span>
					</a>
				</div>
			</div>
			<!--headerBlock-->
			<!-- animations -->
			<div class="sparks2">
				<div class="spark_11"></div>
				<div class="spark_22"></div>
				<div class="spark_33"></div>
				<div class="spark_44 spark-big2"></div>
				<div class="spark_55 spark-big2"></div>
			</div>
		</header>
		<main class="content">

			<div class="news-panel flex-s">
				<div class="slider">
					<div class="newsBlockLeft">
						<div class="swiper-container swiper-news swiper-container-initialized swiper-container-horizontal">
							<div class="swiper-wrapper" style="transition-duration: 0ms; transform: translate3d(-1770px, 0px, 0px);">
								<div class="swiper-slide" style="background-image: url('<?php echo __PATH_TEMPLATE_IMG__; ?>image-for-slider.png'); width: 590px;">
									<h2 class="slider-title">MuFUN Season 6 Plus</h2>
									<p class="slider-info">
										MuFUN is born out of passion, dedication and love for the game.<br> 
										A lot of time and countless efforts were put to this server to make sure that we bring out the best. 
										With our 5 years of experience in the fields of gaming and MU Online, we will deliver you the high quality game server you were looking for.
									</p>
									<a href="<?php echo __BASE_URL__; ?>" class="button-more">more</a>
								</div>
								<div class="swiper-slide" style="background-image: url('<?php echo __PATH_TEMPLATE_IMG__; ?>image-for-slider.png'); width: 590px;">
									<h2 class="slider-title">MuFUN Season 6 Plus</h2>
									<p class="slider-info">
										The character and guild names you choose must not contain any offensive words at all. 
										Sexual, racism or in any way discriminatory content are not tolerated, as well as excessive swearing.
									</p>
									<a href="<?php echo __BASE_URL__; ?>" class="button-more">more</a>
								</div>
								<div class="swiper-slide swiper-slide-prev" style="background-image: url('<?php echo __PATH_TEMPLATE_IMG__; ?>image-for-slider.png'); width: 590px;">
									<h2 class="slider-title">MuFUN ONLINE</h2>
									<p class="slider-info">
										A long time ago there was only a single empire that existed on the continent.
										The country experienced tranquility and peace and did not know the conflating.
									</p>
									<a href="<?php echo __BASE_URL__; ?>" class="button-more">more</a>
								</div>
								<div class="swiper-slide swiper-slide-active" style="background-image: url('<?php echo __PATH_TEMPLATE_IMG__; ?>image-for-slider.png'); width: 590px;">
									<h2 class="slider-title">DINAMIC SERVER</h2>
									<p class="slider-info">
										We recommend you to create your new account and to download the game client now in order to get ready for the grand opening.
									</p>
									<a href="<?php echo __BASE_URL__; ?>" class="button-more">more</a>
								</div>
							</div>
							<div class="newsPagination">
								<!-- Add Pagination -->
								<div class="swiper-pagination swiper-pagination-fraction"><span class="swiper-pagination-current">4</span> / <span class="swiper-pagination-total">4</span></div>
								<!-- Add Arrows -->
								<div class="swiper-button-next swiper-button-disabled" tabindex="0" role="button" aria-label="Next slide" aria-disabled="true"></div>
								<div class="swiper-button-prev" tabindex="0" role="button" aria-label="Previous slide" aria-disabled="false"></div>
							</div>
						<span class="swiper-notification" aria-live="assertive" aria-atomic="true"></span></div><!-- swiper-news -->
					</div>
				</div>
				<div class="events-block">

	<?php include(__PATH_TEMPLATE_ROOT__ . 'inc/modules/news.php');?>
	</div>			
	</div>
			
			
			<div class="block-widget flex-s-c">
				<!--block-TOP PAGE-->
				<div class="widget-fon">
					<!--block-TOP PLAYERS-->
					<div class="block-widget-title">
						TOP PLAYERS
					</div>
					<ul class="top-block">
	<li class="top-title">
		<span class="top-number">#</span> <span class="top-flag"></span> <span class="top-name">Name</span> <span class="top-lvl">LvL</span> <span class="top-Res">Reset</span>
	</li>

		<?php
		$topResets = LoadCacheData('rankings_resets.cache');
		if(is_array($topResets)) {
			$showPlayerCountry = mconfig('show_country_flags') ? true : false;
			$charactersCountry = loadCache('character_country.cache');
			if(!is_array($charactersCountry)) $showPlayerCountry = false;
			foreach($topResets as $key => $row) {
				if($key == 0) continue;
				if($key >= 10) continue;
				echo '<li class="top-list">';
				echo '<span class="top-number">'.$key.'.</span> <span class="top-flag"><img src="'.getCountryFlag($charactersCountry[$row[0]]).'" /></span> <span class="top-name">'.playerProfile($row[0]).'</span> <span class="top-lvl">'.number_format($row[3]).'</span> <span class="top-Res">'.number_format($row[2]).'</span>';
				echo '</li>';
			}
		}
		?>
	</ul>				
	</div>
				<!--block-TOP PLAYERS-->
				<div class="widget-fon-guilds">
					<!--block-TOP GUILDS-->
					<div class="block-widget-title">
						TOP <span class="widget-title-text">GUILDS</span>
					</div>
					<ul class="top-block guild">
	<li class="top-title">
		<span class="top-number">#</span> <span class="top-name">Name</span> <span class="score">Score</span>
	</li>
	
	
	<?php
		$topGuilds = LoadCacheData('rankings_guilds.cache');
		if(is_array($topGuilds)) {
			foreach($topGuilds as $key => $row) {
				if($key == 0) continue;
				if($key >= 10) continue;
				echo '<li class="top-list">';
				echo '<span class="top-number">'.$key.'. '.returnGuildLogo($row[3], 18).'</span> <span class="top-name">'.guildProfile($row[0]).'</span> <span class="score">'.number_format($row[2]).'</span>';
				echo '</li>';
			}
		}
		?>
	</ul>				
	</div>
				<!--block-TOP GUILDS-->
			</div>
			<!--block-TOP PAGE-->
			<div class="fast-links">
				<!--fast-links-->
				<a href="/news" class="fast-links-left">
					<span>NEWS</span><br>
					<p>MuFUN is born out of passion,<br> dedication and love for the game.</p>
				</a>
				<span></span>
				<a href="#" class="fast-links-center">
					<span>coming soon</span><br>
					<p>If you have any<br> complaints about<br> a staff member,<br> feel free to contact us</p>
				</a>
				<span></span>
				<a href="/castlesiege" class="fast-links-right">
					<span>CASTLE SIEGE</span><br>
					<p>Castle Siege is an event which<br> serves as an extension of the<br> regular Guild War.</p>
				</a>
			</div>

			<div class="bottom-block">
				<div class="block-players widget-fon-discussions fon-discussions">
					<!--block-GUILDS-->
					<div class="block-widget-title discussions-title">
						TOP KILLERS
					</div>
					<ul class="top-block">
    <li class="top-title">
        <span class="top-number">#</span> <span class="top-flag"></span> <span class="top-name">Name</span><span class="top-Res">Kills</span>
    </li>

    <?php
		$ranking_data = LoadCacheData('rankings_pk.cache');
		if(is_array($ranking_data)) {
			$showPlayerCountry = mconfig('show_country_flags') ? true : false;
			$charactersCountry = loadCache('character_country.cache');
			if(!is_array($charactersCountry)) $showPlayerCountry = false;
			foreach($ranking_data as $key => $row) {
				if($key == 0) continue;
				if($key >= 10) continue;
				echo '<li class="top-list">';
				echo '<span class="top-number">'.$key.'.</span> <span class="top-flag"><img src="'.getCountryFlag($charactersCountry[$row[0]]).'" /></span> <span class="top-name">'.playerProfile($row[0]).'</span>  <span class="top-Res">'.number_format($row[2]).'</span>';
				echo '</li>';
			}
		}
		?>	
	</ul>				</div>
				<!--block-GUILDS-->
				<span class="bottom-block-span"></span>
				<div class="block-players widget-fon-discussions fon-event">
					<!--block-EVENT-->
					<div class="block-widget-title discussions-title">
						TOP GRAND RESETS
					</div>
					<div class="discussions-content-top">

<ul class="top-block">
    <li class="top-title">
        <span class="top-number">#</span> <span class="top-flag"></span> <span class="top-name">Name</span> <span class="top-Res">Grand Resets</span>
    </li>
<?php
		$ranking_data = LoadCacheData('rankings_gr.cache');
		if(is_array($ranking_data)) {
			$showPlayerCountry = mconfig('show_country_flags') ? true : false;
			$charactersCountry = loadCache('character_country.cache');
			if(!is_array($charactersCountry)) $showPlayerCountry = false;
			foreach($ranking_data as $key => $row) {
				if($key == 0) continue;
				if($key >= 10) continue;
				echo '<li class="top-list">';
				echo '<span class="top-number">'.$key.'.</span> ';
				echo '<span class="top-flag"><img src="'.getCountryFlag($charactersCountry[$row[0]]).'" /></span>  ';
				echo '<span class="top-name">'.playerProfile($row[0]).'</span>   ';
				echo '<span class="top-Res">'.number_format($row[2]).'</span>';
				echo '</li>';
			}
		}
		?>

	
	</ul>					
	</div>
				</div>
				<span class="bottom-block-span"></span>
				<div class="block-players widget-fon-discussions fon-market">
					<!--block-MARKET-->
					<div class="block-widget-title discussions-title">
						TOP RESETS
					</div>
					<div class="discussions-content-top">
						<ul class="top-block">
    <li class="top-title">
        <span class="top-number">#</span> <span class="top-flag"></span> <span class="top-name">Name</span> <span class="top-Res">Reset</span>
    </li>

<?php
		$topResets = LoadCacheData('rankings_resets.cache');
		if(is_array($topResets)) {
			$showPlayerCountry = mconfig('show_country_flags') ? true : false;
			$charactersCountry = loadCache('character_country.cache');
			if(!is_array($charactersCountry)) $showPlayerCountry = false;
			foreach($topResets as $key => $row) {
				if($key == 0) continue;
				if($key >= 10) continue;
				echo '<li class="top-list">';
				echo '<span class="top-number">'.$key.'.</span> <span class="top-flag"><img src="'.getCountryFlag($charactersCountry[$row[0]]).'" /></span> <span class="top-name">'.playerProfile($row[0]).'</span> <span class="top-Res">'.number_format($row[2]).'</span> ';
				echo '</li>';
			}
		}
		?>
	
	</ul>					</div>
		</div>
			</div>
			<div class="fast-links">
				<!--fast-links-->
				<a href="/privacy" class="fast-links-left">
					<span><br>Privacy Policy</span><br>
					<p>MU FUN maintains this<br> Privacy Statement that<br> summarizes our policies.</p>
				</a>
				<span></span>
				<a href="/tos" class="fast-links-center">
					<span>Terms of Service</span><br>
					<p>By accessing the<br> site and affiliated services<br> that belongs to MY FUN,<br> you agree to comply with<br> the terms and conditions.</p>
				</a>
				<span></span>
				<a href="/contact" class="fast-links-right">
					<span>CONTACT US</span><br>
					<p>If you have any<br> complaints about<br> a staff member,<br> feel free to contact us.</p>
				</a>
			</div>
		</main>
		<!-- .content -->
		
		<!-- .footer -->
			<?php include(__PATH_TEMPLATE_ROOT__ . 'inc/modules/footer.php'); ?>
		<!-- .footer -->
		
	</div>
	<!-- .wrapper -->

	<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
	<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>

	<script src="<?php echo __PATH_TEMPLATE_JS__; ?>webengine.js"></script>
	<script src="<?php echo __PATH_TEMPLATE_JS__; ?>global.js"></script>	
	<script src="<?php echo __PATH_TEMPLATE_JS__; ?>swiper.min.js"></script>	
	<script src="<?php echo __PATH_TEMPLATE_JS__; ?>main.js"></script>	
	<script src="<?php echo __PATH_TEMPLATE_JS__; ?>events.js"></script>	
	<script src="<?php echo __PATH_TEMPLATE_JS__; ?>slick.min.js"></script>	


	<script>
		var swiper = new Swiper('.swiper-news', {
			autoplay: {
				delay: 4000,
			},
			speed: 1000,
			pagination: {
				el: '.swiper-pagination',
				type: 'fraction',
			},
			navigation: {
				nextEl: '.swiper-button-next',
				prevEl: '.swiper-button-prev',
			},
		});
	</script>

	<script>
		$('.center').slick({
			infinite: true,
			centerMode: true,
			centerPadding: '50px 30px',
			slidesToShow: 3,
			slidesToScroll: 3
		});
	</script>


	<!-- Login Modal -->
	<?php if(!isLoggedIn()) { ?>
			<div id="signin_modal" class="modal_window">
			
			<h3>ACCOUNT PANEL</h3>
			<div class="modal_form">
				<form action="<?php echo __BASE_URL__ . 'login'; ?>" method="post">
					<div class="formGroup">
						<span class="formGroup-name">Username</span>
						<input type="text" name="webengineLogin_user">
					</div>
					<div class="formGroup">
						<span class="formGroup-name">Password</span>
						<input type="password" name="webengineLogin_pwd">
					</div>
					<div class="formGroup-button">
						<button name="webengineLogin_submit" type="submit" value="submit">Sign In</button><br><br><br>
						<a href="/forgotpassword" class="lost-pass">Lost password ?</a>
					</div>
				</form>
			</div>
		</div>
		<div id="overlay"></div>
		<?php } ?>
</body>
</html>