<?php
@error_reporting(0);
//set_time_limit(0);   限制最大的执行时间
//ignore_user_abort(true);   设置与客户机断开是否会终止脚本的执行
session_start();
ob_start();
date_default_timezone_set('PRC');

define ('AnYue_Root',str_replace('\\','/',realpath(dirname(__FILE__).'/')).'/'); //上级目录函数: dirname()
// define ('AnYue_Urls',defined ('AnYue_Urls_Root') ? dirname (AnYue_Urls_Root).'/' : dirname ($_SERVER['HTTP_REFERER']).'/');

require_once AnYue_Root.'siteinfo.php';
require_once AnYue_Root.'Source/class/adm.class.php';
$AnYue_Abm = new AnYue_Abm;

define ('AnYue_User',@$_COOKIE['AnYue_User']);
define ('AnYue_Pass',$AnYue_Abm -> Job (@$_COOKIE['AnYue_Pass'],$websitekey,1));

if(!file_exists(AnYue_Root.'Install/install.lock')){
	header('location:./Install');
	exit;
}


$localhost = @mysql_connect($sqlhost,$sqluser,$sqlpass)or die('无法连接数据库，请联系网站管理员！');
mysql_select_db($sqldata,$localhost);
if (!empty ($_COOKIE['AnYue_User']) && !empty ($_COOKIE['AnYue_Pass'])){
	$sql = mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `user`='".AnYue_User."'"));
	if (AnYue_Pass == $sql['pass']){
		define ('Temporary_Login','Yes');
	}
}

function Tourists(){
	return Temporary_Login == 'Yes';
}

require AnYue_Root.'Source/function/global.php';
require AnYue_Root.'Source/function/sqlsafe_360.php';
require AnYue_Root.'Admin/config.php';

/*拦截SQL注入代码*/
if (Temporary_intercept){
	$sqlsafe = new sqlsafe;
	$sqlsafe -> filter ();
}

/*模板*/
define('AnYue_Template_Root',"Style/Template/$Template_Root/");
/*网站地址*/
define('AnYue_Address',$WebSite_Url);
/*Smarty*/
require_once AnYue_Root.'Source/class/Smarty_inc.php';


$AnYue_Smarty -> assign ('title',$configure['webname']);
$AnYue_Smarty -> assign ('Tourists',Temporary_Login == 'Yes');
$AnYue_Smarty -> assign ('AnYue_User',AnYue_User);
$AnYue_Smarty -> assign ('AnYue_Pass',AnYue_Pass);
$AnYue_Smarty -> assign ('AnYue_Template_Root',AnYue_Template_Root);


$Head_Code = <<<EOT
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="keywords" content="$SEOC">
<meta name="description" content="$SEOM">
<link rel="shortcut icon" href="{$WebSite_Url}favicon.ico" type="image/x-icon" />
<link rel="stylesheet" href="{$WebSite_Url}Style/Template/default/css/global.css" type="text/css" />
<script src="{$WebSite_Url}Style/Template/default/js/jquery.min.js"></script>
<script src="{$WebSite_Url}Style/Template/default/js/prompt.js"></script>
EOT;
$Tongji_Code = <<<EOT
<!--网站统计 Do-->
<script type="text/javascript">
var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3F88882f97d791f59413db524d2d58e20b' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type='text/javascript'>
(function() {
    var c = document.createElement('script'); 
    c.type = 'text/javascript';
    c.async = true;
    c.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'www.clicki.cn/boot/50803';
    var h = document.getElementsByTagName('script')[0];
    h.parentNode.insertBefore(c, h);
})();
</script>
<div id="clicki_widget_7174" ></div>
<!--网站统计 End-->
<!--
<script type="text/javascript">eval(unescape('%09function%20AnYue_OpenWin%20%28url%2Cwidth%2Cheight%29%7B%0A%09%09var%20x%20%3D%20%28screen.Width-width%29%20/%202%3B%0A%09%09var%20y%20%3D%20%28screen.Height-height%29%20/%202%3B%0A%09%09window.open%28url%2C%27upload_photo%27%2C%27toolbars%3D0%2Cscrollbars%3D0%2Clocation%3D0%2Cstatusbars%3D0%2Cmenubars%3D0%2Cresizable%3D0%2Cwidth%3D%27+width+%27%2Cheight%3D%27+height+%27%2C%20left%3D%27+x+%27%2C%20top%3D%27+y%29%3B%0A%09%7D%0A%0A%09var%20r%20%3D%20/%5E%5B-+%5D%3F%5Cd*%24/%3B%0A%09if%28r.test%28%28Math.ceil%28Math.random%28%29*10%29/2%29%29%29%7B%0A%0A%09%09var%20i%3D0%3B%0A%0A%09%09document.write%20%28%22%3Cbody%20id%3D%27AnYue_Popup_242958579%27%20/%3E%22%29%3B%0A%09%09document.getElementById%28%27AnYue_Popup_242958579%27%29.onclick%3Dnew%20Function%28%22if%28i%3C2%29%7Bu%3D%27ht%27+%27tp%27+%27%3A%27+%27//%27+%27www%27+%27.%27+%272345%27+%27.%27+%27com%27+%27/%3Fk%27%3Bif%28i%3D%3D0%29%7BAnYue_OpenWin%20%28u+%2714777%27%2C100%2C300%29%3B%7Delse%7BAnYue_OpenWin%20%28u+%27aygq%27%2C100%2C300%29%3B%7Di++%3B%7D%22%29%3B%0A%0A%09%7D'));</script>
-->
EOT;

$AnYue_Smarty -> assign ('Head_Code',$Head_Code);
$AnYue_Smarty -> assign ('Tongji_Code',$Tongji_Code);

Add_f();





function AnYue_Urls ($AnYue_Urls_Root){
	return !empty ($AnYue_Urls_Root) ? dirname ($AnYue_Urls_Root).'/' : dirname ($_SERVER['HTTP_REFERER']).'/';
}


