<?php
define('THIS_SCRIPT', 'usermanager');
require_once 'global.php';
$lang = load_lang($lang, 'usermanager' );
$stats = $lang['hometitle'];
$arrNavMenu = array(
	0=>array('linktitle'=>$lang['HeaderTitle1'],'linkurl'=>'usermain.php')
	,1=>array('linktitle'=>$stats)
);
head();
PageLoad();
footer();
function PageLoad(){
	global $userid,$lang,$db,$imgurl,$fsetting,$action,$membername;
	if( intval($userid) == 0 ){
		showmsg($lang['MustLogin']);
		exit;
	} else{
		MainFunc();
	}
}//end function PageLoad

function MainFunc(){
	global $db,$boardid,$fsetting,$lang,$userinfo,$_DCACHE,$boardmaster,$master,$imgurl,$userid,$dv,$membername;
	global $countALLAccomplish,$countALL;
	if ( true || count($_forum) > 1 ){
		$iMagicFace =  explode('|',$userinfo['userface']);
		if(!empty($iMagicFace[1])){
			$UserFace = "<img src=\"".Dv_FilterJS($iMagicFace[1])."\" width=\"".$userinfo['userwidth']."\" height=\"".$userinfo['userheight']."\" alt=\"\">";
		}
		elseif(!empty($iMagicFace[0])){
			$UserFace = "<img src=\"".Dv_FilterJS($iMagicFace[0])."\" width=\"".$userinfo['userwidth']."\" height=\"".$userinfo['userheight']."\" alt=\"\">";
		}
		else{
			$UserFace = "<img src=\"".$userinfo['userface']."\" width=\"".$userinfo['userwidth']."\" height=\"".$userinfo['userheight']."\" alt=\"\">";			
		}
		$TableWidth =& $_DCACHE['stylecss'][1];
		$color =& $_DCACHE['stylecss'][19];
		$user_Article =& $userinfo['userpost'];
		$user_Group =& $userinfo['userclass'];
		$user_Face = $UserFace;
		$user_Title =& $userinfo['usertitle'];
		$user_Wealth =& $userinfo['userwealth'];
		$user_EP =& $userinfo['userep'];
		$user_CP =& $userinfo['usercp'];
		$user_Money =& $userinfo['usermoney'];
		$user_Ticket =& $userinfo['userticket'];
		$user_IsBest =& $userinfo['userisbest'];
		$user_AddDate =& $userinfo['joindate'];
		$user_Logins =& $userinfo['userlogins'];
		$username =& $userinfo['username'];
		$msg_newincept = intval($userinfo['uermsg']);

		if( $forumChanSetting[13] == 1 && $forumChanSetting[0] == 1 ){
			$UserTicket = "<BR>{$lang['Dvbbs.lanstr11']}";
		} else{
			$UserTicket = '';
		}
		//USERIM信息。（HomePage ||| Oicq ||| Icq ||| Msn ||| Aim ||| Yahoo ||| UC）.
		//UserInfo 真实姓名|||实事求是, 诚实坦白|||个人简介|||国　　家|||省　　份|||城　　市|||牛|||O|||天主教|||财会/金融|||未婚|||博士|||毕业院校|||联系电话|||通信地址

		$stmt = "SELECT useremail,usersign,userbirthday,userinfo,userim,usertitle FROM {$dv}user WHERE userid={$userid}";
		if( $query = $db->query($stmt,array('absolutePage'=>1,'pageSize'=>1)) ){
			$result = $db->fetch_row($query);
			$_num =& $db->num_fields($query);
			$arruserinfo = explode('|||',$result['3']);
			$countuserinfo = count($arruserinfo);
			if ($countuserinfo > 0){
				$userinfoAcc = 0;
				foreach($arruserinfo as $v){
					$userinfoAcc =!empty($v)? $userinfoAcc+1 : $userinfoAcc;
				}
			}
			$arruserim = explode('|||',$result['4']);
			$countuserim = count($arruserim);
			if ($countuserim > 0){
				$userimAcc = 0;
				foreach($arruserim as $v){
					$userimAcc =!empty($v)? $userimAcc+1 : $userimAcc;
				}
			}
			$useremail = $result['0'];//邮箱
			$usersign = $result['1'];//签名
			$userbirthday = $result['2'];//生日
			$usertitle = $result['5'];//头衔
			$useremailAcc =!empty($useremail)? 1 : 0;
			$usersignAcc =!empty($usersign)? 1 : 0;
			$userbirthdayAcc =!empty($userbirthday)? 1 : 0;
			$usertitleAcc =!empty($usertitle)? 1 : 0;

			$countALLAccomplish = $userinfoAcc+$userimAcc+$useremailAcc+$usersignAcc+$userbirthdayAcc+$usertitleAcc;
			$countALL = $countuserinfo+$countuserim+4;
		}
		require_once printout('usermanager.navmenu');
		require_once printout('usermain');
	}
}

?>