Changeset 207 for branches/awmn/includes/pages/search/search_suggest.php
- Timestamp:
- 10/03/2009 02:39:59 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/awmn/includes/pages/search/search_suggest.php
r198 r207 4 4 * 5 5 * Copyright (C) 2006 John Kolovos <cirrus@awmn.net> 6 * Copyright (C) 2009 Vasilis Tsiligiannis <b_tsiligiannis@silverton.gr> 6 7 * 7 8 * This program is free software; you can redistribute it and/or modify … … 56 57 } 57 58 } elseif (is_ip($q, FALSE)) { 58 $where = '(ip_ranges.ip_start >= '.ip2long(correct_ip_min($q, TRUE, 1)).' AND ip_ranges.ip_start <= '.ip2long(correct_ip_max($q, TRUE, 1)).") OR ". 59 '(ip_ranges.ip_start >= '.ip2long(correct_ip_min($q, TRUE, 2)).' AND ip_ranges.ip_start <= '.ip2long(correct_ip_max($q, TRUE, 2)).") OR ". 60 '(ip_ranges.ip_start >= '.ip2long(correct_ip_min($q, TRUE, 3)).' AND ip_ranges.ip_start <= '.ip2long(correct_ip_max($q, TRUE, 3)).")"; 59 $where = "("; 60 $s_ranges = ip_to_ranges($q,FALSE); 61 foreach ($s_ranges as $s_range) { 62 $where .= "(ip_ranges.ip_start BETWEEN ".ip2long($s_range['min'])." AND ".ip2long($s_range['max']).") OR "; 63 } 64 $where = substr($where, 0, -4).")"; 61 65 $this->tpl['ip_search'] = $db->get( 62 66 'ip_ranges.ip_start, nodes.id',
Note: See TracChangeset
for help on using the changeset viewer.
