<?php
$title = $chaptername . ' ' . $bookinfo['bookname']. '最新文字章节阅读-' . setting('webname');
$keywords = $bookinfo['bookname'].' '.$chaptername;
$description = $bookinfo['author'].'的小说《'.$bookinfo['bookname'].'》正在连载,当前章节：'.$chaptername.',查看《'.$bookinfo['bookname'].'》最新章节,阅读《'.$bookinfo['bookname'].'》TXT全文,尽在'.setting('webname');
$isReadTpl = true;
?>
<?php include_once tpl('topnav');?>
<link rel="stylesheet" type="text/css" href="<?php echo getCssFile('read.css');?>" />
<script type="text/javascript" src="<?php echo getJsFile('read.js');?>"></script>
<div style="position:absolute;left:0px;top:0px;width:3000px;height:10000px;z-index:1000;background-color:#FFFFFF;padding-left:200px;padding-top:330px;" id="topbgdiv"><?php echo printImage('loding.gif');?> 内容正在裁入，请稍后，时间过长请刷新........</div>
<div class="brbr"></div>

<div class="brbr"></div>
	<div id="cnav"><a href="<?php echo url('index');?>">首页</a>-><a href="<?php echo url('booktype', array('tid'=>$bookinfo['typeid']));?>"><?php echo $bookinfo['typename'];?></a>-><a href="<?php echo url('bookshow',array('bid'=>$bookid));?>"><?php echo $bookinfo['bookname'];?></a>-><a href="<?php echo url('chapter',array('bid'=>$bookid));?>"><?php echo $bookinfo['bookname'];?>章节目录</a>><?php echo $chaptername;?></div>
	<div class="clear"></div>
	
	<script type="text/javascript">pannel();</script>

	<div id="cname">
        <div><?php echo $chaptername;?></div>
        <span>书名：<a href="<?php echo url('chapter', array('bid'=>$bookid));?>"><?php echo $bookinfo['bookname'];?></a>  作者：<?php echo ilink($bookinfo['author'], url('search', array('key'=>$bookinfo['author'],'class'=>2)));?> 字数：<?php echo $chapterSize;?></span>
    </div>
	<div>
        <script type="text/javascript">BAIDU_CLB_fillSlot("220755");</script>
        <span class="bad"><script type="text/javascript">BAIDU_CLB_fillSlot("220758");</script></span>
        <span class="bad"><script type="text/javascript">BAIDU_CLB_fillSlot("220757");</script></span>
        <span class="bad"><script type="text/javascript">BAIDU_CLB_fillSlot("220756");</script></span>
    </div>

	<div class="clear"></div>
		<?php if ($chapter['isimage']):?>
            <?php //$images = explode("\n", $chapterContent);?>
            <?php //if (!empty($images)):?>
                <?php //foreach ($images as $image):?>
                    <?php //$imageFile[] = CHtml::image(Book::model()->getFileUrl($chapter->bookid) . $image);?>
                <?php //endforeach;?>
                <div align="center"><?php //echo implode("<br/>", $imageFile);?></div>
            <?php //endif;?>
        <?php else:?>
        <div id="content">
            <?php echo $content;//echo preg_replace(array('/\n/'), array("<br/>"),  $content);?>
		</div>

		<div class="clear"></div>
		<br/><p align="center"><font size="4">【手机阅读访问 2５800.net】</font>
            <span id="progress">
            <?php if ($isAutoProgress):?>
                <?php echo ilink('返回阅读进度',url('system',array('s'=>'member','c'=>'my','a'=>'progress')));?>
            <?php endif;?>
            </span></p>
    <?php endif;?>

	<div id="cbutton">
		<?php if (!empty($prev_row)):?>
		(快捷键：←)
			<a href="<?php echo url('read', array('bid'=>$bookid, 'cid'=>$prev_row['chapterid']))?>" id="previouschapter">上一章</a>
		<?php else:?>
			(快捷键：←)
			<a href="<?php echo url('bookshow', array('bid'=>$bookid))?>" id="previouschapter">上一章</a>
  		<?php endif;?>
		<a href="<?php echo url('chapter', array('bid'=>$bookid));?>" id="enter">回目录</a> <span>(快捷键：回车)</span>
		<?php if (!empty($next_row)):?>
			<a href="<?php echo url('read', array('bid'=>$bookid, 'cid'=>$next_row['chapterid']));?>" id="nextchapter">下一章</a><span>(快捷键：→)</span>
		<?php else:?>
			<a href="<?php echo url('bookshow', array('bid'=>$bookid));?>" id="nextchapter">下一章</a><span>(快捷键：→)</span>
  		<?php endif;?>
	</div>
	<div class="clear"></div>
	<div id="rtips">
	返回： <a href="<?php echo url('bookshow', array('bid'=>$bookid));?>"><?php echo $bookinfo['bookname'];?></a>书页┊<a href="<?php echo url('index');?>"><?php echo setting('webname');?></a>首页┊<script type="text/javascript">document.write('<a href="javascript:;" onclick="myProgress(event, 1);">阅读进度</a>');</script>
	<br/>
	如有<a href="javascript:void(0);" onclick="report(event, '<?php echo $chaptername;?>');" rel="nofollow">错误</a>，请及时联系我们修正，如你喜欢<em>本书</em>请收藏！<b><a href="javascript:;" onclick="addProgress(<?php echo $bookid;?>,<?php echo $chapterid;?>);" rel="nofollow">+书签</a></b>
	</div>
<script type="text/javascript">LoadClientParm();</script>
<?php echo $jsCode;?>
<div id="footerud"><div id="up"></div><div id="down"></div></div>
<div title="加入书签" id="jrsq" onclick="addProgress(<?php echo $bookid;?>,<?php echo $chapterid;?>);"></div>

<?php
$sql = 'SELECT bookid,bookname,lastchapterid,lastchaptername,wlastchaptername,wlastchapterid FROM '.Book::table().' WHERE isreadtop = 1 ORDER BY updatedate DESC LIMIT 35';
$key = md5($sql);
$list = $cache->get($key);
if (false === $list)
{
    $list = $db->setQueryString($sql)->find();
    $cache->set($key, $list, 60);
}
?>
<div class="clear"></div>
<div class="list">
    <div class="tit">别人都在看什么......</div>
        <ul>
            <?php foreach ($list as $new):?>
            <li class="ne"><a href="<?php echo url('chapter',array('bid'=>$new['bookid']));?>"><?php echo $new['bookname'];?></a><br><a href="<?php echo url('read', array('bid'=>$new['bookid'],'cid'=>$new['wlastchapterid']));?>#from=read"><?php echo $new['wlastchaptername'];?></a></li></li>
            <?php endforeach;?>
        </ul>
    </div>
</div>
<script type="text/javascript">
var progressSaveUrl = '<?php echo url('system', array('s' => 'member', 'a' => 'progress'));?>';
var progressDeleteUrl = '<?php echo url('system', array('s'=> 'member', 'c' => 'my', 'a' => 'progress', 'do' => 'down', 'confirm' => 1));?>';
var reportUrl = '<?php echo url('report', array('bid'=>$bookid,'cid'=>$chapterid));?>';
var ybc = <?php if ($isConfused):?>1<?php else:?>0<?php endif;?>;
</script>
<?php include_once tpl('footer');?>