0) { echo "
"; $res_title = $Fetch[0]["title"]; echo "

$res_title

"; echo "
"; echo "
"; echo "
"; //标题 echo "
《" . $res_title . "》
"; echo "
" . $Fetch[0]["c1"] . " " . $Fetch[0]["c2"] . "
"; echo "
"; echo "
"; //相关专辑 $query = "select album.id,album.title, author.name from album LEFT JOIN author ON album.author = author.id where album.book='$book' "; $Fetch_ather = PDO_FetchAll($query); $iFetchAther = count($Fetch_ather); if ($iFetchAther > 0) { echo ""; } //相关专辑结束 echo "
"; //目录 PDO_Connect(_FILE_DB_PALITEXT_); $query = "SELECT * FROM "._TABLE_PALI_TEXT_." where book = '{$book}' and ( level>'0' and level<8 ) "; $Fetch_Toc = PDO_FetchAll($query); $iFetchToc = count($Fetch_Toc); if ($iFetchToc > 0) { $aLevel = array(); foreach ($Fetch_Toc as $one_title) { $level = $one_title["level"]; if (isset($aLevel["{$level}"])) { $aLevel["{$level}"]++; } else { $aLevel["{$level}"] = 1; } } ksort($aLevel); //找出不是一个的最大层级 foreach ($aLevel as $x => $x_value) { $maxLevel = $x; if ($x_value > 1) { break; } } echo ""; } //目录结束 } } else { //查书中的一个段 PDO_Connect(_FILE_DB_PALITEXT_); $query = "SELECT text from "._TABLE_PALI_TEXT_." where book= '{$book}' and paragraph= '{$paragraph}' "; $res_title = PDO_FetchOne($query); echo "
"; echo "

$res_title

"; echo "
"; echo "
"; echo "
"; //书名 echo "
《{$book_name[$book][0]}》
"; echo "
{$book_name[$book][1]}
"; echo "
"; echo "
"; PDO_Connect(_FILE_DB_RESRES_INDEX_); $query = "SELECT resindex.id,resindex.title,resindex.type,resindex.album,author.name from \""._TABLE_RES_INDEX_."\" as resindex LEFT JOIN author ON resindex.author = author.id where resindex.book='$book' and resindex.paragraph=$paragraph and resindex.type<>7 group by resindex.album"; $Fetch = PDO_FetchAll($query); $iFetch = count($Fetch); if ($iFetch > 0) { $res_title = $Fetch[0]["title"]; //可用资源 echo ""; } //查共享文档 PDO_Connect(_FILE_DB_FILEINDEX_); $query = "SELECT * from "._TABLE_FILEINDEX_." where book=? and paragraph=? and status>0 and share>0 order by create_time"; $Fetch = PDO_FetchAll($query,array($book,$paragraph)); $iFetch = count($Fetch); if ($iFetch > 0) { echo ""; } //目录 PDO_Connect(_FILE_DB_PALITEXT_); $query = "SELECT * from \""._TABLE_RES_INDEX_."\" where book = ? and level>'0' and level<8 and paragraph >= ? "; $Fetch_Toc = PDO_FetchAll($query,array($book,$paragraph)); $iFetchToc = count($Fetch_Toc); if ($iFetchToc > 1) { if ($Fetch_Toc[1]["level"] > $Fetch_Toc[0]["level"]) { echo ""; } } //目录结束 } } else { //查专辑 if ($paragraph == -1) { //查整张专辑 $query = "select album.id,album.title,album.file,album.guid,album.type, author.name from album LEFT JOIN author ON album.author = author.id where album.id='$album' "; //$query = "select * from 'album' where id='$album'"; $Fetch = PDO_FetchAll($query); $iFetch = count($Fetch); if ($iFetch > 0) { echo "
"; //标题 $res_title = $Fetch[0]["title"]; $album_file_name = $Fetch[0]["file"]; $album_guid = $Fetch[0]["guid"]; $album_type = $Fetch[0]["type"]; echo "

$res_title

"; echo "
"; echo "
"; echo "
"; //标题 echo "
" . $res_title . "
"; //echo "
".$Fetch[0]["c1"]." ".$Fetch[0]["c2"]."
"; echo "
" . $Fetch[0]["name"] . "
"; echo "
" . $media_type[$Fetch[0]["type"]] . "
"; echo "
"; echo "
"; $read_link = "reader.php?book=$book&album=$album¶graph=$paragraph"; echo ""; //下载 echo ""; //相关专辑 echo ""; //相关专辑结束 echo "
"; //目录 switch ($album_type) { case 1: case 2: case 6: PDO_Connect(_FILE_DB_PALITEXT_); $query = "select * from "._TABLE_PALI_TEXT_." where book = '{$book}' and level>'0' and level<8 "; break; case 3: $db_file = '../' . $album_file_name; echo "db album:{$db_file}"; PDO_Connect("$db_file"); $query = "select * from 'album' where guid='$album_guid'"; $Fetch_album = PDO_FetchAll($query); $this_album_id = $Fetch_album[0]["id"]; $query = "select * from 'data' where level>'0' and level<8 and album=$this_album_id "; break; } $Fetch_Toc = PDO_FetchAll($query); $iFetchToc = count($Fetch_Toc); if ($iFetchToc > 0) { $aLevel = array(); foreach ($Fetch_Toc as $one_title) { $level = $one_title["level"]; if (isset($aLevel["{$level}"])) { $aLevel["{$level}"]++; } else { $aLevel["{$level}"] = 1; } } ksort($aLevel); //找出不是一个的最大层级 foreach ($aLevel as $x => $x_value) { $maxLevel = $x; if ($x_value > 1) { break; } } echo ""; } //目录结束 } } else { //查专辑中的一个段 $query = "select * from 'index' where album='$album' and paragraph=$paragraph"; $Fetch = PDO_FetchAll($query); $iFetch = count($Fetch); if ($iFetch > 0) { //标题 $res_title = $Fetch[0]["title"]; echo "

$res_title

"; echo "
"; echo "
"; echo "
"; //出自专辑 标题 $query = "select album.id,album.title,album.type,album.file,album.guid, author.name from album LEFT JOIN author ON album.author = author.id where album.id='$album' "; $FetchAlbum = PDO_FetchAll($query); if (count($FetchAlbum) > 0) { $album_type = $FetchAlbum[0]["type"]; $album_file_name = $FetchAlbum[0]["file"]; $album_guid = $FetchAlbum[0]["guid"]; //专辑标题 $info_link = "index_render_res_list($book,$album,-1)"; echo "
" . $FetchAlbum[0]["title"] . "
"; } echo "
" . $FetchAlbum[0]["name"] . "
"; echo "
" . $media_type[$FetchAlbum[0]["type"]] . "
"; echo "
"; echo "
"; //在线阅读 $read_link = "reader.php?book=$book&album=$album¶graph=$paragraph"; echo ""; //相关段落 //$query = "select album.id,album.title,album.file,album.guid,album.type, author.name from album LEFT JOIN author ON album.author = author.id where album.book='$book' and album.id != $album "; $query = "select idx.id , idx.title , idx.album , idx.type , author.name FROM 'index' as idx LEFT JOIN author ON idx.author = author.id WHERE idx.book='$book' and idx.paragraph=$paragraph and idx.album!=$album and idx.type!=7"; $Fetch_ather = PDO_FetchAll($query); $iFetchAther = count($Fetch_ather); if ($iFetchAther > 0) { echo ""; } //目录 switch ($album_type) { case 1: case 2: case 6: PDO_Connect(_FILE_DB_PALITEXT_); $query = "select * from "._TABLE_PALI_TEXT_." where book = '{$book}' and level>'0' and level<8 and paragraph>=$paragraph "; break; case 3: $db_file = "../{$album_file_name}"; PDO_Connect("$db_file"); $query = "select * from 'album' where guid='$album_guid'"; $Fetch_album = PDO_FetchAll($query); $this_album_id = $Fetch_album[0]["id"]; $query = "select * from 'data' where level>'0' and level<8 and paragraph>=$paragraph and album=$this_album_id "; break; } $Fetch_Toc = PDO_FetchAll($query); $iFetchToc = count($Fetch_Toc); if ($iFetchToc > 1) { if ($Fetch_Toc[1]["level"] > $Fetch_Toc[0]["level"]) { echo ""; } } //目录结束 } } }