0) { $query = "select * from 'author' where name like '%$word%' limit 0,5"; $Fetch = PDO_FetchAll($query); $iFetch = count($Fetch); if ($iFetch > 0) { echo "
作者($count)
"; for ($i = 0; $i < $iFetch; $i++) { echo "
" . $Fetch[$i]["name"] . "
"; } } } //查标题 $query = "select count(*) from \""._TABLE_RES_INDEX_."\" where title_en like '%$word%' or title like '%$word%'"; $count = PDO_FetchOne($query); $query = "select * from \""._TABLE_RES_INDEX_."\" where title_en like '%$word%' or title like '%$word%' limit 0,20"; $Fetch = PDO_FetchAll($query); $iFetch = count($Fetch); if ($iFetch > 0) { PDO_Connect(_FILE_DB_PALITEXT_); $arrBookType = json_decode(file_get_contents("../public/book_name/booktype.json")); echo "
标题({$count})
"; for ($i = 0; $i < $iFetch; $i++) { $book = $Fetch[$i]["book"]; if (substr($book, 0, 1) == 'p') { $book = substr($book, 1); } $book--; $open_link = "onclick='index_render_res_list(" . $Fetch[$i]["book"] . "," . $Fetch[$i]["album"] . "," . $Fetch[$i]["paragraph"] . ")'"; $bookid = $Fetch[$i]["book"]; $t1 = $arrBookType[$bookid - 1]->c1; $t2 = $arrBookType[$bookid - 1]->c2; $t3 = $arrBookType[$bookid - 1]->c3; $bookInfo = _get_book_info($bookid); $bookname = $bookInfo->title; echo "
"; echo "
{$Fetch[$i]["title"]}"; echo "
{$t1}"; //echo "{$t2} {$t3}"; $path = ""; $parent = $Fetch[$i]["paragraph"]; $deep = 0; $sFirstParentTitle = ""; //循环查找父标题 得到整条路径 while ($parent > -1) { $query = "SELECT * FROM "._TABLE_PALI_TEXT_." where book = ? and paragraph = ? limit 1"; $FetParent = PDO_FetchAll($query,array($bookid,$parent)); if ($deep > 0) { $path = "{$FetParent[0]["toc"]}>{$path}"; } if ($sFirstParentTitle == "") { $sFirstParentTitle = $FetParent[0]["toc"]; } $parent = $FetParent[0]["parent"]; $deep++; if ($deep > 5) { break; } } if (strlen($path) > 0) { $path = substr($path, 0, -1); } echo "{$bookname} > {$path}"; echo "
"; echo "
"; } } PDO_Connect(_FILE_DB_RESRES_INDEX_); //查标签 $query = "SELECT count(*) from \""._TABLE_RES_INDEX_."\" where tag like '%$word%'"; $count = PDO_FetchOne($query); $query = "SELECT * from \""._TABLE_RES_INDEX_."\" where tag like '%$word%' limit 10"; $Fetch = PDO_FetchAll($query); $iFetch = count($Fetch); if ($iFetch > 0) { echo ""; } break; case "author": echo "
"; echo "
$word
"; echo "
"; //author id $query = "SELECT id from 'author' where name = '$word'"; $arr_author = PDO_FetchAll($query); if (count($arr_author) > 0) { $author_id = $arr_author[0]["id"]; } //查album $query = "SELECT count(*) from 'album' where author = '$author_id'"; $count = PDO_FetchOne($query); if ($count > 0) { $query = "SELECT * from 'album' where author = '$author_id' limit 0,10"; $Fetch = PDO_FetchAll($query); $iFetch = count($Fetch); if ($iFetch > 0) { echo "
专辑($count)
"; for ($i = 0; $i < $iFetch; $i++) { $open_link = "onclick='index_render_res_list(" . $Fetch[$i]["book"] . "," . $Fetch[$i]["id"] . ",-1)'"; echo "
" . $Fetch[$i]["title"] . "
"; } } } //查资源 $query = "SELECT count(*) from \""._TABLE_RES_INDEX_."\" where author = '$author_id'"; $count = PDO_FetchOne($query); if ($count > 0) { $query = "SELECT * from \""._TABLE_RES_INDEX_."\" where author = '$author_id' limit 0,10"; $Fetch = PDO_FetchAll($query); $iFetch = count($Fetch); if ($iFetch > 0) { echo "
标题($count)
"; for ($i = 0; $i < $iFetch; $i++) { $open_link = "onclick='index_render_res_list(" . $Fetch[$i]["book"] . "," . $Fetch[$i]["album"] . "," . $Fetch[$i]["paragraph"] . ")'"; echo "
" . $Fetch[$i]["title"] . "
"; } } } echo "
"; echo "
"; break; case "album": break; }