<script>
d = new Array;
<?
header("Pragma: no-cache");


$share->cleanOthers();

$rs = $db->query("SELECT DISTINCT ".$settings->config['flags_tablename'].".uid, ".$settings->config['interauth_tablename'].".username, COUNT(".$settings->config['share_info_tablename'].".to_uid) as cnt FROM ".$settings->config['interauth_tablename'].",".$settings->config['flags_tablename'].",".$settings->config['share_info_tablename']." WHERE ".$settings->config['share_info_tablename'].".to_uid='".$auth->currentUserInfo['id']."' AND ".$settings->config['flags_tablename'].".id=".$settings->config['share_info_tablename'].".fid AND ".$settings->config['interauth_tablename'].".id=".$settings->config['flags_tablename'].".uid AND ".$settings->config['flags_tablename'].".shared='1' GROUP BY uid");


if ($rs->RecordCount() > 0) {
$i = 0;
	while (!$rs->EOF) {
		?>
d[<?echo $i;?>] = new Array;
d[<?echo $i;?>]['text'] = '<?echo $str->safeJS($rs->fields['username']);?>';
d[<?echo $i;?>]['uid'] = '<?echo $str->safeJS($rs->fields['uid']);?>';
		<?
		$i++;
		$rs->MoveNext();
	}
}


/* sort here the new items */
?>
treeitem = parent.AfianTreeHandler.all['<?echo $_GET['id'];?>'];
parent.AfianTreeDataLoaded(d, treeitem, parent.ListUser);
</script>
