Changeset 154
- Timestamp:
- 03/09/2006 08:07:26 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 6 added
- 11 edited
-
globals/functions.php (modified) (2 diffs)
-
globals/language/english.php (modified) (1 diff)
-
globals/language/greek.php (modified) (1 diff)
-
includes/main_menu.php (modified) (1 diff)
-
includes/pages/nodes/nodes_search.php (modified) (1 diff)
-
includes/pages/nodes/nodes_view.php (modified) (1 diff)
-
includes/pages/ranges/ranges_search.php (modified) (2 diffs)
-
includes/pages/search/search.php (modified) (1 diff)
-
includes/pages/search/search_query.php (added)
-
includes/pages/search/search_suggest.php (added)
-
includes/pages/search/search_suggest_js.php (added)
-
templates/basic/includes/main_menu.tpl (modified) (1 diff)
-
templates/basic/includes/pages/nodes/nodes_search.tpl (modified) (1 diff)
-
templates/basic/includes/pages/nodes/nodes_view.tpl (modified) (2 diffs)
-
templates/basic/includes/pages/search (added)
-
templates/basic/includes/pages/search/search_suggest.tpl (added)
-
templates/basic/includes/pages/search/search_suggest_js.tpl (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/globals/functions.php
r151 r154 238 238 } 239 239 240 function correct_ip_min($ip, $ret_null=TRUE, $pad=3) { 241 if ($ip == '' && $ret_null === TRUE) return ''; 242 $t = explode(".", $ip, 4); 243 for ($i=0;$i<4;$i++) { 244 if(!isset($t[$i+1]) && $t[$i] != null) { 245 switch (substr($t[$i], 0, 1)) { 246 case '0': 247 break; 248 case '1': 249 case '2': 250 $t[$i] = intval(str_pad($t[$i], (substr($t[$i], 1, 1) >= 6?2:$pad), "0")); 251 break; 252 default: 253 $t[$i] = intval(str_pad($t[$i], ($pad==3?2:$pad), "0")); 254 } 255 }elseif($t[$i] == null) { 256 $t[$i] = 0; 257 }else{ 258 $t[$i] = (integer)($t[$i]); 259 } 260 } 261 return implode(".", $t); 262 } 263 264 function correct_ip_max($ip, $ret_null=TRUE, $pad=3) { 265 if ($ip == '' && $ret_null === TRUE) return ''; 266 $t = explode(".", $ip, 4); 267 for ($i=0;$i<4;$i++) { 268 if(!isset($t[$i+1]) && $t[$i] != null) { 269 switch (substr($t[$i], 0, 1)) { 270 case '0': 271 break; 272 case '1': 273 case '2': 274 $t[$i] = intval(str_pad($t[$i], (substr($t[$i], 1, 1) >= 6?2:$pad), "9")); 275 break; 276 default: 277 $t[$i] = intval(str_pad($t[$i], ($pad==3?2:$pad), "9")); 278 } 279 if ($t[$i] > 255) $t[$i] = 255; 280 }elseif($t[$i] == null) { 281 $t[$i] = 255; 282 }else{ 283 $t[$i] = (integer)($t[$i]); 284 } 285 } 286 return implode(".", $t); 287 } 288 240 289 function generate_account_code() { 241 290 for ($i=1;$i<=20;$i++) { … … 377 426 } 378 427 428 function replace_sql_wildcards($str) { 429 $str = str_replace("*", "%", $str); 430 $str = str_replace("?", "_", $str); 431 return $str; 432 } 433 379 434 ?> -
trunk/globals/language/english.php
r152 r154 73 73 'dns_zones_search' => "Search for DNS zones", 74 74 'dns_zones_found' => "DNS zones found", 75 75 'not_found' => "No results found", 76 76 'all_services' => "Network services", 77 77 'active_services' => "Active services", -
trunk/globals/language/greek.php
r151 r154 85 85 'dns_zones_found' => "ÎÏÎœÎµÏ DNS ÏÎ¿Ï 86 86 βÏÎΞηκαΜ", 87 87 'not_found' => "ÎεΜ βÏÎΞηκαΜ αÏοÏελÎÏΌαÏα", 88 88 'all_services' => "Î¥ÏηÏεÏÎ¯ÎµÏ ÎŽÎ¹ÎºÏÏÎ¿Ï 89 89 ", -
trunk/includes/main_menu.php
r152 r154 155 155 '' 156 156 ); 157 $main->html->head->add_script("text/javascript", makelink(array("page" => "search", "subpage" => "suggest_js"))); 157 158 return template($this->tpl, __FILE__); 158 159 } -
trunk/includes/pages/nodes/nodes_search.php
r140 r154 105 105 $this->tpl['link_fullmap'] = makelink(array("page" => "gmap", "node" => get('node'))); 106 106 $this->tpl['link_gearth'] = makelink(array("page" => "gearth", "subpage" => "download", "node" => get('node'), "show_p2p" => "1", "show_aps" => "1", "show_clients" => "1", "show_unlinked" => "1", "show_links_p2p" => "1", "show_links_client" => "1")); 107 $this->tpl['gmap_key_ok'] = include_gmap("?page=gmap&subpage=js&node=".get('node')); 107 if(get('show_map') == "no") $this->tpl['gmap_key_ok'] = "nomap"; 108 else $this->tpl['gmap_key_ok'] = include_gmap("?page=gmap&subpage=js&node=".get('node')); 108 109 109 110 return template($this->tpl, __FILE__); -
trunk/includes/pages/nodes/nodes_view.php
r152 r154 316 316 $this->tpl['link_fullmap'] = makelink(array("page" => "gmap", "node" => get('node'))); 317 317 $this->tpl['link_gearth'] = makelink(array("page" => "gearth", "subpage" => "download", "node" => get('node'), "show_p2p" => "1", "show_aps" => "1", "show_clients" => "1", "show_unlinked" => "1", "show_links_p2p" => "1", "show_links_client" => "1")); 318 $this->tpl['gmap_key_ok'] = include_gmap("?page=gmap&subpage=js&node=".get('node')); 318 if(get('show_map') == "no") $this->tpl['gmap_key_ok'] = "nomap"; 319 else $this->tpl['gmap_key_ok'] = include_gmap("?page=gmap&subpage=js&node=".get('node')); 319 320 return template($this->tpl, __FILE__); 320 321 } -
trunk/includes/pages/ranges/ranges_search.php
r71 r154 42 42 $where = $form_search_ranges->db_data_where(array('ip' => 'exclude')); 43 43 $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 ":""); 47 51 if ($where!='') $where = substr($where, 0, -5); 48 52 $table_ip_ranges->db_data( … … 74 78 $this->tpl['link_ranges_allocation'] = makelink(array("page" => "ranges", "subpage" => "allocation")); 75 79 $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']); 77 81 $this->tpl['form_search_ranges'] = $construct->form($form_search_ranges, __FILE__); 78 82 $this->tpl['table_ranges'] = $construct->table($this->table_ip_ranges(), __FILE__); -
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 -
trunk/templates/basic/includes/main_menu.tpl
r152 r154 82 82 </tr> 83 83 <tr> 84 <td> 85 <input type="text" name="q" /> 84 <td> 85 <input type="text" id="q" name="q" autocomplete="off" onfocus="hover('',this.value);" onkeyup="hover(event.keyCode,this.value);" onblur="setTimeout('hideSearch()',500); hov=0;" /> 86 <div align="left" id="searchResult" name="searchResult" style="font-family:Arial; font-size:12px; width:140px; background-color: white; border:#000000 dashed 1px; padding:0px; display: none; position: absolute; "></div> 86 87 </td> 87 88 </tr> -
trunk/templates/basic/includes/pages/nodes/nodes_search.tpl
r140 r154 22 22 {include file=generic/page-title.tpl title="`$lang.all_nodes`" right="$help"} 23 23 <table width="100%" border="0" cellpadding="0" cellspacing="0" class="table-page"> 24 <tr> 25 <td class="table-page-split"> 26 <table align="center" bgcolor="#DBE0D7" cellpadding="0" cellspacing="2"> 27 <tr><td align="left">{include file=generic/link.tpl link=$link_gearth content="`$lang.google_earth`"}</td><td align="right">{include file=generic/link.tpl link=$link_fullmap content="`$lang.new_window`" target="_blank"}</td></tr> 28 <tr><td style="font-size:12px; text-align:center;" colspan="2">{if $gmap_key_ok} 29 <div id="map" style="width: 500px; height: 500px;"></div> 30 {else} 31 {$lang.message.error.gmap_key_failed.body|wordwrap:40|nl2br} 32 {/if} 33 </td></tr><tr><td style="font-size:12px;"> 34 <input type="checkbox" name="p2p" checked="checked" onclick="gmap_refresh();" />{html_image file="`$img_dir`/gmap/mm_20_orange.png" alt=$lang.backbone}{$lang.backbone} 35 <input type="checkbox" name="aps" checked="checked" onclick="gmap_refresh();" />{html_image file="`$img_dir`/gmap/mm_20_green.png" alt=$lang.aps}{$lang.aps} 36 <input type="checkbox" name="clients" onclick="gmap_refresh();" />{html_image file="`$img_dir`/gmap/mm_20_blue.png" alt=$lang.clients}{$lang.clients} 37 <input type="checkbox" name="unlinked" onclick="gmap_refresh();" />{html_image file="`$img_dir`/gmap/mm_20_red.png" alt=$lang.unlinked}{$lang.unlinked} 38 </td> 24 <tr> 25 <td class="table-page-split"> 26 {if $gmap_key_ok!=="nomap"} 27 <table align="center" bgcolor="#DBE0D7" cellpadding="0" cellspacing="2"> 28 <tr> 29 <td align="left">{include file=generic/link.tpl link=$link_gearth content="`$lang.google_earth`"}</td><td align="right">{include file=generic/link.tpl link=$link_fullmap content="`$lang.new_window`" target="_blank"}</td> 30 </tr> 31 <tr> 32 <td style="font-size:12px; text-align:center;" colspan="2"> 33 {if $gmap_key_ok} 34 <div id="map" style="width: 500px; height: 500px;"></div> 35 {else} 36 {$lang.message.error.gmap_key_failed.body|wordwrap:40|nl2br} 37 {/if} 38 </td> 39 </tr> 40 <tr> 41 <td style="font-size:12px;"> 42 <input type="checkbox" name="p2p" checked="checked" onclick="gmap_refresh();" />{html_image file="`$img_dir`/gmap/mm_20_orange.png" alt=$lang.backbone}{$lang.backbone} 43 <input type="checkbox" name="aps" checked="checked" onclick="gmap_refresh();" />{html_image file="`$img_dir`/gmap/mm_20_green.png" alt=$lang.aps}{$lang.aps} 44 <input type="checkbox" name="clients" onclick="gmap_refresh();" />{html_image file="`$img_dir`/gmap/mm_20_blue.png" alt=$lang.clients}{$lang.clients} 45 <input type="checkbox" name="unlinked" onclick="gmap_refresh();" />{html_image file="`$img_dir`/gmap/mm_20_red.png" alt=$lang.unlinked}{$lang.unlinked} 46 </td> 47 </tr> 48 </table> 49 {/if} 50 </td> 51 </tr> 52 <tr> 53 <td class="table-page-split"> 54 {include file=generic/title1.tpl title="`$lang.nodes_search`" content=$form_search_nodes} 55 </td> 56 </tr> 57 <tr> 58 <td class="table-page-pad"> 59 {include file=generic/title2.tpl title="`$lang.nodes_found`" content=$table_nodes} 60 </td> 61 </tr> 39 62 </table> 40 </td>41 </tr>42 <tr>43 <td class="table-page-split">44 {include file=generic/title1.tpl title="`$lang.nodes_search`" content=$form_search_nodes}45 </td>46 </tr>47 <tr>48 <td class="table-page-pad">49 {include file=generic/title2.tpl title="`$lang.nodes_found`" content=$table_nodes}50 </td>51 </tr>52 </table> -
trunk/templates/basic/includes/pages/nodes/nodes_view.tpl
r152 r154 34 34 </td> 35 35 <td class="table-page-split"> 36 {if $gmap_key_ok!=="nomap"} 36 37 <table bgcolor="#DBE0D7" cellpadding="0" cellspacing="2"> 37 38 <tr> … … 57 58 </tr> 58 59 </table> 60 {/if} 59 61 </td> 62 60 63 </tr> 61 64 <tr>
Note: See TracChangeset
for help on using the changeset viewer.
