<?php
/*
* 项目: iOrange(橘子)
* 作者: 离家出走(yzxh24)
* Email: yzxh24@gmail.com
* 主页: www.iorange.cc
*/
/* vim: set ts=4 sw=4: */
define('IN_IORANGE', true);
include ('include/init.php');
if (!isset($_GET['bid']))
{
    Header("HTTP/1.0 404 Not Found");
}
$bookid = S::gp('bid', 'G', 2);
$book = fetchBookInfo($bookid);
$bookname = $book['bookname'];
$bookinfo = str_replace("\n", '<br/>', $book['bookinfo']);

$chapters = Chapter::single()->getChapterList($bookid);
if (!empty($chapters))
{
    $firstChapter = $chapters[0];
}

include_once tpl('bookinfo');