<?php
$rows=20; //每页几条
if($page<1){
	$page=1;
}
$min=($page-1)*$rows;
unset($listdb,$key);
$query = $db->query("SELECT SQL_CALC_FOUND_ROWS A.* FROM {$_pre}article A LEFT JOIN {$_pre}sort B ON A.fid=B.fid WHERE A.yz=1 AND B.fup='$fid' ORDER BY list DESC LIMIT $min,$rows");
$RS=$db->get_one("SELECT FOUND_ROWS()");
$NUM=$RS['FOUND_ROWS()'];
$showpage=getpage('','',"list.php?fid=$fid",$rows,$NUM);
while($rs = $db->fetch_array($query)){
	$key++;
	if($key==1&&$page<2){
		$r=$db->get_one("SELECT * FROM {$_pre}reply WHERE aid='$rs[aid]' AND topic=1");
		$rs[content]=preg_replace('/<([^<]*)>/is',"",$r[content]);
		$rs[content]=preg_replace('/ |　|&nbsp;/is',"",$rs[content]);
	}
	$rs[posttime]=date("Y-m-d H:i",$rs[posttime]);
	$listdb[]=$rs;
}
?>
<!--
<?php
print <<<EOT
--> 
<table border="0" cellspacing="0" cellpadding="0" class="dragTable" width="100%">
  <tr> 
    <td class="head"> 
      <h3 class="L"></h3>
      <span class="TAG">$fidDB[name]</span> 
      <h3 class="R"></h3>
      <span class="more" style="float:right;"></span> 
    </td>
  </tr>
  <tr> 
    <td class="middle"> 
      <!--
EOT;
foreach($listdb AS $key1=>$rs){
$rs[fontweight] =($rs[fonttype]==1)?'font-weight:bold;':'';
$rs[fontcolor]  =$rs[titlecolor]?"color:$rs[titlecolor];":'';
if($key1==0&&$page<2){
$rs[content]=get_word($rs[content],180);
print <<<EOT
-->

      <div style="padding-left:8px;padding-top:5px;"><a href="bencandy.php?fid=$rs[fid]&id=$rs[aid]" style="{$rs[fontcolor]}font-size:14px;font-weight:bold;" target="_blank">$rs[title]</a></div>
<div style="text-indent:2em;border-bottom:1px dotted #ccc;margin-bottom:5px;width:97%;padding-left:8px;color:#666;">{$rs[content]} <span style="color:#C3C3C3;">共有<a style="color:#CC0000;">{$rs[hits]}</a>人关注 评论<a style="color:#CC0000;">{$rs[comments]}</a>条</span> [<A HREF="bencandy.php?fid=$rs[fid]&id=$rs[aid]" target="_blank">阅读全文</A>]</div>
      <!--
EOT;
}else{print <<<EOT
-->

      <div style="clear:both;padding-top:8px;height:21px;width:99%;"> <span style="float:left;color:#990000;margin-right:7px;">[<A HREF="list.php?fid=$rs[fid]" target="_blank" style="color:#990000;">$rs[fname]</A>]</span><span style="float:left;color:#666;"><a href="bencandy.php?fid=$rs[fid]&id=$rs[aid]" style="font-size:14px;{$rs[fontweight]}{$rs[fontcolor]}" target="_blank">$rs[title]</a></span> 
        <span style="float:right;color:#666;padding-right:5px;font-size:14px;color:#777;">{$rs[posttime]}</span> 
      </div>
      <!--
EOT;
}}print <<<EOT
--><div style="clear:both;text-align:center;margin:10px;">$showpage</div>
    </td>
  </tr>
  <tr> 
    <td class="foot"> 
      <h3 class="L"></h3>
      <h3 class="R"></h3>
    </td>
  </tr>
</table>
<!--
EOT;
?>
-->
