<?php
/**
 * 入口文件
 *
 * 统一入口，进行初始化信息
 * 
 *
 * @copyright  Copyright (c) 2007-2012 ShopNC Inc. (http://www.shopnc.net)
 * @license    http://www.shopnc.net/
 * @link       http://www.shopnc.net/
 * @since      File available since Release v1.1
 */
define('ProjectName','');

require_once('global.php');
session_save_path(BasePath.DS.'cache'.DS.'session');
if($_GET['act'] == 'adv' && ProjectName == ''){
	
	define('ATTACH_ADV','upload/adv');
	require_once(BasePath.DS.'config.ini.php');
	define('SiteUrl',$site_url);
	$advshow_classfile = BasePath.DS.'control/adv.php';
	if(is_file($advshow_classfile)){
		include_once ($advshow_classfile);
		$advshow = new advControl();
		$advshow->advshowOp();
	}else{
		echo "Adv System Inner Error!";
	}

}elseif ($_GET['act'] == 'toqq'){
	
	require_once(BasePath.DS.'config.ini.php');
	define('SiteUrl',$site_url);
	if ($_GET['op'] == 'g'){
		include 'api/qq/oauth/get_access_token.php';
	}else{
		include 'api/qq/oauth/redirect_to_login.php';
	}

}elseif ($_GET['act'] == 'tosina'){
	
	require_once(BasePath.DS.'config.ini.php');
	define('SiteUrl',$site_url);
	if ($_GET['op'] == 'g'){
		include 'api/sina/callback.php';
	}else{
		include 'api/sina/index.php';
	}	
}elseif ($_GET['act'] == 'get_session'){
	session_start();
	$key = $_GET['key'];
	$val = '';
	if (!empty($_SESSION[$key])) $val = $_SESSION[$key];
	echo $val;
	exit;
}