- Timestamp:
- 06/24/2011 09:45:59 AM (11 months ago)
- Location:
- trunk
- Files:
-
- 5 edited
-
config-sample/config.php (modified) (1 diff)
-
globals/functions.php (modified) (2 diffs)
-
includes/pages/gmap/gmap_fullmap.php (modified) (2 diffs)
-
includes/pages/gmap/gmap_js.php (modified) (2 diffs)
-
includes/pages/gmap/gmap_pickup_js.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/config-sample/config.php
r236 r246 92 92 'default' => 'hybrid' 93 93 ), 94 'api' => ' 2.128e',94 'api' => '3.5', 95 95 'keys' => array( // Domains must be as in $_SERVER['SERVER_NAME'] variable 96 96 // 'server.example.org/path' => 'example_key' -
trunk/globals/functions.php
r245 r246 5 5 * Copyright (C) 2005 Nikolaos Nikalexis <winner@cube.gr> 6 6 * Copyright (C) 2009-2010 Vasilis Tsiligiannis <b_tsiligiannis@silverton.gr> 7 * Copyright (C) 2011 K. Paliouras <squarious@gmail.com> 7 8 * 8 9 * This program is free software; you can redistribute it and/or modify … … 324 325 function include_gmap($javascript) { 325 326 global $main, $vars, $lang; 326 $dirname = dirname($_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF']); 327 $gmap_key = '' ; 328 if (isset($vars['gmap']['keys'][$dirname])) { 329 $gmap_key = $vars['gmap']['keys'][$dirname]; 330 } 331 if (isset($vars['gmap']['keys'][$dirname."/"]) && $gmap_key == '') { 332 $gmap_key = $vars['gmap']['keys'][$dirname."/"]; 333 } 334 if (isset($vars['gmap']['keys']["http://".$dirname]) && $gmap_key == '') { 335 $gmap_key = $vars['gmap']['keys']["http://".$dirname]; 336 } 337 if (isset($vars['gmap']['keys']["http://".$dirname."/"]) && $gmap_key == '') { 338 $gmap_key = $vars['gmap']['keys']["http://".$dirname."/"]; 339 } 340 if ($gmap_key == '') return FALSE; 341 342 $main->html->head->add_script("text/javascript", htmlspecialchars("http://".$vars['gmap']['server']."/maps?file=api&v=".$vars['gmap']['api']."&key=".$gmap_key."&hl=".$lang["iso639"])); 327 328 329 $serve_host = strtolower($_SERVER['SERVER_NAME']); 330 $serve_path = $serve_host.$_SERVER['PHP_SELF']; 331 $gmap_key = false; 332 333 // Loop around all keys to find the most appropriate 334 foreach($vars['gmap']['keys'] as $key_path => $key) { 335 $key_path = strtolower($key_path); 336 337 // remove prefixed http:// 338 if (substr($key_path, 0, 7) == 'http://') { 339 $path = substr($key_path, 7); 340 } else if (substr($key_path, 0, 8) == 'https://') { 341 $path = substr($key_path, 8); 342 } 343 344 345 // If host name is not the same then false 346 if (substr($key_path, 0, strlen($serve_host)) != $serve_host) 347 continue; 348 349 // Compare if server_path includes $key_path 350 if (substr($serve_path, 0, strlen($key_path)) != $key_path) 351 continue; 352 353 $gmap_key = $key; 354 } 355 $main->html->head->add_script("text/javascript", 356 htmlspecialchars("http://{$vars['gmap']['server']}/maps?" . 357 http_build_query(array( 358 'file' => 'api', 359 'v' => $vars['gmap']['api'], 360 'key' => $gmap_key, 361 'hl=' => $lang["iso639"]) 362 ) 363 ) 364 ); 343 365 $main->html->head->add_script("text/javascript", $javascript); 344 366 $main->html->head->add_extra( -
trunk/includes/pages/gmap/gmap_fullmap.php
r245 r246 25 25 var $tpl; 26 26 27 function gmap() {28 29 }30 31 27 function output() { 32 28 global $main, $vars; … … 37 33 38 34 } 39 40 ?> -
trunk/includes/pages/gmap/gmap_js.php
r169 r246 24 24 var $tpl; 25 25 26 function gmap_js() {27 28 }29 30 26 function output() { 31 27 global $db, $lang, $vars; … … 80 76 } 81 77 82 ?> -
trunk/includes/pages/gmap/gmap_pickup_js.php
r169 r246 57 57 } 58 58 59 ?>
Note: See TracChangeset
for help on using the changeset viewer.
