<?php
if( !defined('ISDVBBS') ){
	header('HTTP/1.0 404 Not Found');
	exit;
}
global $imgurl;
?><!--<?php
$favCount = count($UserFavName);
$Fav_total = '<font color="'.$Redcolor.'">'.$favCount.'</font>';
for( $i = 0 ; $i < $favCount ; $i++ ){
	$Fav_Select .= "<option value=\"{$i}\" >{$UserFavName[$i]}</option>";
}
$lang['tpl.friend.str2'] = str_replace('{$Fav_total}', $Fav_total, $lang['tpl.friend.str2']);
print <<<EOT
-->
<div id="nav_top">

<span id="Fiend_act" style="display:none;height:0px;"></span>
<table border="0" cellspacing="5" cellpadding="0" width="100%" align=center>
<tr>
<td width="180" valign="top" >
	<table cellspacing="0" cellpadding="3" class="tableborder1" Style="width:100%" >
	<tr id="user_nav"><td height="20">{$lang['tpl.friend.str1']}</td></tr>
	<tr><td class=tablebody5>
{$lang['tpl.friend.str2']}
	</td></tr>
	</table>
	<div class="partition"></div>
	<table cellspacing="0" cellpadding="3" class="tableborder1" Style="width:100%">
	<tr><form method="POST" action="?action=creat"><td>
	<input type="text" name="FavName" size="14" maxlength=14>&nbsp;<button type="submit" name="B1" onMousemove="button_move(this)" onMouseout="button_out(this)">{$lang['tpl.friend.str43']}</button>
	</td></form></tr>
	<tr><form method="POST" action="?action=saveF"><td class=tablebody5>
	<input type="text" name="myFriend" size="14" maxlength=20>&nbsp;<button type="submit" name="B1" onMousemove="button_move(this)" onMouseout="button_out(this)">{$lang['tpl.friend.str44']}</button>
	</td></form></tr>
	<tr><form method="POST" action="?action=search"><td class=tablebody5>
	<input type="text" name="SearchInfo" size="14" maxlength=20>&nbsp;<button type="submit" name="B1" onMousemove="button_move(this)" onMouseout="button_out(this)">{$lang['tpl.friend.str45']}</button>
	</td></form></tr>
	</table>
	<div class="partition"></div>
	<table cellspacing="0" cellpadding="3" class="tableborder1" Style="width:100%">
	<tr id="user_nav"><td height="20" colspan="3">{$lang['tpl.friend.str3']}</td></tr>
	<tr>
	<td width="20" height="20" class="tablebody5" align=center>&nbsp;</td>
	<td width="*" class="tablebody5" align=center>{$lang['tpl.friend.str4']}</td>
	<td width="25" class="tablebody5" align=center>{$lang['tpl.friend.str5']}</td>
	</tr>
<!--
EOT;
if( $favCount <= 0 ):
	print <<<EOT
-->
	<!--{$FavName_List}-->
	<tr>
		<td height="20" colspan="3" class=tablebody1 align=center style="color:{$redcolor}">{$lang['tpl.friend.strings8']}</td>
	</tr>
<!--
EOT;
global $imgurl;
else:
	for( $i = 0 ; $i < $favCount ; $i++ ):
		if( $FavName_id == $i ){
			$FavName_Name = "<font color=\"{$redcolor}\">{$UserFavName[$i]}</font>";
			$FavName_pic = $imgurl.$lang['Dvbbs.mainpic12'];
		} else{
			$FavName_Name = $UserFavName[$i];
			$FavName_pic = $imgurl.$lang['Dvbbs.mainpic13'];
		}
		$fid = $i;
		print <<<EOT
-->
	<!--{$FavName_List}-->
	<!--friendlist.php##FavName组别列表-->
	<tr align="left">
		<td height="20"><img src={$FavName_pic} border=0></td>
		<td><a href="?action=search&fid={$fid}" title="{$lang['tpl.friend.str46']}">{$FavName_Name}</a></td>
		<td align=center><a href="?action=favdel&fid={$fid}">{$lang['tpl.friend.str6']}</a></td>
	</tr>
<!--
EOT;
	endfor;
endif;
print <<<EOT
-->
	</table>
</td>
<td width="*" valign="top" align=center>
<div id="show" style="display:none;height:0px;"></div>
<div id="user_right">
<div id="tabtitle">
<div id="topicbody">
<span>
<div class="user_nav_topic">
<div id=addfriend style="display:none">
<br><table cellpadding=3 cellspacing=1 align=center class=tableborder1 Style="width:98%">
<form action="friendlist.php" method=post name=messager>
<tr><th colspan=2><input type=hidden name="action" value="saveF">
{$lang['tpl.friend.str7']}</th>
</tr>
<tr>
<td class=tablebody1 valign=middle width=70><b>{$lang['tpl.friend.str8']}</b></td>
<td class=tablebody1 valign=middle>
<input type=text name="myFriend" size=50 value="">&nbsp;
<select name="Fav_id">
<option value="-1" selected>{$lang['tpl.friend.str9']}</option>
{$Fav_Select}
</select>
{$lang['tpl.friend.str10']}
</td></tr>
<tr>
<td valign=middle colspan=2 align=center class=tablebody2>
<button type=Submit name=Submit onMousemove="button_move(this)" onMouseout="button_out(this)">{$lang['tpl.friend.str11']}</button>&nbsp;
<button type="reset" name="Clear" onMousemove="button_move(this)" onMouseout="button_out(this)">{$lang['tpl.friend.str12']}</button>
</td></tr></form></table><br>
</div>
<div id=editfav style="display:none">
<br><table cellpadding=3 cellspacing=1 align=center class=tableborder1 Style="width:98%">
<form action="friendlist.php" method=post >
<tr><th colspan=2><input type=hidden name="action" value="editfav">
{$lang['tpl.friend.str13']}</th>
</tr>
<tr>
<td valign=middle colspan=2 align=center class=tablebody1>
{$lang['tpl.friend.str14']}<font color="{$redcolor}">{$lang['tpl.friend.str15']}</font>{$lang['usersms.str1']}{$lang['tpl.friend.str16']}
</td></tr>
<tr>
<td class=tablebody1 valign=middle width=70><b>{$lang['tpl.friend.str17']}</b></td>
<td class=tablebody1 valign=middle>
<input type=text name="fav_name" size=50 value="{$fav_name}">&nbsp;{$lang['tpl.friend.str18']}
</td></tr>
<tr>
<td valign=middle colspan=2 align=center class=tablebody2>
<button type=Submit name="Submit" onMousemove="button_move(this)" onMouseout="button_out(this)">{$lang['tpl.friend.str11']}</button>&nbsp;
<button type="reset" name="Clear" onMousemove="button_move(this)" onMouseout="button_out(this)">{$lang['tpl.friend.str12']}</button>
</td></tr></form></table><br>
</div>
<table width="96%" border="0" cellspacing="0" cellpadding="0">
<form action="friendlist.php" method="POST" name="inbox" id="inbox">
<tr id="user_nav">
<td width="15%" align=center>{$lang['tpl.friend.str19']}</td>
<td width="10%" align=center>{$lang['tpl.friend.str20']}</td>
<td width="*" align=center>{$lang['tpl.friend.str21']}</td>
<td width="10%" align=center>{$lang['tpl.friend.str22']}</td>
<td width="10%" align=center>{$lang['tpl.friend.str23']}</td>
<td width="25%" align=center>{$lang['tpl.friend.str24']}</td>
<td width="10%" align=center>{$lang['tpl.friend.str25']}</td>
</tr>
<!--
EOT;
if( !empty($arrFriendList) && is_array($arrFriendList) ):
	foreach( $arrFriendList as $val ):
		if( $val['userim'] == '' || is_null($val['userim']) ){
			$Friend_HomePage = '';
			$Friend_Oicq = $lang['tpl.friend.str6'];
		} else{
			$Friend_IM = explode('|||',$val['userim']);
			$Friend_HomePage = $Friend_IM[0];
			if( is_numeric($Friend_IM[1]) ){
				$Friend_Oicq = "<a target=\"blank\" href=\"http://wpa.qq.com/msgrd?V=1&Uin={$Friend_IM[1]}&Site={$fsetting['forumname']}&Menu=yes><img border=\"0\"  SRC=\"http://wpa.qq.com/pa?p=1:\"{$Friend_IM[1]}:9\" alt=\"{$lang['tpl.friend.str27']}{$Friend_IM[1]}\"></a>";
			} else{
				$Friend_Oicq = $lang['tpl.friend.str26'];
			}
		}
		$F_id = $val['f_id'];
		$FavName = $UserFavName[$val['f_mod']];
		$Friend_UserName = $val['f_friend'];
		$Friend_Email = $val['useremail'];
		$Img_HomePage = $HomePage_Img;
		$Img_Oicq = $Oicq_img;
		$Img_Msg = $Msg_Img;
		$Img_sms = $Sms_Img;
		$page_count++;
		print <<<EOT
-->
<!--friendlist.php##Friend_List好友信息列表-->
<tr>
<td align=center>{$FavName}</td>
<td align=center><a href="dispuser.php?name={$Friend_UserName}" target=_blank title="{$lang['tpl.friend.str47']} {$Friend_UserName} {$lang['tpl.friend.str48']}">{$Friend_UserName}</a></td>
<td align=center><a href="mailto:{$Friend_Email}" title="{$lang['tpl.friend.str49']} {$Friend_UserName} {$lang['tpl.friend.str50']}">{$Friend_Email}</a></td>
<td align=center>
<a href="{$Friend_HomePage}" title="{$Friend_UserName} {$lang['tpl.friend.str51']}{$Friend_HomePage}" target=_blank>{$Img_HomePage}</a>
</td>
<td align=center>
{$Friend_Oicq}
</td>
<td align=center>
<a title="{$lang['tpl.friend.str49']} {$Friend_UserName} {$lang['tpl.friend.str52']}" href="javascript:openScript('messanger.php?action=new&touser={$Friend_UserName}',500,400)">{$Img_Msg}</a>
</td>
<td align=center><input type=checkbox class="chkbox" name="id[]" value="{$F_id}"></td>
</tr>
<!--
EOT;
	endforeach;
	$colSpan = 7;
	$SearchStr = $GLOBALS['action'];
	print <<<EOT
-->
<!--friendlist.php##公共分页-->
<tr><td valign=middle colspan={$colSpan}>
<table border=0 cellpadding=0 cellspacing=3 width="100%" align=center>
<tr><td valign=middle nowrap>
{$lang['tpl.friend.str28']}<b>{$CurrentPage}</b>/<b>{$Pcount}</b>{$lang['tpl.friend.str29']}&nbsp;
{$lang['tpl.friend.str30']}<b>{$PageNum}</b> {$lang['tpl.friend.str31']}<b>{$totalrec}</b>
</td>
<td valign=middle nowrap align=right>{$lang['tpl.friend.str32']}
<SCRIPT LANGUAGE="JavaScript">
<!--
var CurrentPage={$CurrentPage};
var Pcount={$Pcount};
var Endpage=0;
if (CurrentPage > 4){
	document.write ('<a href="?page=1&{$SearchStr}">[1]</a> ...');
}
if (Pcount>CurrentPage+3)
{
	Endpage=CurrentPage+3
}
else{
	Endpage=Pcount
}
for (var i=CurrentPage-3;i<=Endpage;i++)
{
	if (i>=1){
		if (i == CurrentPage)
		{
			document.write ('<font color="{$redcolor}">['+i+']</font>');
			}
		else{
			document.write ('<a href="?page='+i+'&{$SearchStr}">['+i+']</a>');
		}
	}
}
if (CurrentPage+3 < Pcount){ 
	document.write ('...<a href="?page='+Pcount+'&{$SearchStr}">['+Pcount+']</a>');
}
if (Endpage == 0){ 
	document.write ('...');
}
//-->
</SCRIPT>
</td></tr></table>
</td></tr>
<!--
EOT;
else:
	print <<<EOT
-->
<!--{$Friend_list}-->
<tr><td height="20" colspan="7"  align=center style="color:{$redcolor}">{$lang['tpl.friend.strings8']}</td></tr>
<!--
EOT;
endif;
print <<<EOT
-->
<tr>
<td align=right valign=middle colspan=7 >
<input type=checkbox name=chkall value=on onclick="CheckAll(this.form)" class=chkbox>{$lang['tpl.friend.str33']}&nbsp;
<select name="Fav_id">
<option value="-1" selected>{$lang['tpl.friend.str34']}</option>
{$Fav_Select}
</select>
<INPUT TYPE="hidden" name="action">
<button type=submit name=action1 onclick="{if(confirm('{$lang['tpl.friend.str39']}')){document.inbox.action.value='{$lang['tpl.friend.str54']}';document.inbox.submit();return true;}return false;}" onMousemove="button_move(this)" onMouseout="button_out(this)" value="{$lang['tpl.friend.str54']}">{$lang['tpl.friend.str40']}</button>&nbsp;
<button type=button name=action2 onclick="showsub('editfav')" onMousemove="button_move(this)" onMouseout="button_out(this)">{$lang['tpl.friend.str35']}</button>&nbsp;
<button type=button name=action3 onclick="showsub('addfriend')" onMousemove="button_move(this)" onMouseout="button_out(this)">{$lang['tpl.friend.str36']}</button>&nbsp;
<button type=submit name=action4 onclick="{if(confirm('{$lang['tpl.friend.str37']}')){document.inbox.action.value='{$lang['tpl.friend.str55']}';document.inbox.submit();return true;}return false;}" onMousemove="button_move(this)" onMouseout="button_out(this)" value="{$lang['tpl.friend.str45']}">{$lang['tpl.friend.str38']}</button>&nbsp;
<button type=submit name=action5 onclick="{if(confirm('{$lang['tpl.friend.str41']}')){document.inbox.action.value='{$lang['tpl.friend.str56']}';document.inbox.submit();return true;}return false;}"  onMousemove="button_move(this)" onMouseout="button_out(this)" value="{$lang['tpl.friend.str46']}">{$lang['tpl.friend.str42']}</button>
</td></tr></form></table></div></span></div></div>
</td></tr></table>
</div>
<SCRIPT LANGUAGE="JavaScript">
<!--
function CheckAll(form)  
{  
  for (var i=0;i<form.elements.length;i++)  
    {  
    var e = form.elements[i];  
    if (e.name != 'chkall')  
       e.checked = form.chkall.checked;  
    }  
}
function showsub(ss)
{
ss=document.getElementById(ss)
 if (ss.style.display=="none") 
  {ss.style.display="";

}
 else
  {ss.style.display="none";
   }
}

document.getElementById("show").innerHTML=document.getElementById("Fiend_act").innerHTML;
//-->
</SCRIPT>

<!--
</div>
EOT;
?>-->