Example #1
0
 function DisplayText()
 {
     $text = '';
     if (db_reference_from_bhl($this->id)) {
         $pages = bhl_retrieve_reference_pages($this->id);
         $page_ids = array();
         foreach ($pages as $p) {
             $page_ids[] = $p->PageID;
         }
         $text = bhl_fetch_text_for_pages($page_ids);
         $text = str_replace('\\n', "\n", $text);
         $text = str_replace("\n ", "\n", $text);
         // wiki experiments
         /*
         foreach ($page_ids as $page)
         {
         	$names = names_in_page($page);
         	print_r($names);
         }
         */
     }
     header("Content-type: text/plain; charset=utf-8\n\n");
     echo $text;
 }
Example #2
0
 function Retrieve()
 {
     if ($this->id != 0) {
         $this->object = db_retrieve_reference($this->id);
         $this->in_bhl = db_reference_from_bhl($this->id);
     }
     // Geocoding?
     if ($this->in_bhl) {
         if (!bhl_has_been_geocoded($this->id)) {
             bhl_geocode_reference($this->id);
         }
         $this->localities = bhl_localities_for_reference($this->id);
     }
     // Specimens?
     if ($this->in_bhl) {
         if (!specimens_has_been_parsed($this->id)) {
             specimens_from_reference($this->id);
         }
         $this->specimens = specimens_from_db($this->id);
     }
     return $this->object;
 }