From 588727c7e2b8954ec3dbde293cf4c4d68b119f9b Mon Sep 17 00:00:00 2001 From: xue <> Date: Mon, 19 Jun 2006 18:38:29 +0000 Subject: Merge from 3.0 branch till 1185. --- buildscripts/index/api_index.php | 3 ++- buildscripts/index/search.php | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 buildscripts/index/search.php (limited to 'buildscripts/index') diff --git a/buildscripts/index/api_index.php b/buildscripts/index/api_index.php index ac2e37a7..c85fa267 100644 --- a/buildscripts/index/api_index.php +++ b/buildscripts/index/api_index.php @@ -25,6 +25,7 @@ class api_index $count = 0; foreach($files as $file) { + echo " processing $file...\n"; $content = $this->get_details($file, $this->_api); $doc = new Zend_Search_Lucene_Document(); @@ -86,8 +87,8 @@ class api_index if(is_file($filepath) && $entry[0] !== '_') $files[] = realpath($filepath); } - return $files; $d->close(); + return $files; } function get_doc_content($file) diff --git a/buildscripts/index/search.php b/buildscripts/index/search.php new file mode 100644 index 00000000..a34363f4 --- /dev/null +++ b/buildscripts/index/search.php @@ -0,0 +1,36 @@ +find(strtolower($keyword)); + $content=''; + foreach($results as $entry) + $content.="
  • link}\">{$entry->title}
  • \n"; + if($content!=='') + { + $count=count($results); + $content="

    Total $count pages matching keyword ".htmlentities($keyword).".\n

      \n$content
    \n"; + } + else + $content="

    No page matches ".htmlentities($keyword).".

    "; +} +else + $content="

    Please specify a keyword to search for.

    "; + +$page=file_get_contents(dirname(__FILE__).'/index.html'); +$page=preg_replace('/.*/ms',$content,$page); +if($keyword!=='') + $page=preg_replace('/ \ No newline at end of file -- cgit v1.2.3