Hello!

To see the file structure, click on "tree".

Note that updates take place every 10 minutes, commits may not be seen immediately.
Added a max return count of 50, filtered out OBSOLETE terms and any
authorpreecej <preecej@localhost>
Fri, 15 Jul 2011 18:24:00 +0000 (18:24 +0000)
committerpreecej <preecej@localhost>
Fri, 15 Jul 2011 18:24:00 +0000 (18:24 +0000)
terms not affiliated with the two branches of the PO (anatomy, and
growth & development stages).

svn path=/; revision=121

preecej/semantic_wiki/prototyping/TermSearch_JSON.php

index ab57a6adc8ddff6bb609d4b8be770b8a846235e6..e57cd89524ad9b9f0970414e851e5db3d9a3cef3 100644 (file)
@@ -15,6 +15,7 @@ if(isset($_GET['user']) && ($_GET['user']) == 'paw') {
             : die('"field" is a required parameter and must match an available data field.');
             
         $number_of_terms = isset($_GET['max']) ? intval($_GET['max']) : 10; //10 is the default
+        if ($number_of_terms > 50) { $number_of_terms = 50; } 
 
         $qval = $_GET['qval'];
         
@@ -36,6 +37,7 @@ if(isset($_GET['user']) && ($_GET['user']) == 'paw') {
                 $query = "SELECT t.$field FROM term t"
                     . " LEFT JOIN term_definition d ON d.term_id = t.id"
                     . " WHERE t.$field LIKE '%$qval%'"
+                    . " AND t.term_type in ('plant_anatomy','plant_growth_and_development_stage')"
                     . " AND UCASE(t.name) NOT LIKE 'OBSOLETE%'"
                     . " AND UCASE(d.term_definition) NOT LIKE 'OBSOLETE%'"
                     . " ORDER BY name LIMIT $number_of_terms";