]*?)href=["\'](https?:\/\/maps\.google\.[a-z\.]*\/maps\/ms[a-zA-Z0-9\/:\-\.,_?&=;~]*?)["\']([^\>]*?)\>(.*?)\<\/a\>#i', $content, $found);
for ($i=0; $i< count($found[0]);$i++) {
$file = $found[2][$i];
$file = str_replace("&","&",$file);
if (stripos(strtolower($file),"msid=") !== false) {
if (stripos(strtolower($file),"output=") === false) {
$file .= "&output=nl";
}
$displayurl = $found[0][$i];
$urlstring = $found[4][$i];
$iurlstring = stripos($urlstring,"[");
if ($iurlstring !== false) {
$jurlstring = stripos($urlstring,"]",$iurlstring);
$iurlstring += 1;
$varstring = substr($urlstring, $iurlstring, $jurlstring-$iurlstring);
} else {
$varstring = "";
}
$params = new xmlgooglemaps_params();
$params->setParams($varstring);
$displayurl = getDisplayURL($params->urlDisplayMode, $displayurl, $varstring);
if (strtolower($params->urlDisplayMode) == "nomap") {
$content = str_replace($found[0][$i],$displayurl,$content);
} else {
$mygooglemapid = xmlgooglemaps_dbfunctions::xmlGetId($file, $varstring);
$content = str_replace($found[0][$i],'getStyleMapDiv().' class="xmlgmdiv" id="xmlgmdiv_'.$mygooglemapid.'">
'.$displayurl,$content);
}
} else {
$content = str_replace($found[0][$i],'Error in displaying map:
I think your link to the My Google Maps is not correct. Please have a look at the following image:
.'/wp-content/plugins/xml-google-maps/images/help01.jpg)
You have to save your Google Map first!
'.$displayurl,$content);
}
}
return $content;
}
function xmlgooglemaps_converter_kmx($content) {
preg_match_all('#\