$data = $tm->getXML(); } break; case 'tnrs_taxamatch': require_once 'classes/class.taxamatch.php'; require_once 'classes/class.tnrs_aggregator.php'; if ($cache) { $output = 'rest'; } $db = select_source($source, $classification); $data = array(); $names = preg_split("/[\r\n;]+/u", $str); if (is_array($names)) { foreach ($names as $name) { $tm = new Taxamatch($db); $tm->set('debug_flag', $debug); $tm->set('output_type', strtolower($output)); $tm->set('cache_flag', $authorities[$source]['cache_flag']); $tm->set('cache_path', CACHE_PATH); $tm->set('name_parser', NAME_PARSER); $tm->set('chop_overload', CHOP_OVERLOAD); $tm->set('parse_only', $parse_only); if ($tm->process($name, $search_mode, $cache)) { $tm->generateResponse($cache); } $ta = new TnrsAggregator($db); $ta->aggregate($tm); $data[] = $ta->getData(); } } //$debug = $tm->debug;
$source = explode(",", $source); $db = select_source($source, $classification); $header = TnrsAggregator::$field; if (isset($count)) { array_unshift($header, "ID"); } $outfh = fopen($outfile, 'w') or die("can't open outputfile"); fputcsv($outfh, $header); $handle = fopen($file, "r"); while (($field = fgetcsv($handle, 1000, ",")) !== FALSE) { if (!isset($field[0]) || $field[0] == '') { continue; } $ta = new TnrsAggregator($db); $tm = new Taxamatch($db); $tm->set('debug_flag', ''); $tm->set('output_type', ''); $tm->set('cache_flag', false); $tm->set('cache_path', CACHE_PATH); $tm->set('name_parser', NAME_PARSER); $tm->set('chop_overload', CHOP_OVERLOAD); $tm->set('parse_only', $parse_only); $name = escapeshellarg($field[0]); if ($tm->process($name, $search_mode, $cache) && !$parse_only) { $tm->generateResponse($cache); } $ta->aggregate($tm); $result = $ta->getData(); foreach ($result as $re) { if (isset($count)) { array_unshift($re, $count);
$cmd = 'search'; } switch($cmd) { case 'search_results': $output = ''; $source = $_REQUEST['source']; $searchtxt = $_REQUEST['search_txt']; $search_mode = 'normal'; $debug = 0; $db = select_source( $source ); $tm = new Taxamatch($db); $tm->set('debug_flag',$debug); $tm->set('output_type',strtolower($output)); if($tm->process($searchtxt , $search_mode, $cache )) { $tm->generateResponse($cache); } $data = $tm->getData(); $debug = $tm->debug; ?> <ul title="Results" class="panel" > <div class="panel" title="Results" id="results" style="left: 0%;" selected="true"> <h2><?=$searchtxt ?></h2> <fieldset class="forceleft"> <div class="row forceleft" style="min-height: 22px; padding-left: 10px">