Andreas1823 hat geschrieben:Wo genau muss ich das Snippet denn in der root/user_weather/functions_user_map.php einsetzen ???
// $obiger Original Code ist auskommentiert:
http://www.4seven.de/forum/6test/viewto ... rt=30#p781
Code: Alles auswählen
//$geo_map = file_get_contents('http://maps.google.com/maps/api/geocode/json?address=' . $profile_fields_town_map . '&sensor=false');
// file_get_content alternative (if bloqued by provider)
$get_url = 'http://maps.google.com/maps/api/geocode/json?address=' . $profile_fields_town_map . '&sensor=false';
$get_content = curl_init();
curl_setopt($get_content, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($get_content, CURLOPT_URL, $get_url);
$geo_map = curl_exec($get_content);
Also finde
Code: Alles auswählen
$geo_map = file_get_contents('http://maps.google.com/maps/api/geocode/json?address=' . $profile_fields_town_map . '&sensor=false');
Ersetze mit
Code: Alles auswählen
// $geo_map = file_get_contents('http://maps.google.com/maps/api/geocode/json?address=' . $profile_fields_town_map . '&sensor=false');
// file_get_content alternative (if bloqued by provider)
$get_url = 'http://maps.google.com/maps/api/geocode/json?address=' . $profile_fields_town_map . '&sensor=false';
$get_content = curl_init();
curl_setopt($get_content, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($get_content, CURLOPT_URL, $get_url);
$geo_map = curl_exec($get_content);
Andreas1823 hat geschrieben:Ich habe schon mal versucht eine andere Mod zu installieren, welche ebenfalls auf JQ lief, die Funktion funktioniert ebenfalls nicht...
Hat warscheinlich
nichts mit jQuery zu tun, sondern mit php Funktionen, die durch jQ aufgerufen werden.
Wie gesagt, die Providereinstellungen findest Du in der includes/functions_user_map.php
Code: Alles auswählen
// GOOGLE API
// Google Basic Api
$google_api = true;
// OPEN API
// Mapquestapi Nominatim Api
$nomina_api = false;
// OPEN API
// Mapquestapi Geocoding Api
$geocod_api = false;
Achte auch mal auf die Kommentare in der Datei > Suche >
Result Example:
- Sollte ein paar mal vorkommen.
Falls tatsächlich auf Deinem Account
file_get_contents()
und Konsorten gesperrt sind, nimmst Du
CURL
(siehe Code oben).
Dieser Code (siehe oben) muss dann auch bei den anderen zwei Providern geändert werden.
Die erste zeile haben wir ja schon, fängt so an:
$geo_map = file_get_contents(.......
Die anderen beiden Zeilen fangen so an:
$geo_map2 = file_get_contents(.......
$geo_map3 = file_get_contents(.......
Den Code für den ersten weiteren Provider (
$geo_map2
) dann so:
Code: Alles auswählen
// file_get_content alternative (if bloqued by provider)
$get_url2 = 'http://maps.google.com/maps/api/geocode/json?address=' . $profile_fields_town_map . '&sensor=false';
$get_content2 = curl_init();
curl_setopt($get_content2, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($get_content2, CURLOPT_URL, $get_url2);
$geo_map2 = curl_exec($get_content2);
Man achte auf die angehängte '2' nach den $variablen. Mit dem
$geo_map3
dann dementsprechend.
Alle weiteren Einstellungen in der
user_weather/user_map_config.php
Gruß..