Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Header configuration & styling (http://forum.bytesforall.com/forumdisplay.php?f=15)
-   -   [SOLVED] Google Maps still loading even if disabled through CSS and PHP code... (http://forum.bytesforall.com/showthread.php?t=7020)

Kirpega May 7, 2010 06:10 PM

[SOLVED] Google Maps still loading even if disabled through CSS and PHP code...
 
Hi!

With XMLGoogleMaps plugin I wanted to show different KML maps depending of the loaded page.
I then created some Divs (containings IFrames to GMaps) which are switched on and off via the CSS (CSS Inserts section), as shown here below.

Code:

body div#intestazione_mappa_siti {display:none;}
body.page-id-352 div#imagecontainer {display:none;}
body.page-id-352 div#intestazione_mappa_siti {display:inline;}

body div#intestazione_mappa_musei {display:none;}
body.page-id-353 div#imagecontainer {display:none;}
body.page-id-353 div#intestazione_mappa_musei {display:inline;}

I noticed, though, that this procedure was functioning, but the Iframe was still being "processed" and loaded, even if not visualized, so slowing the loading of the page.

I then add some PHP code (below) in the "Style and Edit Header Area" thinking that this would have completely hided the unwanted code, but it didn't happen.
When loading the page, it still makes some kind of reference to Google Maps, as I see in the status bar.

Code:

%logo %image

<?php
$url = sprintf(“%s%s%s”,”http://”,$HTTP_HOST,$REQUEST_URI );
if $url == "http://www.archeoveneto.lettere.unipd.it/portale/?page_id=352"
{
?>
<div id="intestazione_mappa_siti">
<iframe id="xmlgm_6" src="http://www.archeoveneto.lettere.unipd.it/portale/wp-content/plugins/xml-google-maps/xmlgooglemaps_show.php?kmlid=6" style="border: 0px; width: 960px; height: 430px;" name="Google_KML_Maps" frameborder="0"></iframe> </div>
<?php
elseif $url == "http://www.archeoveneto.lettere.unipd.it/portale/?page_id=353"
{
?>
<div id="intestazione_mappa_musei">
<iframe id="xmlgm_7" src="http://www.archeoveneto.lettere.unipd.it/portale/wp-content/plugins/xml-google-maps/xmlgooglemaps_show.php?kmlid=7" style="border: 0px; width: 960px; height: 430px;" name="Google_KML_Maps" frameborder="0"></iframe>
</div>
<?php
}
else {
?>
<div id="intestazione_mappa_siti">&nbsp</div>
<div id="intestazione_mappa_musei">&nbsp</div>
<?php
}
?>

%pages %bar1

The loading time now is, actually, very faster and acceptable, but I'd like to understand the reason of this behaviour and how to avoid it.

Thank you in advance for any hints!

PHK

Kirpega May 7, 2010 11:12 PM

SOLVED!

IFrame "in" the Header: this is it... :)

CSS Insert
Code:

body.page-id-352 div#imagecontainer {display:none;}
body.page-id-353 div#imagecontainer {display:none;}

HEADER Area
Code:

<?php $url = get_permalink(); ?>

<?php
$paginasiti = 'http://www.archeoveneto.lettere.unipd.it/portale/?page_id=352';
$paginamusei = 'http://www.archeoveneto.lettere.unipd.it/portale/?page_id=353';

if ($paginasiti == $url) {
$mappa = '<iframe id="xmlgm_6" src="http://www.archeoveneto.lettere.unipd.it/portale/wp-content/plugins/xml-google-maps/xmlgooglemaps_show.php?kmlid=6" style="border: 0px; width: 960px; height: 430px;" name="Google_KML_Maps" frameborder="0"></iframe>';

} elseif ($paginamusei == $url) {
$mappa = '<iframe id="xmlgm_7" src="http://www.archeoveneto.lettere.unipd.it/portale/wp-content/plugins/xml-google-maps/xmlgooglemaps_show.php?kmlid=7" style="border: 0px; width: 960px; height: 430px;" name="Google_KML_Maps" frameborder="0"></iframe>';

}  else {
$mappa = ' ' ;
}

echo $mappa;

?>



All times are GMT -6. The time now is 09:27 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.