<?php
/*
		[FuShow.cn] (C) 2013-2014 HXWY Inc.
		FuShow Friend V3.0				Id: app.php
		Email <service@fushow.cn>       http://fushow.cn/
*/

include_once('./common.php');

//空间信息
$space = getspace($_SGLOBAL['supe_uid']);

//更新活动状态
updatetable('session', array('lastactivity' => $_SGLOBAL['timestamp']), array('uid'=>$_SGLOBAL['supe_uid']));

$appid = empty($_GET['id'])?'':intval($_GET['id']);
$app = empty($_SGLOBAL['app'][$appid])?array():$_SGLOBAL['app'][$appid];
if(empty($app)) {
	$url = trim($_GET['url']);
	if(empty($url)) {
		showmessage('correct_choice_for_application_show');
	}
} else {
	//链接添加参数
	$url = $app['url'];
	if($_GET['uid']) {
		switch ($app['type']) {
			case 'SUPESITE':
				$url .= '/index.php?'.$_GET['uid'];
				break;
			case 'FUSHOW':
				$url .= '/fushow.php?uid='.$_GET['uid'];
				break;
			case 'SUPEV':
				$url .= '/vushow.php?mid='.$_GET['uid'];
				break;
			case 'ECMALL':
				$url .= '/index.php?app=store&store_id='.$_GET['uid'];
				break;
			default:
				$url .= '/fushow.php?uid='.$_GET['uid'];
				break;
		}
	}
}
if($_GET['href']) {
	$url = $_GET['href'];
}

if(!$_SCONFIG['linkguide']) {
	showmessage('do_success', $url, 0);//直接跳转
}

$_TPL['titles'] = array($app['name']);

include_once template("iframe");

?>