www.gusucode.com > 08CMS空白站群系统 3.3 繁体 UTF-8 > upload/include/parse/userinfos.php

    <?php
!defined('M_COM') && exit('No Permission');
function userinfos(&$tag,$temparr=array()){
	global $curuser,$memberid,$db,$tblprefix,$nouserinfos,$grouptypes;
	$item = array();
	if(!$tag['usource']){
		$memberid && $item = $curuser->infos;
	}elseif(!empty($temparr['mid'])){
		$item = $db->fetch_one("SELECT m.*,s.* FROM {$tblprefix}members m LEFT JOIN {$tblprefix}members_sub s ON s.mid=m.mid WHERE m.mid='$temparr[mid]'");
	}
	if(!empty($tag['detail']) && !empty($item)){
		$customtable = 'members_'.$item['mchid'];
		if($temps = $db->fetch_one("SELECT * FROM {$tblprefix}$customtable WHERE mid='$item[mid]'")) $item = array_merge($item,$temps);
		unset($temps);
	}
	if($item){
		arr_tag2atm($item,'m');
	}else $item = $nouserinfos;

	foreach($grouptypes as $k => $v){
		$item['grouptype'.$k.'name'] = '';
		if(!empty($item['grouptype'.$k])){
			$usergroups = read_cache('usergroups',$k);
			$item['grouptype'.$k.'name'] = $usergroups[$item['grouptype'.$k]]['cname'];
		}
	}
	unset($usergroups);
	$template = $tag['template'];
	nreplace($template,'c',$temparr);
	nreplace($template,'u',$item);
	nreplace($template,'b',$item);
	return $template;
}
?>