";
//前20条记录
$query = "select * from bold where \"word2\" in $realQueryWord limit 0,20";
$Fetch = PDO_FetchAll($query);
$iFetch = count($Fetch);
if ($iFetch > 0) {
PDO_Connect(_FILE_DB_PALITEXT_);
for ($i = 0; $i < $iFetch; $i++) {
$paliword = $Fetch[$i]["word"];
$book = $Fetch[$i]["book"];
$bookInfo = _get_book_info($book);
$bookname = $bookInfo->title;
$bookPath = $bookInfo->c1 . ">" . $bookInfo->c2 . ">" . $bookInfo->c3;
$paragraph = $Fetch[$i]["paragraph"];
$base = $Fetch[$i]["base"];
$pali = $Fetch[$i]["pali"];
echo "
";
echo "
《{$bookname}》 $bookInfo->c1 $bookInfo->c2
";
echo "
$paliword
";
if (strlen($pali) > 1) {
echo "
$pali
";
} else {
PDO_Connect(_FILE_DB_PALITEXT_);
$query = "select * from pali_text where \"book\" = '{$book}' and \"paragraph\" = '{$paragraph}' limit 0,20";
$FetchPaliText = PDO_FetchAll($query);
$countPaliText = count($FetchPaliText);
if ($countPaliText > 0) {
for ($iPali = 0; $iPali < $countPaliText; $iPali++) {
$path = "";
$parent = $FetchPaliText[0]["parent"];
$deep = 0;
$sFirstParentTitle = "";
while ($parent > -1) {
$query = "select * from pali_text where \"book\" = '{$book}' and \"paragraph\" = '{$parent}' limit 0,1";
$FetParent = PDO_FetchAll($query);
if ($sFirstParentTitle == "") {
$sFirstParentTitle = $FetParent[0]["toc"];
}
$path = "{$FetParent[0]["toc"]}>{$path}";
$parent = $FetParent[0]["parent"];
$deep++;
if ($deep > 5) {
break;
}
}
$path = $bookPath . $path . "No. " . $paragraph;
echo "
";
if (substr($paliword, -1) == "n") {
$paliword = substr($paliword, 0, -1);
}
$htmlPara = str_replace(".0", "。0", $FetchPaliText[$iPali]["html"]);
$aSent = str_getcsv($htmlPara, ".");
$aSentInfo = array();
$aBold = array();
echo "
";
foreach ($aSent as $sent) {
//array_push($aSentInfo,false);
//array_push($aBold,false);
if (stristr($sent, $paliword)) {
echo "{$sent}.
";
// $aSent[$i]=str_replace($paliword,"{$paliword}",$aSent[$i]);
//$aSentInfo[$i]=true;
}
//if(stristr($aSent[$i],"bld")){
//$aBold[$i]=true;
//}
}
echo "
";
/*
$output="";
$bold_on=false;
for($i=0;$i
";
$bold_on=true;
}
else{
echo "{$output}
";
$output="";
$bold_on=false;
}
}
else{
if($bold_on){
echo "{$aBold[$i]}
";
}
}
}
*/
//$light_text=str_replace($paliword,"{$paliword}",$FetchPaliText[$iPali]["vri_text"]);
//$light_text=str_replace(".",".
",$light_text);
//echo "{$light_text}
";
}
}
}
echo "";
echo "