<?php
if(!defined('InEmpireCMS'))
{
	exit();
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>今日<?=$classname?>阅读排行榜 - <?=$public_r[sitename]?></title>
<link href="<?=$public_r[newsurl]?>skin/v3/t.css" rel="stylesheet" />
</head> 
<body>
<?php 
include(ECMS_PATH.'inpage/topnav.html');
include(ECMS_PATH.'inpage/head.html');
include(ECMS_PATH.'inpage/menu.html');
?>
<div class="w990">
  <div class="weizhi">
    <div class="wznav black">
      <h5>当前位置：<a href="<?=$public_r[newsurl]?>"><?=$public_r[sitename]?></a> > <a href="">今日阅读风云榜首页</a> > <a href="class.php?classid=<?=$classid?>"><?=$classname?></a> </h5>
    </div>
<?php 
include(ECMS_PATH.'inpage/search.html');
?>
    <div class="clear"></div>
  </div>
  <div class="fleft">
    <ul>
	  <li><a href="index.php" class="sehei">风云榜首页</a></li>
	  <li><a href="class.php?classid=0" class="<?=$busty?>">全部</a></li>
	  <?=$classli?>
	</ul>
  </div>

  <div class="fright">
    <div class="cyhd">
		<h3>今日<?=$classname?>阅读排行榜</h3>
    </div>
	<div class="cycon">
	  <table cellspacing=0 cellpadding=0 border=0 width=100% class=ttop>
	  <tr>
	    <th width="50" class="first">排名</th>
		<th>书名</th>
		<th class="tc" width=30%>作者</th>
		<th class="last" width=20%>阅读指数</th>		
	  </tr>
<?php

$where='';
if($classid)
{
	$where.=" and classid='$classid'";
}

//显示
$sql=$empire->query("select * from {$dbtbpre}dongpo_top where time>$td ".$where." order by hit desc limit 50 ");
$i=1;
  while($r=$empire->fetch($sql))
  {
	  $hdline='';
	  $bintro='';
	  $nw='';
	  $kse='hui';
	  $bi=$empire->fetch1("select id,classid,wid,checked from {$dbtbpre}ecms_bookname_index where id=$r[id] limit 1");
	  $bk=$empire->fetch1("select id,title,titleurl,titlepic,smalltext from {$dbtbpre}ecms_bookname where id=$r[id] limit 1");
	  if(!$bi[id] || !$bi[checked]){
		  $bookname='书籍不存在';
		  $wn='';
	  }else{
		  $bookname='<a href="'.$bk[titleurl].'" title="'.$bk[title].'" target="_blank">'.$bk[title].'</a>';
		  if($bi[wid]){
			$wn='<a href="'.$public_r[newsurl].'writer/'.$bi[wid].'/" title="'.GetWname($bi[wid]).'作品集" target="_blank">'.GetWname($bi[wid]).'</a>';
		  }
	  }
	  if($bk[titlepic]){
		  $fengm=$bk[titlepic];
	  }else{
		  $fengm=$public_r[newsurl].'e/data/images/notimg.gif';
	  }
	  $vs=vsrank($r[classid],$r[id],'');
	  if($vs==1){$s='down';}
	  elseif($vs==2){$s='same';}
	  else{$s='up';}
	  $n=getnew($r[classid],$r[id]);
	  if($n){
		  $nw=' <span class="new"></span>';
	  }
	  $ttt=$i++;	  
	  if($ttt<4){
		  $hdline=' class="hideline"';
		  $kse='red';
		  $bintro='
		  <tr class="item-tr">
		    <td colspan="4">
			  <div class="item-info clearfix">
				<a target="_blank" class="item-img" href="'.$bk[titleurl].'"><img src="'.$fengm.'"></a>
				<p class="item-text"><a target="_blank" href="'.$bk[titleurl].'">'.$bk[smalltext].'</a></p>
            </div>
		  </td>
	    </tr>
		  ';
	  }
?>
      <tr<?=$hdline?>>
		<td class="first"><span class="shuzi2 <?=$kse?>"><?=$ttt?></span></td>
		<td class="keyword"><?=$bookname.$nw?></td>
		<td class="tc"><?=$wn?></td>
		<td class="last"><div class="hit <?=$s?>"><?=$r[hit]?></div></td>
      </tr>
	  <?=$bintro?>
<?
}
?>
      </table>
	</div>
  </div>
  <div class="clear"></div>

</div>

<?php 
include(ECMS_PATH.'inpage/foot.html');
?>
</body>
</html>