<?
include_once("inc/config.php");
include_once("inc/ftbbsdbclass.php");
include_once("inc/pageclass.php");
include_once("inc/publicfun.php");
include_once("conn.php");
include_once("checkuser.php");
include_once("bbsuser.php");

$userid=intval(get_cookie('clubuser_id'));
$pltype=ftbbs_request($_GET["groupname"]);
if ($pltype!=""){
$searchstr=" and groupname='".$pltype."'";
}

$query = "SELECT * FROM {$tablepre}ftbbsmb";
$ftbbsmb=makecache('ftbbsmb.html',$query,$expire);
$pagesize=$ftbbsmb[5];

include_once("memberinfo.php");
?>
<html><head><meta http-equiv=Content-Type content="text/html; charset=utf-8">
</head>
<body>
<center>
<title><?=$username?>的好友管理中心</title>
<link rel="stylesheet" type="text/css" href="<?=$cssfile?>">
<link rel="stylesheet" type="text/css" href="blogcss/blogpage.css">
<?
include_once("usernav.php");
include_once("haoyouhead.php");
?>
<div class="stage">
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="layout">
<tr>
<td valign="top" class="c2t3">
<div id="m_blog" class="modbox">
<?
include_once("usercalog.php");
?>
</div>
</td>
<td valign="top" class="c2t1">
<div id="m_blog" class="modbox">
              <table width="100%"  border="0" cellspacing="0" cellpadding="0">
                <tr valign="middle"> 
                  <td height="50" colspan="6" class="f14" align="center"><strong>好友管理</strong></td>
                </tr>
                <tr> 
                  <td height="1" colspan="6" bgcolor="#336699" class=new14><spacer height="1" type="block"></td>
                </tr>
                <tr> 
                  <td width="24%" height="25"> <div align="left"><strong>好友用户名</strong></div></td>
                  <td width="54%" height="25">所属组名</td>
                  <td width="7%" >
<div align="center">隐藏</div></td>
                  <td width="7%" ><div align="center">编辑</div></td>
                  <td width="7%" >
<div align="center">删除</div></td>
                </tr>
                <tr> 
                  <td height="1" colspan="6" background="blogimages/dotbg.gif"><spacer height="1" type="block"></td>
                </tr>
<?
$sql="select * from {$tablepre}haoyou where userid=".$userid.$searchstr. " order by id desc";
$rs=mysql_query($sql);
$myrow = mysql_fetch_array($rs);
$numrows = mysql_num_rows($rs);
$p = new ft_page;

$p->pvar="page"; 
$p->setvar(array("userid" => $userid)); 
$p->set($pagesize,$numrows,$psize); 
$rsx=mysql_query($sql." limit ".$p->limit());
if ($numrows!=0){
while ($myrow = mysql_fetch_array($rsx)){
?>
                <tr> 
                  <td height="25" ><div class="opt"> <a href="home.php?userid=<?=$myrow["userid"]?>" target="_blank"><?=$myrow["haoyouname"]?></a></div></td>
                  <td><div class="opt"><a href="?groupname=<?=$myrow["groupname"]?>"><?=$myrow["groupname"]?></a></div></td>
                  <td height="25" align="center"><div class="opt"> 
                      <? if ($myrow["sign"]==0){?>
                      <a href="haoyouop.php?id=<?=$myrow["id"]?>&op=top&v=1">显示</a> 
                      <?
					  }
					  else{
					  ?>
                      <a href="haoyouop.php?id=<?=$myrow["id"]?>&op=top&v=0"><font color="#FF0000">隐藏</font></a> 
                      <? }?>
                    </div></td>
                  <td height="25" align="center"><div class="opt"><a href="friend_edit.php?id=<?=$myrow["id"]?>">编辑</a></div></td>
                  <td height="25" align="center"><div class="opt"><a href="haoyouop.php?id=<?=$myrow["id"]?>&op=del">删除</a></div></td>
                </tr>
                <tr> 
                  <td height="1" colspan="6" background="blogimages/dotbg.gif"><spacer height="1" type="block"></td>
                </tr>
<?
}
?>
                <tr> 
                  <td colspan="6" height="35">
<?
$p->output(0);
?>
				  </td>
                </tr>
<?
}
else{
?>
                <tr> 
                  <td colspan="6" height="25">记录为空</td>
                </tr>
<? }?>
              </table>
            </div>
</td>
</tr></table>
</div>
</div>
<br><center>
<?
include_once("tail.php");
?>
  </center>
</center>
</body>
</html>