<!--<?php
require_once(uTemplate::printEot('header'));
require_once(uTemplate::printEot('user_appleft'));
print<<<EOT
-->
<div class="contUser">
<table width="100%"><tr><td valign="top" height="500">
	<div class="p15">
		<h4 class="site"><img src="u/images/module/friend.png" align="absmiddle" class="mr10" /><span>朋友</span></h4>
		<div class="navC mb10">
			<ul>
				<li id="type_attention"><a href="u.php?a=friend&type=attention">我的關注</a></li>
				<li id="type_attentioned"><a  href="u.php?a=friend&type=attentioned">我的粉絲</a></li>
				<li id="type_my"><a href="u.php?a=friend&type=my">我的好友</a></li>
				<li id="type_find"><a href="u.php?a=friend&type=find">查找好友</a></li>
<!--
EOT;
if ($rg_allowregister != '0') {
print <<<EOT
-->
				<li id="type_invite"><a href="u.php?a=friend&type=invite">邀請好友</a></li>
<!--
EOT;
}if ($rg_allowregister == '2') {
print <<<EOT
-->
				<li id="type_inviteCode"><a href="u.php?a=friend&type=inviteCode">邀請碼管理</a></li>	
<!--
EOT;
}
print <<<EOT
-->
				<li id="type_birthday"><a href="u.php?a=friend&type=birthday">好友生日</a></li>
			</ul>
		</div>
<!--
EOT;
if ($type == 'birthday') {print <<<EOT
-->
		<div class="bdB pb10 p_lr_10 cc">
			我現在的生日設置為︰{$birthday} <a href="profile.php?action=modify&info_type=$birthdayLink">點擊設置我的生日</a>
		</div>
		<div class="conFeed" style="padding-left:7px;">
<!--
EOT;
if ($friendsBirthday) {
foreach ($friendsBirthday as $birth => $friends) {
$bday=explode("-",$friends[bday]);
$d1=mktime(0,0,0,$bday[0],$bday[1],0);
$d2=mktime(0,0,0,get_date($timestamp,'m'),get_date($timestamp,'d'),0);
$days=($d1-$d2)/3600/24;
$nowdays = ($days > 0) ? $days.'天後':'今天';
print <<<EOT
-->
			<dl class="dl cc">
				<dt class="dt">
					<a href="u.php?uid=$friends[uid]" class="img_50 _cardshow" data-card-url="pw_ajax.php?action=smallcard&type=showcard&uid={$friends[uid]}" target="_blank"  data-card-key="{$friends['username']}"><img src="$friends[face]" width="44" height="44" alt="admin" /></a>
				</dt>
				<dd class="dd">
					<p class="f14"><a href="u.php?uid=$friends[uid]" class=" _cardshow" data-card-url="pw_ajax.php?action=smallcard&type=showcard&uid={$friends[uid]}" target="_blank" data-card-key="{$friends['username']}">$friends[username]</a>在{$nowdays}（{$friends[bday]}）過生日</p>
					<p><a href="javascript:;" onclick="sendmsg('pw_ajax.php?action=msg&touid=$friends[uid]');" class="bless" title="送祝福">送祝福</a></p>
				</dd>
			</dl>
<!--
EOT;
}}else { print <<<EOT
-->
		<div class="tac f14 p15">最近沒有好友過生日</div>
<!--
EOT;
}print <<<EOT
-->
			<div class="mb10 cc">$pages</div>
		</div>
<!--
EOT;
}
print <<<EOT
-->
<script type="text/javascript">setCurrent('type_$type','type_attention','current');</script>
<!--
EOT;
if ($type == 'my') {

if ($u == $winduid) {print <<<EOT
-->
		<div class="sidebar fr">
			<div >
			<div class="boxC">
				<h3>好友分組</h3>
					<ul class="ulE" id="dt_ul">
					<li id="dt_all"><a href="{$thisbase}">全部好友</a> [<span id="fcount">{$friendsNums}</span>]</li>
<!--
EOT;
foreach ($friendType as $value) {print <<<EOT
-->
					<li id="dt_{$value[ftid]}" onmousemove="isMouseUp({$value[ftid]},0)" onmouseout="isMouseUp({$value[ftid]},1)" >			
						<a id="del_{$value[ftid]}" style="visibility:hidden" title="刪除" class="adel cp mr10" onclick="pwConfirm('是否確認解除？',this,function(){delType('$value[ftid]','$u')})">刪除</a>
						<a id="edit_{$value[ftid]}" style="visibility:hidden" title="編輯" class="aedit mr5 cp" onclick="showEidt('$value[ftid]','$u');">編輯</a>
						<a id="ftype_{$value[ftid]}" href="{$thisbase}ftid={$value[ftid]}" class="mr5">$value[name]</a><cite id="dnum_{$value[ftid]}">[{$value[num]}]</cite>
					</li>
<!--
EOT;
}print <<<EOT
-->
					<li id="dt_-1"><a href="{$thisbase}ftid=-1" class="mr5">未分組</a>[{$defaultTypeFriendNum}]</li>
				</ul>
<!--
EOT;
$type = $ftid == -1  ? 'null' : $ftid;
print <<<EOT
-->
<script>
     setCurrent('dt_$type','dt_all','current');
</script>	                 
				<div class="pd5"><span class="cp addImg" onclick="addType('dt_ul','$u')">添加分組</span></div>
			</div>
			</div>
		</div>
<!--
EOT;
}print<<<EOT
-->
		<div class="contentB p_lr_10">
		<div class="friList mb10" id="friList">
<!--
EOT;
if (!empty($friends)) {
$userService = L::loadClass('UserService', 'user');
foreach ($friends as $key => $value) {
$groupId = ($value['groupid'] == '-1') ? $value['memberid'] : $value['groupid'];
$groupRight = $userService->getRightByGroupId($groupId);
$value['honor'] = $groupRight['allowhonor'] ? substrs($value['honor'],40) : '';
print <<<EOT
-->
			<dl class="cc nadlA" id="friend_{$value[uid]}">
				<dt><a href="{$db_userurl}$value[uid]" class="img_50 _cardshow" data-card-url="pw_ajax.php?action=smallcard&type=showcard&uid={$value[uid]}" target="_blank" data-card-key="{$value['username']}"><img src="$value[face]" width="44" height="44" /></a></dt>
				<dd>
					<div class="nadlCon">
						<div class="nadlCon_l fl">
							<p class="mb5">
<!--
EOT;
$gender = getDefaultGender($value['gender']);
if(checkOnline($value['thisvisit'])){
print <<<EOT
-->
<span class="{$gender}_ol mr5" title="在線" alt="在線">在線</span>
<!--
EOT;
}print <<<EOT
-->
							<a href="{$db_userurl}$value[uid]" class="b _cardshow" data-card-url="pw_ajax.php?action=smallcard&type=showcard&uid={$value[uid]}" target="_blank" data-card-key="{$value['username']}">$value[username]</a>
</p>
							<p class="mb5">$value[honor]</p>
							<p>被關注︰<span id="att_friend_{$value[uid]}" class="mr20">{$value['fans']}</span>最近登錄: {$value[lastvisit]}</p>
						</div>
<!--
EOT;
if($u == $winduid) {
if ($value[ftid] && $friendType[$value[ftid]]) {
$ftypename = $friendType[$value[ftid]][name];
} else {
$ftypename = '未分組';
}
print <<<EOT
-->
						<div class="nadlCon_r fl pr">
							<a href="javascript:;" class="link_down" id="td_ftid{$value[uid]}" onclick="read.open('menu_ftid{$value[uid]}','td_ftid{$value[uid]}');" title="點擊重新分組"><span id="ftypename_{$value[uid]}">{$ftypename}</span></a>
<div id="menu_ftid{$value[uid]}" style="display:none; ">
<!--
EOT;
if ($friendType) {print <<<EOT
-->
			<div class="pw_menu friGroup">
				<ul class="menuList">
<!--
EOT;
foreach ($friendType as $type) {print <<<EOT
-->
					<li><a  href="javascript:;" onclick="setFriendType('',{$value[uid]}, $type[ftid]);" class="s6">{$type['name']}</a></li>
<!--
EOT;
}print <<<EOT
-->
				</ul>
			</div>
<!--
EOT;
}print <<<EOT
-->
			</div>
						</div>
						<div class="nadlCon_c fr">				
<!--
EOT;
if (!$value['attention']) {print <<<EOT
-->
									<p class="mb5"><a href="javascript:;" onclick="Attention.add(this,'{$value['uid']}',1)" class="add_follow">加關注</a></p>
<!--
EOT;
	}if ($value['attentionEach']) {print <<<EOT
-->
                  <p class="mb5"><img src="u/images/mnfollow.png" title="互相關注" /></p>
<!--
EOT;
	}print <<<EOT
-->
							<ul>
<!--
EOT;
if($u == $winduid){print <<<EOT
-->
									<li><a href="javascript:;" onclick="sendmsg('pw_ajax.php?action=msg&touid=$value[uid]');" class="s6">發消息</a></li>
<!--
EOT;
}print <<<EOT
-->
<!--
EOT;
if ($value['attention']) {print <<<EOT
-->
									<li><a href="javascript:;" onclick="pwConfirm('是否取消關注？',this,function(){Attention.del('{$value[uid]}')})" class="s6">取消關注</a></li>
<!--
EOT;
}if (!in_array($value['uid'], $friendsAllUids)) {print <<<EOT
-->
									<li><a href="javascript:;"  onclick="sendmsg('pw_ajax.php?action=addfriend&touid={$value[uid]}&reload=1');">加為好友</a></li>
<!--
EOT;
 } else {print <<<EOT
-->
									<li><a href="javascript:;" onclick="pwConfirm('是否確認解除？',this,function(){delFriend('$value[uid]')});" title="解除好友">解除好友</a></li>
<!--
EOT;
} print <<<EOT
-->
								</ul>
						</div>
					</div>
				</dd>
			</dl>
<!--
EOT;
}}print <<<EOT
-->
		</div>
<script type="text/javascript">
var li = document.getElementById("friList");
var tt = li.getElementsByTagName("dl");
for(i=0; i<tt.length; i++){
	tt[i].onmouseover= function(){
		for(j=0; j<tt.length; j++){
			tt[j].className = "cc nadlA";
			this.className  = "current cc nadlA";
		}
	}
	tt[i].onmouseout= function(){
      for(j=0; j<tt.length; j++){
          this.className  = "cc nadlA";
      }
   }
}
</script>
<!--
EOT;
} else {print <<<EOT
-->
			<div class="p15 f14 tac">暫無朋友,<a href="u.php?a=friend&type=find">尋找我的朋友</a></div>
<!--
EOT;
}print <<<EOT
-->
			<div class="mb10 cc">$pages</div>
		</div>
<!--
EOT;
} elseif ($type == 'attention' || $type == 'attentioned')  {print <<<EOT
-->
	<div class="p_lr_10 contentB">
		<div class="friList" id="friList">
<!--
EOT;
if (!empty($attentions)) {
$userService = L::loadClass('UserService', 'user');
foreach ($attentions as $key => $value) {
$groupId = ($value['groupid'] == '-1') ? $value['memberid'] : $value['groupid'];
$groupRight = $userService->getRightByGroupId($groupId);
$value['honor'] = $groupRight['allowhonor'] ? substrs($value['honor'],40) : '';
print <<<EOT
-->
			<dl class="cc nadlA" id="friend_{$value[uid]}">
				<dt><a href="{$db_userurl}$value[uid]" class="img_50 _cardshow" data-card-url="pw_ajax.php?action=smallcard&type=showcard&uid={$value[uid]}" target="_blank" data-card-key="{$value['username']}"><img src="$value[face]" width="44" height="44" /></a></dt>
				<dd>
					<div class="nadlCon">
						<div class="nadlCon_l fl">
							<p class="mb5">
<!--
EOT;
$gender = getDefaultGender($value['gender']);
if(checkOnline($value['thisvisit'])){
print <<<EOT
-->
<span class="{$gender}_ol mr5" title="在線" alt="在線">在線</span>
<!--
EOT;
}print <<<EOT
-->
							<a href="{$db_userurl}$value[uid]" class="b _cardshow" data-card-url="pw_ajax.php?action=smallcard&type=showcard&uid={$value[uid]}" target="_blank" data-card-key="{$value['username']}">$value[username]</a>
</p>
							<p class="mb5">$value[honor]</p>
							<p>最近登錄: {$value[lastvisit]}</p>
						</div>
						<div class="nadlCon_c fr">
<!--
EOT;
if (!$value['attention']) {print <<<EOT
-->
									<p class="mb5"><a href="javascript:;" onclick="Attention.add(this,'{$value['uid']}',1)" class="add_follow">加關注</a></p>
<!--
EOT;
	}if ($value['attentionEach']) {print <<<EOT
-->
                  <p class="mb5"><img src="u/images/mnfollow.png" title="互相關注" /></p>
<!--
EOT;
	}print <<<EOT
-->
							<ul>
<!--
EOT;
if($u == $winduid){print <<<EOT
-->
									<li><a href="javascript:;" onclick="sendmsg('pw_ajax.php?action=msg&touid=$value[uid]');" class="s6">發消息</a></li>
<!--
EOT;
}print <<<EOT
-->
<!--
EOT;
if ($value['attention']) {print <<<EOT
-->
									<li><a href="javascript:;" onclick="pwConfirm('是否取消關注？',this,function(){Attention.del('{$value[uid]}')})" class="s6">取消關注</a></li>
<!--
EOT;
}if (!in_array($value['uid'], $friendsAllUids)) {print <<<EOT
-->
									<li><a href="javascript:;"  onclick="sendmsg('pw_ajax.php?action=addfriend&touid={$value[uid]}&reload=1');">加為好友</a></li>
<!--
EOT;
 } else {print <<<EOT
-->
									<li><a href="javascript:;" onclick="pwConfirm('是否確認解除？',this,function(){delFriend('$value[uid]')});" title="解除好友">解除好友</a></li>
<!--
EOT;
}print <<<EOT
-->
								</ul>
						</div>
					</div>
				</dd>
			</dl>
<!--
EOT;
}print <<<EOT
--> 
		</div>
<script type="text/javascript">
var li = document.getElementById("friList");
var tt = li.getElementsByTagName("dl");
for(i=0; i<tt.length; i++){
	tt[i].onmouseover= function(){
		for(j=0; j<tt.length; j++){
			tt[j].className = "cc nadlA";
			this.className  = "current cc nadlA";
		}
	}
	tt[i].onmouseout= function(){
      for(j=0; j<tt.length; j++){
          this.className  = "cc nadlA";
      }
   }
}
</script>
<!--
EOT;
} else {print <<<EOT
-->
<!--
EOT;
	if ($atype == 'attentioned') {print <<<EOT
-->
		<div class="tac f14 p15">暫無人關注你,<a href="u.php?a=friend&type=find">試試關注別人吧</a></div>
<!--
EOT;
	} else {print <<<EOT
-->
		<div class="tac f14 p15">暫無關注,<a href="u.php?a=friend&type=find">尋找我要關注的人</a></div>
<!--
EOT;
	}print <<<EOT
-->
<!--
EOT;
}print <<<EOT
-->                                
		<div class="mt10 cc">$pages</div>
	</div>
<!--
EOT;
} elseif ($type == 'find') {
if ($step != 2 ){
	$check = "checked=".'"checked"';
}
print <<<EOT
-->
<form action="u.php" method="get" onsubmit="return checkSubmit();">
<input type="hidden" name="a" value="friend">
<input type="hidden" name="type" value="find">
<input type="hidden" name="step" value="2">
	<div class="friSearch p15 cc mb10">
		<div class="fl friSip mr5">
			<input class="f14 fl" type="text" size="50" name="f_keyword" value="$f_keyword" maxlength="35" id="f_keyword" />
		<span class="dropdown">
			<select name="according" id="friSelect">
				<option value="user" $userchecked>用戶名</option>
				<option value="uid" $uidchecked>UID</option>
				<option value="email" $emailchecked>電子郵箱</option>
				<option value="tags" $tagschecked>標簽</option>			
			</select>
		</span>
		</div>
		<span class="mr20"><span class="btn"><span><button type="submit">查找</button></span></span></span>
<!--
EOT;
$rg_config  = L::reg();
if (!($rg_config['rg_allowregister'] == 0 || ($rg_config['rg_registertype'] == 1 && date('j',$timestamp) != $rg_config['rg_regmon']) || ($rg_config['rg_registertype'] == 2 && date('w',$timestamp) != $rg_config['rg_regweek']))) {
print <<<EOT
--> 
		想找更多朋友，馬上<a href="u.php?a=friend&type=invite">開始邀請</a>
<!--
EOT;
}print <<<EOT
-->
	</div>
</form>
<script type="text/javascript">
var ld=window.onload;
function checkSubmit() {
	var keyWord = getObj("f_keyword").value;
	if (keyWord == '' || keyWord == null) {
		showDialog('error','關鍵字不能為空,請重新輸入',1);
		return false;
	}
	//window.location = '{$thisbase}type=find&step=2&f_keyword=' + keyWord + '&according=' + getObj('according').value;
	return true;
}
function changDisplay(source,target) {
	var objsource = getObj(source);
	objsource.style.display = 'none';
	var objtarget = getObj(target);
	objtarget.style.display = '';
}
window.onReady(function(){
	var photoselect = new sSelect(getObj('friSelect'));
})
</script>
<div>
<!--
EOT;
if (empty($step)) {print <<<EOT
-->
<!--
EOT;
if ($recommendUsers) {print <<<EOT
-->
	<h5 class="h5 mb10"><strong>可能感興趣的人</strong></h5>
	<ul class="threeLines cc">
<!--
EOT;
$userService = L::loadClass('UserService', 'user');
foreach ($recommendUsers as $member){
$groupId = ($member['groupid'] == '-1') ? $member['memberid'] : $member['groupid'];
$groupRight = $userService->getRightByGroupId($groupId);
//$db_menuinit .= ",'td_recommendUsers{$member[uid]}' : 'menu_recommendUsers{$member[uid]}'";
print <<<EOT
-->
		<li>
			<dl class="friDl cc p10 mr10 mb10">
				<dt class="fl mr10"><a class="img_50 _cardshow" data-card-url="pw_ajax.php?action=smallcard&type=showcard&uid={$member[uid]}" href="u.php?uid={$member['uid']}" target="_blank" data-card-key="{$member['username']}"><img height="44" width="44" src="$member[face]"/></a></dt>
				<dd>
					<div class="lh_18">
<!--
EOT;
if (!$member['attention']) {print <<<EOT
-->
<a href="javascript:;" onclick="Attention.add(this,'{$member['uid']}',1);" class="add_follow fr" name="att_recommend">加關注</a>
<!--
EOT;
} else {print <<<EOT
--><a href="javascript:;" class="fr add_following gray">關注中</a>
<!--
EOT;
}print <<<EOT
-->
<!--
EOT;
$gender = getDefaultGender($member['gender']);
if (checkOnline($member['thisvisit'])) {
print <<<EOT
--><span class="{$gender}_ol mr5" title="在線" alt="在線">在線</span><!--
EOT;
}print <<<EOT
-->
<a href="{$db_userurl}$member[uid]" class="b _cardshow" data-card-url="pw_ajax.php?action=smallcard&type=showcard&uid={$member[uid]}" data-card-key="{$member['username']}">$member[username]</a></div>
<!--
EOT;
if ($member['honor'] && $groupRight['allowhonor']) {print <<<EOT
-->
					<div class="lh_18">{$member['honor']}</div>
<!--
EOT;
} else {print <<<EOT
-->
					<div>該用戶暫無簽名</div>
<!--
EOT;
}print <<<EOT
-->
					<a href="javascript:;" class="adown s6 fr" id="td_recommendUsers{$member[uid]}" onmouseover="read.open('menu_recommendUsers{$member[uid]}','td_recommendUsers{$member[uid]}');">更多操作</a>
					<div class="pw_menu" style="display:none;" id="menu_recommendUsers{$member[uid]}">
						<ul class="menuList" style="width:70px;">
<!--
EOT;
if (!in_array($member['uid'], $friendsAllUids)) {print <<<EOT
-->
									<li><a href="javascript:;"  onclick="sendmsg('pw_ajax.php?action=addfriend&touid={$member[uid]}&reload=1');">加為好友</a></li>
<!--
EOT;
 } else {print <<<EOT
-->
									<li><a href="javascript:;" onclick="pwConfirm('是否確認解除？',this,function(){delFriend('$member[uid]')});" title="解除好友">解除好友</a></li>
<!--
EOT;
}print <<<EOT
-->
							<li><a href="javascript:;" onclick="sendmsg('pw_ajax.php?action=msg&touid={$member[uid]}');">發送消息</a></li>
<!--
EOT;
if ($member['attention']) {print <<<EOT
-->
							<li><a href="javascript:;" onclick="pwConfirm('是否取消關注？',this,function(){Attention.del('{$member[uid]}')});" title="取消關注">取消關注</a></li>
<!--
EOT;
}print <<<EOT
-->
						</ul>
					</div>
					被關注︰<span id="att_recommend_{$member[uid]}">{$member['fans']}</span>
				</dd>
			</dl>
		</li>
<!--
EOT;
}print <<<EOT
-->
	</ul>
<!--
EOT;
}print <<<EOT
-->

<!--
EOT;
if ($mostFriends) {print <<<EOT
-->
	<h5 class="h5 mb10"><strong>好友的好友</strong></h5>
	<ul class="threeLines cc">
<!--
EOT;
$userService = L::loadClass('UserService', 'user');
foreach ($mostFriends as $member){
$groupId = ($member['groupid'] == '-1') ? $member['memberid'] : $member['groupid'];
$groupRight = $userService->getRightByGroupId($groupId);
//$db_menuinit .= ",'td_mostFriends{$member[uid]}' : 'menu_mostFriends{$member[uid]}'";
print <<<EOT
-->
		<li>
			<dl class="friDl cc p10 mr10 mb10">
				<dt class="fl mr10"><a class="img_50 _cardshow" data-card-url="pw_ajax.php?action=smallcard&type=showcard&uid={$member[uid]}" href="u.php?uid={$member['uid']}" target="_blank" data-card-key="{$member['username']}"><img height="44" width="44" src="$member[face]"/></a></dt>
				<dd>
					<div class="lh_18">
<!--
EOT;
if (!$member['attention']) {print <<<EOT
-->
<a href="javascript:;" onclick="Attention.add(this,'{$member['uid']}',1)" class="add_follow fr" name="att_friends">加關注</a>
<!--
EOT;
} else {print <<<EOT
--><a href="javascript:;" class="fr add_following gray">關注中</a>
<!--
EOT;
}print <<<EOT
-->
<!--
EOT;
$gender = getDefaultGender($member['gender']);
if (checkOnline($member['thisvisit'])) {
print <<<EOT
--><span class="{$gender}_ol mr5" title="在線" alt="在線">在線</span><!--
EOT;
}print <<<EOT
-->
<a href="{$db_userurl}$member[uid]" class="b _cardshow" data-card-url="pw_ajax.php?action=smallcard&type=showcard&uid={$member[uid]}" data-card-key="{$member['username']}">$member[username]</a></div>
<!--
EOT;
if ($member['honor'] && $groupRight['allowhonor']) {print <<<EOT
-->
					<div class="lh_18">{$member['honor']}</div>
<!--
EOT;
} else {print <<<EOT
-->
					<div>該用戶暫無簽名</div>
<!--
EOT;
}print <<<EOT
-->
					<a href="javascript:;" class="adown s6 fr" id="td_mostFriends{$member[uid]}" onmouseover="read.open('menu_mostFriends{$member[uid]}','td_mostFriends{$member[uid]}');">更多操作</a>
					<div class="pw_menu" style="display:none;" id="menu_mostFriends{$member[uid]}">
						<ul class="menuList" style="width:70px;">
<!--
EOT;
if (!in_array($member['uid'], $friendsAllUids)) {print <<<EOT
-->
									<li><a href="javascript:;"  onclick="sendmsg('pw_ajax.php?action=addfriend&touid={$member['uid']}&reload=1');">加為好友</a></li>
<!--
EOT;
 } else {print <<<EOT
-->
									<li><a href="javascript:;" onclick="pwConfirm('是否確認解除？',this,function(){delFriend('$member[uid]')});" title="解除好友">解除好友</a></li>
<!--
EOT;
}print <<<EOT
-->
							<li><a href="javascript:;" onclick="sendmsg('pw_ajax.php?action=msg&touid={$member[uid]}');">發送消息</a></li>
<!--
EOT;
if ($member['attention']) {print <<<EOT
-->
							<li><a href="javascript:;" onclick="pwConfirm('是否取消關注？',this,function(){Attention.del('{$member[uid]}')});" title="取消關注">取消關注</a></li>
<!--
EOT;
}print <<<EOT
-->
						</ul>
					</div>
					被關注︰<span id="att_friends_{$member[uid]}">{$member['fans']}</span>
				</dd>
			</dl>
		</li>
<!--
EOT;
}print <<<EOT
-->
	</ul>
<!--
EOT;
}print <<<EOT
-->	

<!--
EOT;
if ($onlineMembers) {print <<<EOT
-->
	<h5 class="h5 mb10"><strong>當前在線的人</strong></h5>
	<ul class="threeLines cc">
<!--
EOT;
$userService = L::loadClass('UserService', 'user');
foreach ($onlineMembers as $member) {
//$db_menuinit .= ",'td_onlineMembers{$member[uid]}' : 'menu_onlineMembers{$member[uid]}'";
$groupId = ($member['groupid'] == '-1') ? $member['memberid'] : $member['groupid'];
$groupRight = $userService->getRightByGroupId($groupId);
print <<<EOT
-->
		<li>
			<dl class="friDl cc p10 mr10 mb10">
				<dt class="fl mr10"><a class="img_50 _cardshow" data-card-url="pw_ajax.php?action=smallcard&type=showcard&uid={$member[uid]}" href="u.php?uid={$member['uid']}" target="_blank" data-card-key="{$member['username']}"><img height="44" width="44" src="$member[face]"/></a></dt>
				<dd>
					<div class="lh_18">
<!--
EOT;
if (!$member['attention']) {print <<<EOT
-->
<a href="javascript:;" onclick="Attention.add(this,'{$member['uid']}',1)" class="add_follow fr" name="att_online">加關注</a>
<!--
EOT;
} else {print <<<EOT
--><a href="javascript:;" class="fr add_following gray">關注中</a>
<!--
EOT;
}print <<<EOT
-->
<!--
EOT;
$gender = getDefaultGender($member['gender']);
if (checkOnline($member['thisvisit'])) {
print <<<EOT
--><span class="{$gender}_ol mr5" title="在線" alt="在線">在線</span><!--
EOT;
}print <<<EOT
--><a href="{$db_userurl}$member[uid]" target="_blank" class="b _cardshow" data-card-url="pw_ajax.php?action=smallcard&type=showcard&uid={$member[uid]}" data-card-key="{$member['username']}" >$member[username]</a></div>
<!--
EOT;
if ($member['honor'] && $groupRight['allowhonor']) {print <<<EOT
-->
					<div class="lh_18">{$member['honor']}</div>
<!--
EOT;
} else {print <<<EOT
-->
					<div>該用戶暫無簽名</div>
<!--
EOT;
}print <<<EOT
-->
					<a href="javascript:;" class="adown s6 fr" id="td_onlineMembers{$member[uid]}" onmouseover="read.open('menu_onlineMembers{$member[uid]}','td_onlineMembers{$member[uid]}');">更多操作</a>
					<div class="pw_menu" style="display:none;" id="menu_onlineMembers{$member[uid]}">
						<ul class="menuList" style="width:70px;">
<!--
EOT;
if (!in_array($member['uid'], $friendsAllUids)) {print <<<EOT
-->
									<li><a href="javascript:;"  onclick="sendmsg('pw_ajax.php?action=addfriend&touid={$member['uid']}&reload=1');">加為好友</a></li>
<!--
EOT;
 } else {print <<<EOT
-->
									<li><a href="javascript:;" onclick="pwConfirm('是否確認解除？',this,function(){delFriend('$member[uid]')});" title="解除好友">解除好友</a></li>
<!--
EOT;
}print <<<EOT
-->
							<li><a href="javascript:;" onclick="sendmsg('pw_ajax.php?action=msg&touid={$member[uid]}');">發送消息</a></li>
<!--
EOT;
if ($member['attention']) {print <<<EOT
-->                        
							<li><a href="javascript:;" onclick="pwConfirm('是否取消關注？',this,function(){Attention.del('{$member[uid]}')});" title="取消關注">取消關注</a></li>
<!--
EOT;
}print <<<EOT
-->
						</ul>
					</div>
					被關注︰<span id="att_online_{$member[uid]}">{$member['fans']}</span>
				</dd>
			</dl>
		</li>
<!--
EOT;
}print <<<EOT
-->
	</ul>
<!--
EOT;
}} else {
if($members){print<<<EOT
-->
	<h5 class="h5 mb10"><strong>搜索  {$keyword}  找到{$count}個人</strong></h5>
	<ul class="threeLines cc">
<!--
EOT;
$userService = L::loadClass('UserService', 'user');
foreach ($members as $key => $member){
$groupId = ($member['groupid'] == '-1') ? $member['memberid'] : $member['groupid'];
$groupRight = $userService->getRightByGroupId($groupId);
print <<<EOT
-->
		<li>
			<dl class="friDl cc p10 mr10 mb10">
				<dt class="fl mr10"><a class="img_50 _cardshow" data-card-url="pw_ajax.php?action=smallcard&type=showcard&uid={$member[uid]}" href="u.php?uid={$member['uid']}" target="_blank" data-card-key="{$member['username']}"><img height="44" width="44" src="$member[face]"/></a></dt>
				<dd>
					<div class="lh_18">
<!--
EOT;
$gender = getDefaultGender($member['gender']);
if (checkOnline($member['thisvisit'])) {
print <<<EOT
--><span class="{$gender}_ol mr5" title="在線" alt="在線">在線</span><!--
EOT;
}print <<<EOT
-->
					<a href="{$db_userurl}$member[uid]" class="b _cardshow" data-card-url="pw_ajax.php?action=smallcard&type=showcard&uid={$member[uid]}" target="_blank" data-card-key="{$member['username']}">$member[username]</a>
					</div>
<!--
EOT;
if ($according == 'tags') {
print <<<EOT
-->
					<div class="lh_18">{$memberTags[$member[uid]]}</div>
<!--
EOT;
} else {
	if ($member['honor'] && $groupRight['allowhonor']) {print <<<EOT
-->
					<div class="lh_18">{$member['honor']}</div>
<!--
EOT;
	} else {print <<<EOT
-->
					<div>該用戶暫無簽名</div>
<!--
EOT;
	}
}print <<<EOT
-->
					<div class="cc">
<!--
EOT;
if (!$member['attention']) {print <<<EOT
-->
						<div class="fl mr10" id="att_{$value['uid']} "><a href="javascript:;" onclick="Attention.add(this,'{$member['uid']}',1)" class="add_follow" >加關注</a></div>
<!--
EOT;
} else {print <<<EOT
-->
						<a href="javascript:;" onclick="pwConfirm('是否取消關注？',this,function(){Attention.del('{$member[uid]}')});" title="取消關注" class="s6 mr10">取消關注</a>
<!--
EOT;
}print <<<EOT
-->
<!--
EOT;
if (!in_array($member['uid'], $friendsAllUids)) {print <<<EOT
-->
						<a href="javascript:;"  onclick="sendmsg('pw_ajax.php?action=addfriend&touid={$member[uid]}&reload=1');" title="加為好友" class="add_follow">加為好友</a>
<!--
EOT;
} else {print <<<EOT
-->
						<a href="javascript:;" onclick="pwConfirm('是否確認解除？',this,function(){delFriend('$member[uid]')});" title="解除好友">解除好友</a>
<!--
EOT;
}print <<<EOT
-->
					</div>
				</dd>
			</dl>
		</li>
<!--
EOT;
}print <<<EOT
-->
	</ul>
	<div class="cc mb10">$pages</div>
<!--
EOT;
}else {print <<<EOT
-->
	<div class="f14 tac p15">很抱歉，沒有搜到你要的人</div>
<!--
EOT;
}}print <<<EOT
-->
</div>
<!--
EOT;
}elseif ($type == 'invite') {
	require_once(uTemplate::printEot('friend_invite'));
}elseif ($type == 'inviteCode') {
	require_once(uTemplate::printEot('friend_invitecode'));
}print <<<EOT
-->
	</div>
</td></tr></table>
</div>
<script type="text/javascript" src="js/app_global.js"></script>
<script type="text/javascript" src="u/js/friend.js"></script>
<script type="text/javascript" src="js/app_type.js"></script>
<script type="text/javascript" src="js/select.js"></script>
<!--
EOT;
require_once(uTemplate::printEot('footer'));
?>-->