<?php
$bt ="我关注的陌生人";
include("../conn.php");
include("../head.php");
include_once("../function.php");
$sid = sqlstr($_COOKIE['dl']);
$uin=mysql_fetch_array(mysql_query("select * from user where sid='$sid'"));
$id=$uin['id'];
if(!$uin){
header("Location:../login.php");
exit;//跳转到登录页面
}
$page= $_GET['page'];

echo <<<htm
<div class="hui"><div class="zuo"><a href="/m/diary/diary.php">流年时刻</a></div><div class="you">关注的人 | <a href="/m/diary/index.php">返回</a></div></div>
htm;
$mun=mysql_num_rows(mysql_query("SELECT * FROM att WHERE bid='${id}'"));
if($mun){}
else{
$mun="0";
}
$max=mysql_num_rows(mysql_query("SELECT * FROM att WHERE fid='$id'"));
echo '<div id="main">你关注<font color="red"><b>'.$max.'</b></font>人|有<font color="red"><b>'.$mun.'</b></font>人也默默关注你</div>';

$p=ceil($max/10);
if(!$page or $page>$p){
$page=1;
}
$low=10*($page-1);//开始查询的条数
$pagesize=10;//每页查询的条数
$rs=mysql_query("SELECT * FROM att WHERE fid='$id' ORDER BY time DESC LIMIT {$low},{$pagesize}");//列出最新


while($uinfo=mysql_fetch_array($rs)){
$row=mysql_fetch_array(mysql_query("select * from user where id='$uinfo[bid]'"));
$name=$row["name"];
$tx=$row["tx"];
$qm=$row["qm"];
$time=ctime($uinfo['time']); 
echo '<div id="main"><div class="youlist"><div class="listyou">从'.$time.'开始关注</div></div><br/>
<div><span class="zuo"><img src="'.$tx.'" alt="头像" width="50" height="50" /></span><span class="you">　<font color="red"><b>'.$name.'</b></font><br/>　<a href="/m/user/?'.$uinfo[bid].'">进入主页»</a></span></div><br/>”'.$qm.'”</div><br/>';
}

if($max){ echo '<br/><div class="hui">';
if($page>1){
$pag=$page-1;
echo '<center><a href="all.php?page='.$pag.'">上一页</a>　';
} if($page<$p){
$page=$page+1;
echo  '　<a href="all.php?page='.$page.'">下一页</a>';
}
$pa=$page-1;
echo '</center>';
echo '共'.$p.'页/第'.$pa.'页/对'.$max.'人感兴趣</div>';
}else{
echo '<br/><br/><div id="main">你还没有对别人的日记感兴趣啦</div><br/><br/>';
}

?>

<?php include("../footer.php"); ?>