<?php

define('MONENGINE', 'Remake by starky');

Error_Reporting(E_ALL & ~E_NOTICE);

session_start();

require_once('core.php');

require_once(LOCALE.LOCALESET.'global.php');

if ($settings['site_closed'] == '1') {
	header('Location: closed.php'); // Site is closed
	exit();
}

	// Body
	
	$load = "";
	if(isset($_GET['page'])) $load = $_GET['page'];
	
	switch($load) {
		case 'add_server':
			$page_title = $settings['site_name']." | Регистрация сервера";
			$load_file = 'register.php';
			break;
		case 'all_servers':
			$load_file = 'all_servers.php';
			break;
		case 'contact':
			$load_file = 'contact.php';
			break;
		case 'search':
			$load_file = 'search.php';
			break;
                case 'pay':
			$load_file = 'pay.php';
			break;
		case 'feedback':
			$load_file = 'feedback.php';
			break;
		case 'links':
			$load_file = 'links.php';
			break;
				case 'cs_download':
			$load_file = 'cs.php';
			break;	
		case 'info':
			$load_file = (!empty($_GET['id']) and is_numeric($_GET['id'])) ? 'server_info.php' : 'all_servers.php';
			break;
		case 'message':
			$msg_code = $_GET['code'];
			$load_file = 'messages.php';	// File not found
			break;
		default:
			$load_file = 'servers.php';
			break;
	}
	
	// Header block
	require_once THEME."header.php";
	
	// Main area
	if(file_exists($load_file)) {
		require($load_file);	// Loading main area
	} else {
		$msg_code = 404;
		require('messages.php');	// File not found
	}
	
	// Footer block
	require_once THEME."footer.php";
?>