hello,
my name is erich berger and i am new to this group. i was over the
last year in contact with guillermo alvaro rey when i was doing a
sketch of the climatescope meipi.
after installing a meipi successfully on my localhost i am now
starting to develop a meipi hosted on our server and encountered a
problem with meipiConfig.php but i have no idea whats wrong.
on
http://climatescope.net/meipi/meipi.php i get a "This web site
needs a different Google Maps API key. A new key can be generated at
http://code.google.com/apis/maps/."
but when i use the same key with a test script it works fine.
here the regarding lines of meipiConfig.php:
<?
// DB
require_once("dbConfig.php");
// Main Url: The address where this meipi is hosted
$mainUrl = "
http://climatescope.net/";
// Links
$meipiUrl = "
http://www.meipi.org/";
$blogUrl = "
http://blog.meipi.org/";
$aboutUrl = "
http://www.meipi.org/about.php";
$licenseUrl = "
http://creativecommons.org/licenses/by-sa/2.5/
es/";
$faqUrl = "
http://www.meipi.org/faq.php";
$legalUrl = "
http://www.meipi.org/legal.php";
// Base Folder: The local path to the code
$baseFolder = "/home/climatescope/public_html/meipi/"; // TODO
// Configuration for Google Maps // TODO
$google_maps_keys = array(
"
climatescope.net/meipi" => "GOOGLE_MAPS_API_KEY_1",
// Default
"ABQIAAAAWRdQzpvkvJrYx4EEFP3oQBTJrCsORgTJcqsJCbvcXuXfl1egMxRjdzEYtkcRoqF02pST6TrF9jeSIQ"
=> "GOOGLE_MAPS_API_KEY_1"
);
function getGoogleMapsKey()
{
global $google_maps_keys;
foreach($google_maps_keys as $address =>
$googleMapsKey)
{
if($address==="" ||
strpos($_SERVER["HTTP_HOST"].$_SERVER["SCRIPT_NAME"], $address)!
==FALSE)
{
return $googleMapsKey;
}
}
}
$google_maps_key = getGoogleMapsKey();
.
.
.
.
and here the test script where the same key works fine:
http://climatescope.net/meipi/google_test.html
i would appreciate your help very much.
best
erich