Show
Ignore:
Timestamp:
02/26/12 10:28:14 (15 months ago)
Author:
Torben Brodt
Message:

no api key needed any longer

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • g-map/files/lib/data/gmap/GmapApi.class.php

    r1494 r1513  
    88 */ 
    99class GmapApi extends DatabaseObject { 
    10         protected $apikey = null; 
    1110        protected $cache_search = array(); 
    1211 
    1312        /** 
    14          * creates new instance 
    15          */ 
    16         public function __construct() { 
    17                 $apikey = GMAP_API_KEY; 
    18                 $apikey = explode("\n", StringUtil::unifyNewlines($apikey)); 
    19                 $apikey = $apikey[0]; 
    20                 $apikey = explode(":", $apikey); 
    21                  
    22                 // this is the way, woltlab wants the users to enter their api key 
    23                 if(count($apikey) == 2) { 
    24                         $this->apikey = $apikey[1]; 
    25                 } 
    26  
    27                 // this is the way, almost all of the woltlab users really enter their api key 
    28                 else if(!empty($apikey)) { 
    29                         $this->apikey = $apikey[0]; 
    30                 } 
    31         } 
    32  
    33         /** 
    3413         * is active? api key existent? 
    35          * 
     14         * @deprecated no api key needed any longer 
    3615         * @return      boolean 
    3716         */ 
    3817        public function isActive() { 
    39                 return !empty($this->apikey); 
     18                return true; 
    4019        } 
    4120         
     
    8463         */ 
    8564        public function search($location) { 
    86                 if(!$this->isActive()) { 
    87                         return; 
    88                 } 
    89  
    9065                if (CHARSET != 'UTF-8') { 
    9166                        $location = StringUtil::convertEncoding(CHARSET, 'UTF-8', $location); 
     
    9772                } 
    9873                 
    99                 $url = "http://maps.google.com/maps/geo?q=".$lookupstring."&key=".$this->apikey."&output=csv"; 
     74                $url = "http://maps.google.com/maps/geo?q=".$lookupstring."&output=csv"; 
    10075                 
    10176                require_once(WCF_DIR.'lib/util/FileUtil.class.php');