Ignore:
Timestamp:
03/09/2006 08:07:26 AM (6 years ago)
Author:
cirrus
Message:

Add: google suggest-like search input. Closes #93
Add: show_map=no option to not display the map. Closes #47

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/includes/pages/ranges/ranges_search.php

    r71 r154  
    4242                $where = $form_search_ranges->db_data_where(array('ip' => 'exclude')); 
    4343                $table_ip_ranges = new table(array('TABLE_NAME' => 'table_ip_ranges', 'FORM_NAME' => 'table_ip_ranges')); 
    44                 $s_ip = correct_ip($form_search_ranges->data[0]['value']); 
    45                 $where = ($where !=''?"(".$where.") AND ":""). 
    46                                 ($s_ip !=''?"ip_ranges.ip_start <= ".ip2long($s_ip)." AND ip_ranges.ip_end >= ".ip2long($s_ip)." AND ":""); 
     44                $s_ip = $form_search_ranges->data[0]['value']; 
     45                $where = ($where !=''?"(".$where.") AND ":""); 
     46                if ($s_ip !='') $where .= '(ip_ranges.ip_start >= '.ip2long(correct_ip_min($s_ip, TRUE, 1)).' AND ip_ranges.ip_start <= '.ip2long(correct_ip_max($s_ip, TRUE, 1)).") OR ". 
     47                                                '(ip_ranges.ip_start >= '.ip2long(correct_ip_min($s_ip, TRUE, 2)).' AND ip_ranges.ip_start <= '.ip2long(correct_ip_max($s_ip, TRUE, 2)).") OR ". 
     48                                                '(ip_ranges.ip_start >= '.ip2long(correct_ip_min($s_ip, TRUE, 3)).' AND ip_ranges.ip_start <= '.ip2long(correct_ip_max($s_ip, TRUE, 3)).") AND "; 
     49                //$where =  
     50                //              ($s_ip !=''?"ip_ranges.ip_start <= ".ip2long($s_ip)." AND ip_ranges.ip_end >= ".ip2long($s_ip)." AND ":""); 
    4751                if ($where!='') $where = substr($where, 0, -5); 
    4852                $table_ip_ranges->db_data( 
     
    7478                $this->tpl['link_ranges_allocation'] = makelink(array("page" => "ranges", "subpage" => "allocation")); 
    7579                $form_search_ranges = $this->form_search_ranges(); 
    76                 if ($form_search_ranges->data[0]['value'] != '') $form_search_ranges->data[0]['value'] = correct_ip($form_search_ranges->data[0]['value']); 
     80                //if ($form_search_ranges->data[0]['value'] != '') $form_search_ranges->data[0]['value'] = correct_ip($form_search_ranges->data[0]['value']); 
    7781                $this->tpl['form_search_ranges'] = $construct->form($form_search_ranges, __FILE__); 
    7882                $this->tpl['table_ranges'] = $construct->table($this->table_ip_ranges(), __FILE__); 
Note: See TracChangeset for help on using the changeset viewer.