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

$userid=intval($_GET["userid"]);
include_once("memberinfo.php");
?>
<html><head><meta http-equiv=content-type content="text/html; charset=utf-8>">
</head>
<script language="javascript" src="js/publicfun.js"></script>
<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">
<div class="stagepad">
<div style="width:100%">
	<table width="100%" border="0" cellspacing="0" cellpadding="0" class="modth">
	<tr><td class="modtl" width="7">&nbsp;</td>
	<td class="modtc" nowrap>
		<table border="0" cellspacing="0" cellpadding="0"><tr><td>
		<div class="modhead"><span class="modtit">好友列表</span> </div>
		</td></tr></table>
	</td>
	<td class="modtc" nowrap align="right"></td>
	<td class="modtr" width="7">&nbsp;</td>
	</tr></table>
<div style="width:100%">
<div id="m_blog" class="modbox">
	<table width="100%" border="0" cellspacing="0" cellpadding="0" class="modact">
	<tr>
<?
$str="SELECT * FROM {$tablepre}haoyou,{$tablepre}clubuser WHERE {$tablepre}haoyou.sign=0 and {$tablepre}clubuser.clubuser_id={$tablepre}haoyou.userid and {$tablepre}haoyou.userid=".$userid." order by {$tablepre}haoyou.id desc";
$rs=mysql_query($str);
$myrow = mysql_fetch_array($rs);
$numrows = mysql_num_rows($rs);
$p = new ft_page;
$p->pvar="page"; 
$p->setvar(array("searchcontent" => $searchcontent));
$p->set(24,$numrows,$psize); 
$rsx=mysql_query($str." limit ".$p->limit());


if ($numrows!=0){
  while ($myrow = mysql_fetch_array($rsx)) {
  $i++;
  $photourl="";
  $userimg=$myrow["userimg"];
  if ($userimg!=""){
     $photourl="userheadimg/".$userimg;
	 }
  else{
     $photourl="blogimages/nophoto.gif";
  }
?>
	<td align="center" valign="bottom" width="25%">
		<table border="0" cellspacing="0" cellpadding="0">
		<tr>
		              <td><img src="<?=$photourl?>" width="84" height="84"></td>
		</tr>
		</table>
		<div class="opt"><a href="home.php?userid=<?=$myrow["id"]?>"><?=$myrow["haoyouname"]?></a><a href="blogsms_add.php?postuser=<?=$myrow["clubuser_name"]?>"><img src="blogimages/ico_sendmsg.gif" border="0" align="absmiddle"></a></div>	
	</td>
<?
  if ($i % 6==0){
  echo "<tr align=center>";
  }
}
?>
	</tr>
  <tr align=center> 
    <td colspan="15"> <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="modact">
                    <tr> 
                      
                    <td width="77%" height="30"> 
                      <div align="center"> 
                        <?
     $p->output(0);
     mysql_free_result($rs);
     mysql_free_result($rsx);
     $db->close(); 
    ?>
                      </div></td>
        </tr>
      </table></td>
  </tr>
<? }else{?>
  <tr bgcolor="#F2F9F9"> 
              <td height="15" align=center class="f12"> <font color="#000000">记录为空!</font></td>
  </tr>
<? }?>
	</table><br>
</div>
</div>
	<table width="100%" border="0" cellspacing="0" cellpadding="0" height="8">
	<tr><td class="modbl" width="7">&nbsp;</td>
	<td class="modbc">&nbsp;</td>
	<td class="modbr" width="7">&nbsp;</td>
	</tr></table>
</div>
</div>
</div>
</div>
<br><center>
<?
include_once("tail.php");
?>
</center>
</body></html>