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 'index' where title_en like '%$word%' or title like '%$word%'"; $count = PDO_FetchOne($query); $query = "select * from 'index' where title_en like '%$word%' or title like '%$word%' limit 0,20"; $Fetch = PDO_FetchAll($query); $iFetch=count($Fetch); if($iFetch>0){ $dictFileName = _FILE_DB_PALITEXT_; PDO_Connect("sqlite:$dictFileName"); $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 pali_text where \"book\" = '{$bookid}' and \"paragraph\" = '{$parent}' limit 0,1"; $FetParent = PDO_FetchAll($query); 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 "
"; } } $db_file = _FILE_DB_RESRES_INDEX_; PDO_Connect("sqlite:$db_file"); //查标签 $query = "select count(*) from 'index' where tag like '%$word%'"; $count = PDO_FetchOne($query); $query = "select * from 'index' where tag like '%$word%' limit 0,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 'index' where author = '$author_id'"; $count = PDO_FetchOne($query); if($count>0){ $query = "select * from '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; } ?>