Changeset 154 for trunk/includes/pages/search/search.php
- Timestamp:
- 03/09/2006 08:07:26 AM (6 years ago)
- File:
-
- 1 edited
-
trunk/includes/pages/search/search.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/pages/search/search.php
r122 r154 20 20 */ 21 21 22 if (get('subpage') != '') { 23 include_once(ROOT_PATH."includes/pages/search/search_".get('subpage').".php"); 24 } else { 25 include_once(ROOT_PATH."includes/pages/search/search_query.php"); 26 } 27 28 22 29 class search { 23 30 24 31 var $tpl; 32 var $page; 25 33 26 34 function search() { 27 35 if (get('subpage') != '') { 36 $p = "search_".get('subpage'); 37 $this->page = new $p; 38 } else { 39 $this->page = new search_query; 40 } 28 41 } 29 42 30 43 function output() { 31 global $db, $vars; 32 $q = get('q'); 33 if (is_numeric($q) && strpos($q, ".") === FALSE) { 34 $page = array("page" => "nodes", "node" => $q); 35 } elseif ($db->cnt('', 'nodes', "name = '".$q."'") == 1) { 36 $node = $db->get('id', 'nodes', "name = '".$q."'"); 37 $page = array("page" => "nodes", "node" => $node[0]['id']); 38 } elseif (is_ip($q, FALSE)) { 39 $page = array("page" => "ranges", 40 "subpage" => "search", 41 "form_search_ranges_search" => serialize(array("ip" => $q)) 42 ); 43 } elseif (substr($q, -strlen(".".$vars['dns']['root_zone'])) == ".".$vars['dns']['root_zone']) { 44 $page = array("page" => "dnszones", 45 "form_search_dns_search" => serialize(array("dns_zones__name" => $q)) 46 ); 47 } else { 48 $page = array("page" => "nodes", 49 "form_search_nodes_search" => serialize(array("nodes__name" => $q)) 50 ); 51 } 52 redirect( makelink($page, '', '', FALSE) ); 44 return $this->page->output(); 53 45 } 54 46
Note: See TracChangeset
for help on using the changeset viewer.
