<?php
/*
	[Office 515158] (C) 2009-2012 天生创想 Inc.
	$Id: home.php 1209087 2012-01-08 08:58:28Z baiwei.jiang $
*/
define('IN_ADMIN',True);
require_once('include/common.php');
require_once('include/function_home.php');
require_once('include/function_charts.php');
get_login($_USER->id);
//重新获取背景
	if(getGP('hometype','G')!=''){
		$sql = "SELECT hometype FROM ".DB_TABLEPRE."user_view  WHERE uid='".$_USER->id."' and jituanid='".$_USER->jituanid."' ";
		$bg = $db->fetch_one_array($sql);
		if($bg['hometype']=='1'){
			$_hometype=0;
		}else{
			$_hometype=1;
		}
		$db->query("update ".DB_TABLEPRE."user_view set hometype='".$_hometype."' WHERE uid = '".$_USER->id."' and jituanid='".$_USER->jituanid."'  ");
		
	}
	$sql = "SELECT homemana,homebg,pic,sex,home_txt,hometype FROM ".DB_TABLEPRE."user_view  WHERE uid='".$_USER->id."' and jituanid='".$_USER->jituanid."' ";
	$bguser = $db->fetch_one_array($sql);
	$homemana=$bguser['homemana'];
	//处理桌面，以个人设定为先
	if($bguser['hometype']!=''){
		$hometype=$bguser['hometype'];
	}else{
		$hometype=$_CONFIG->config_data('home');
	}
	if($bguser['homebg']!=''){
		$bg=''.$bguser['homebg'];
	}else{
		$bg='template/default/home/images/wallpaper.jpg';
	}
	if(getGP('file','G')=='text'){
		include_once template.'home.php';
	}else{
		include_once template.'home_news.php';
	}

?>