<dates>
<?
include_once('../common.php');
date_default_timezone_set(PRC);
if(isset($_REQUEST['length'])){
	$a=$_REQUEST['length'];
$sql="SELECT sf.*, s.* FROM ".tname('space')." s LEFT JOIN ".tname('spacefield')." sf ON sf.uid=s.uid ORDER BY s.credit DESC limit $a,20";
$query=mysql_query($sql);
while($value=mysql_fetch_array($query)){	
	$uid=$value['uid'];
	$tp=UC_API."/data/avatar/".avatar_file($uid, "middle");
	if(file($tp)==true){}else{$tp="img/ooxx.png";}
	$name=iconv("gb2312","UTF-8",$value['username']);
	$vip=$value['groupid'];
	$sex=$value['sex'];
	$note=iconv("gb2312","UTF-8",$value['note']);
		if(empty($note)){$note="暂未更新签名...";}

?>
	<date2>
	<uuid><?=$uid?></uuid>
	<tp><?=$tp?></tp>
	<uuname><?=$name?></uuname>
	<vip><?=$vip?></vip>
	<sex><?=$sex?></sex>
	<note><?=$note?></note>
	</date2>
<?
	}
}else{
$sql="SELECT sf.*, s.* FROM ".tname('space')." s LEFT JOIN ".tname('spacefield')." sf ON sf.uid=s.uid ORDER BY s.credit DESC limit 20";
$query=mysql_query($sql);
while($value=mysql_fetch_array($query)){	
	$uid=$value['uid'];
	$tp=UC_API."/data/avatar/".avatar_file($uid, "middle");
	if(file($tp)==true){}else{$tp="img/ooxx.png";}
	$name=iconv("gb2312","UTF-8",$value['username']);
	$vip=$value['groupid'];
	$sex=$value['sex'];
	$note=iconv("gb2312","UTF-8",$value['note']);
		if(empty($note)){$note="暂未更新签名...";}
?>
	<date>
	<uuid><?=$uid?></uuid>
	<tp><?=$tp?></tp>
	<uuname><?=$name?></uuname>
	<vip><?=$vip?></vip>
	<sex><?=$sex?></sex>
	<note><?=$note?></note>
	</date>
<?
	}
}
?>
</dates>