<?php
/**
 * @package Flatnux
 * @author Alessandro Vernassa <speleoalex@gmail.com>
 * @copyright Copyright (c) 2011
 * @license http://opensource.org/licenses/gpl-license.php GNU General Public License
 */
ob_start();
global $_FN;
require_once "include/flatnux.php";
if ( $_FN['enable_mod_rewrite'] > 0 )
{
	header("Cache-Control: no-cache");
	header("Pragma: no-cache");
}

//accesskey  ----->
FN_GetSections("", true);
//accesskey  -----<
//--------------------------  auto scripts  ----------------------------------->
include ("include/autoexec.php");
//--------------------------  auto scripts  -----------------------------------<
if (file_exists("themes/{$_FN['theme']}/structure.php"))
{
	include "./themes/{$_FN['theme']}/structure.php";
	$str = ob_get_contents();
}
elseif (file_exists("themes/{$_FN['theme']}/template.{$_FN['mod']}.tp.html"))
{
	$str =  FN_TPL_html_MakeThemeFromTemplate("themes/{$_FN['theme']}/template.{$_FN['mod']}.tp.html");
}
elseif (file_exists("themes/{$_FN['theme']}/template.tp.html"))
{
	$str =  FN_TPL_html_MakeThemeFromTemplate("themes/{$_FN['theme']}/template.tp.html");
}
$str .= "<!-- Page generated in " . FN_GetExecuteTimer() . " seconds. -->";
ob_end_clean();
header("Content-Type: text/html; charset={$_FN['charset_page']}"); 
if ( $_FN['enable_compress_gzip'] )
{
	header("Content-Encoding: gzip");
	print gzencode($str);
}
else
{
	print ($str);
}

?>