function CityMenu($data) { global $hgconf; $menulist = '<ul id="menu">' . "\n"; $db =& JFactory::getDBO(); $query = 'SELECT s.id AS value, s.name AS text, s.image, cc.continent AS continent, cc.name AS countryname,' . ' CASE WHEN CHAR_LENGTH( s.alias ) THEN CONCAT_WS( \':\', s.id, s.alias ) ELSE s.id END AS slug' . ' FROM #__hg_states AS s' . ' LEFT JOIN #__hg_countries AS cc ON cc.id = s.country' . ' WHERE s.published = 1' . ' AND s.country = ' . $data->country; $db->setQuery($query); $states = $db->loadObjectList(); $where = ' WHERE c.published = 1'; if ($data->parent_id <= 0) { $where .= ' AND c.id = ' . $data->id; } else { $where .= ' AND c.id = ' . $data->parent_id; } $where .= ' AND c.states = ' . $data->states; $query = 'SELECT c.id, c.name, s.name AS statesname,' . ' CASE WHEN CHAR_LENGTH( c.alias ) THEN CONCAT_WS( \':\', c.id, c.alias ) ELSE c.id END AS cityslug,' . ' CASE WHEN CHAR_LENGTH( s.alias ) THEN CONCAT_WS( \':\', s.id, s.alias ) ELSE s.id END AS statesslug' . ' FROM #__hg_cities AS c' . ' LEFT JOIN #__hg_states AS s ON s.id = c.states' . $where; $db->setQuery($query); $maincity = $db->loadObject(); if (count($states) > 0) { $query = 'SELECT c.id AS value, c.name AS text, c.image, s.name AS statesname,' . ' CASE WHEN CHAR_LENGTH( c.alias ) THEN CONCAT_WS( \':\', c.id, c.alias ) ELSE c.id END AS slug' . ' FROM #__hg_cities AS c' . ' LEFT JOIN #__hg_states AS s ON s.id = c.states' . ' WHERE c.published = 1' . ' AND c.states = ' . $data->states . ' AND c.parent_id = 0'; $db->setQuery($query); $statecities = $db->loadObjectList(); } else { /* $where = ' WHERE c.published = 1'; if ($data->parent_id <= 0) $where .= ' AND c.id = '.$data->id; else $where .= ' AND c.id = '.$data->parent_id; $query = 'SELECT c.id, c.name,' . ' CASE WHEN CHAR_LENGTH( c.alias ) THEN CONCAT_WS( \':\', c.id, c.alias ) ELSE c.id END AS cityslug' . ' FROM #__hg_cities AS c' . $where ; $db->setQuery( $query ); $maincity = $db->loadObject(); */ } $where = ' WHERE c.published = 1'; if ($data->parent_id <= 0) { $where .= ' AND c.parent_id = ' . $data->id; } else { $where .= ' AND c.parent_id = ' . $data->parent_id; } $query = 'SELECT c.id AS value, c.name AS text, c.image,' . ' CASE WHEN CHAR_LENGTH( c.alias ) THEN CONCAT_WS( \':\', c.id, c.alias ) ELSE c.id END AS slug' . ' FROM #__hg_cities AS c' . $where . ' ORDER BY c.name ASC'; $db->setQuery($query); $locals = $db->loadObjectList(); $query = 'SELECT c.id AS value, c.name AS text, c.image, cc.continent AS continent, cc.name AS countryname,' . ' CASE WHEN CHAR_LENGTH( c.alias ) THEN CONCAT_WS( \':\', c.id, c.alias ) ELSE c.id END AS slug,' . ' CASE WHEN CHAR_LENGTH( cc.alias ) THEN CONCAT_WS( \':\', cc.id, cc.alias ) ELSE cc.id END AS countryslug' . ' FROM #__hg_cities AS c' . ' LEFT JOIN #__hg_countries AS cc ON cc.id = c.country' . ' WHERE c.published = 1' . ' AND c.country = ' . $data->country . ' AND c.parent_id = 0' . ' ORDER BY c.name ASC'; $db->setQuery($query); $cities = $db->loadObjectList(); if ($hgconf->city_front != 1) { $query = 'SELECT c.id AS value, c.name AS text, c.code_1, cc.name AS continentname,' . ' CASE WHEN CHAR_LENGTH( c.alias ) THEN CONCAT_WS( \':\', c.id, c.alias ) ELSE c.id END AS slug,' . ' CASE WHEN CHAR_LENGTH( cc.alias ) THEN CONCAT_WS( \':\', cc.id, cc.alias ) ELSE cc.id END AS continentslug' . ' FROM #__hg_countries AS c' . ' LEFT JOIN #__hg_continents AS cc ON cc.id = c.continent' . ' WHERE c.published = 1' . ' AND c.continent = ' . $cities[0]->continent . ' ORDER BY c.name ASC'; $db->setQuery($query); $countries = $db->loadObjectList(); if ($hgconf->frontpage == 2) { $query = 'SELECT id AS value, name AS text, image,' . ' CASE WHEN CHAR_LENGTH( alias ) THEN CONCAT_WS( \':\', id, alias ) ELSE id END AS slug' . ' FROM #__hg_continents' . ' WHERE published = 1'; $db->setQuery($query); $continents = $db->loadObjectList(); $nocontinent = count($continents); } if (isset($continents) && $hgconf->frontpage == 2) { $clink = JRoute::_('index.php?option=com_hotelguide&view=hotelguide'); $menulist .= '<li><a href="' . $clink . '">' . JText::_('HG_CONTINENTS') . '</a>' . "\n"; $menulist .= '<div class="dropdown_4columns">' . "\n"; $i = 0; foreach ($continents as $continent) { $continentlink = JRoute::_(hotelguideHelperRoute::getContinentRoute($continent->slug)); if ($continent->image) { $imagelink = JURI::base() . 'images/hotelguide/country/scrop/' . $continent->image; } else { $imagelink = JURI::base() . '/components/com_hotelguide/assets/images/no_list.gif'; } $menulist .= '<div class="col_1">'; if (strlen(strip_tags($continent->text)) > 20) { $continent->text = substr($continent->text, 0, 30); $continent->text = trim($continent->text) . "...\n\n"; $menulist .= '<p style="line-height:16px"><a href="' . $continentlink . '"><img src="' . $imagelink . '" width="20px" class="img_left imgshadow" align="left" alt="' . $continent->text . '" />'; } else { $menulist .= '<p style="line-height:32px"><a href="' . $continentlink . '"><img src="' . $imagelink . '" width="20px" class="img_left imgshadow" align="left" alt="' . $continent->text . '" />'; } $menulist .= $continent->text . '</a></p></div>'; $i++; if ($i == 4) { $menulist .= '<div style="clear:both;"></div>' . "\n"; $i = 0; } } $menulist .= '</div></li>' . "\n"; } if ($hgconf->frontpage == 2 || $hgconf->frontpage == 3) { $wlink = JRoute::_(hotelguideHelperRoute::getContinentRoute($countries[0]->continentslug)); $menulist .= '<li><a href="' . $wlink . '">' . $countries[0]->continentname . '</a>' . "\n"; $menulist .= '<div class="dropdown_4columns">' . "\n"; $i = 0; foreach ($countries as $country) { $countrylink = JRoute::_(hotelguideHelperRoute::getCountryRoute($country->slug)); $imagelink = JURI::base() . 'images/hotelguide/country/flags/' . $country->code_1 . '.png'; $menulist .= '<div class="col_1">'; if (strlen(strip_tags($country->text)) > 20) { $country->text = substr($country->text, 0, 30); $country->text = trim($country->text) . "...\n\n"; $menulist .= '<p style="line-height:14px"><a href="' . $countrylink . '"><img src="' . $imagelink . '" width="22px" class="img_left imgshadow" align="left" alt="' . $country->text . '" />'; } else { $menulist .= '<p style="line-height:28px"><a href="' . $countrylink . '"><img src="' . $imagelink . '" width="22px" class="img_left imgshadow" align="left" alt="' . $country->text . '" />'; } $menulist .= $country->text . '</a></p></div>'; $i++; if ($i == 4) { $menulist .= '<div style="clear:both;"></div>' . "\n"; $i = 0; } } $menulist .= '</div></li>' . "\n"; } if (count($states) > 0 && ($hgconf->frontpage == 2 || $hgconf->frontpage == 3 || $hgconf->frontpage == 4)) { $tlink = JRoute::_(hotelguideHelperRoute::getCountryRoute($cities[0]->countryslug)); $menulist .= '<li><a href="' . $tlink . '">' . $states[0]->countryname . '</a>' . "\n"; $menulist .= '<div class="dropdown_4columns">' . "\n"; $i = 0; foreach ($states as $state) { $stateslink = JRoute::_(hotelguideHelperRoute::getStatesRoute($state->slug)); if ($state->image) { $imagelink = JURI::base() . 'images/hotelguide/states/crop/' . $state->image; } else { $imagelink = JURI::base() . '/components/com_hotelguide/assets/images/no_list.gif'; } $menulist .= '<div class="col_1">'; if (strlen(strip_tags($state->text)) > 20) { $state->text = substr($state->text, 0, 30); $state->text = trim($state->text) . "...\n\n"; $menulist .= '<p style="line-height:16px"><a href="' . $stateslink . '"><img src="' . $imagelink . '" width="20px" class="img_left imgshadow" align="left" alt="' . $state->text . '" />'; } else { $menulist .= '<p style="line-height:32px"><a href="' . $stateslink . '"><img src="' . $imagelink . '" width="20px" class="img_left imgshadow" align="left" alt="' . $state->text . '" />'; } $menulist .= $state->text . '</a></p></div>'; $i++; if ($i == 4) { $menulist .= '<div style="clear:both;"></div>' . "\n"; $i = 0; } } $menulist .= '</div></li>' . "\n"; } if (isset($statecities) && ($hgconf->frontpage == 2 || $hgconf->frontpage == 3 || $hgconf->frontpage == 4 || $hgconf->frontpage == 5)) { $slink = JRoute::_(hotelguideHelperRoute::getStatesRoute($maincity->statesslug)); $menulist .= '<li><a href="' . $slink . '">' . $maincity->statesname . '</a>' . "\n"; $menulist .= '<div class="dropdown_4columns">' . "\n"; $i = 0; foreach ($statecities as $city) { $citylink = JRoute::_(hotelguideHelperRoute::getCityRoute($city->slug)); if ($city->image) { $imagelink = JURI::base() . 'images/hotelguide/city/scrop/' . $city->image; } else { $imagelink = JURI::base() . '/components/com_hotelguide/assets/images/no_list.gif'; } $menulist .= '<div class="col_1">'; if (strlen(strip_tags($city->text)) > 20) { $city->text = substr($city->text, 0, 35); $city->text = trim($city->text) . "...\n\n"; $menulist .= '<p style="line-height:16px"><a href="' . $citylink . '"><img src="' . $imagelink . '" width="20px" class="img_left imgshadow" align="left" alt="' . $city->text . '" />'; } else { $menulist .= '<p style="line-height:32px"><a href="' . $citylink . '"><img src="' . $imagelink . '" width="20px" class="img_left imgshadow" align="left" alt="' . $city->text . '" />'; } $menulist .= $city->text . '</a></p></div>'; $i++; if ($i == 4) { $menulist .= '<div style="clear:both;"></div>' . "\n"; $i = 0; } } $menulist .= '</div></li>' . "\n"; } if (count($states) == 0 && ($hgconf->frontpage == 2 || $hgconf->frontpage == 3 || $hgconf->frontpage == 4)) { $tlink = JRoute::_(hotelguideHelperRoute::getCountryRoute($cities[0]->countryslug)); $menulist .= '<li><a href="' . $tlink . '">' . $cities[0]->countryname . '</a>' . "\n"; $menulist .= '<div class="dropdown_4columns">' . "\n"; $i = 0; foreach ($cities as $citylist) { $citylink = JRoute::_(hotelguideHelperRoute::getCityRoute($citylist->slug)); if ($citylist->image) { $imagelink = JURI::base() . 'images/hotelguide/city/scrop/' . $citylist->image; } else { $imagelink = JURI::base() . '/components/com_hotelguide/assets/images/no_list.gif'; } $menulist .= '<div class="col_1">'; if (strlen(strip_tags($citylist->text)) > 20) { $citylist->text = substr($citylist->text, 0, 35); $citylist->text = trim($citylist->text) . "...\n\n"; $menulist .= '<p style="line-height:16px"><a href="' . $citylink . '"><img src="' . $imagelink . '" width="20px" class="img_left imgshadow" align="left" alt="' . $citylist->text . '" />'; } else { $menulist .= '<p style="line-height:32px"><a href="' . $citylink . '"><img src="' . $imagelink . '" width="20px" class="img_left imgshadow" align="left" alt="' . $citylist->text . '" />'; } $menulist .= $citylist->text . '</a></p></div>'; $i++; if ($i == 4) { $menulist .= '<div style="clear:both;"></div>' . "\n"; $i = 0; } } $menulist .= '</div></li>' . "\n"; } } if (count($locals) > 0) { $maincitylink = JRoute::_(hotelguideHelperRoute::getCityRoute($maincity->cityslug)); $menulist .= '<li><a href="' . $maincitylink . '">' . $maincity->name . '</a>' . "\n"; $menulist .= '<div class="dropdown_4columns">' . "\n"; $i = 0; foreach ($locals as $local) { $citylink = JRoute::_(hotelguideHelperRoute::getCityRoute($local->slug)); if ($local->image) { $imagelink = JURI::base() . 'images/hotelguide/city/scrop/' . $local->image; } else { $imagelink = JURI::base() . '/components/com_hotelguide/assets/images/no_list.gif'; } $menulist .= '<div class="col_1">'; if (strlen(strip_tags($local->text)) > 25) { $local->text = substr($local->text, 0, 36); $local->text = trim($local->text) . "...\n\n"; $menulist .= '<p style="line-height:16px"><a href="' . $citylink . '"><img src="' . $imagelink . '" width="20px" class="img_left imgshadow" align="left" alt="' . $local->text . '" />'; } else { $menulist .= '<p style="line-height:32px"><a href="' . $citylink . '"><img src="' . $imagelink . '" width="20px" class="img_left imgshadow" align="left" alt="' . $local->text . '" />'; } $menulist .= $local->text . '</a></p></div>'; $i++; if ($i == 4) { $menulist .= '<div style="clear:both;"></div>' . "\n"; $i = 0; } } $menulist .= '</div></li>' . "\n"; } $menulist .= '</ul>' . "\n"; return $menulist; }
function showmap($config, $base, $mapdatas, $regione, $cattitle, $child, $ajaxmap, $googlead, $adid, $slot) { $lat = $base['lat']; $lon = $base['lon']; $zoom = $base['zoom']; $maptype = $base['maptype']; if (!$maptype) { $maptype = 'Map'; } switch ($maptype) { case 'Map': case 'roadmap': $maptype = 'G_NORMAL_MAP'; break; case 'Satellite': $maptype = 'G_SATELLITE_MAP'; break; case 'Hybrid': case 'hybrid': $maptype = 'G_HYBRID_MAP'; break; case 'Terrain': case 'terrain': $maptype = 'G_PHYSICAL_MAP'; break; } ?> <script language="javascript" type="text/javascript"> var map; var container; var lat; var lon; var maptype; var title; var thumbLink; var point; var toggle = 0; function loadMap() { container = document.getElementById("map_canvas"); lat = <?php echo $lat; ?> ; lon = <?php echo $lon; ?> ; zoom = <?php echo $zoom; ?> ; maptype = <?php echo $maptype; ?> ; point = new GLatLng (lat, lon); map = new google.maps.Map2(container); map.addControl(new GLargeMapControl3D(), new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(0,5))); map.addControl(new GMenuMapTypeControl(), new GControlPosition(G_ANCHOR_TOP_RIGHT, new GSize(7,7))); map.addMapType(G_PHYSICAL_MAP); map.addControl(new GScaleControl()); map.setCenter(new google.maps.LatLng(lat, lon), zoom, maptype); //var clusterer = new Clusterer(map); //var sidebar = new SideBar(document.getElementById("sidebar")); GEvent.addListener(map, "mouseover", function(){ map.showControls(); }); GEvent.addListener(map, "mouseout", function(){ map.hideControls(); }); // ================= infoOpened LISTENER =========== GEvent.addListener(map, "infowindowopen", function() { infoOpened = true; // set infoOpened to true to change the history text Slimbox.scanPage(); }); // ================= infoClosed LISTENER =========== GEvent.addListener(map, "infowindowclose", function() { infoOpened = false; // set infoOpened to false }); var autoCenterBounds = new GLatLngBounds(); var maxZoom = 0; var marker; var width; var height; var ratio; var imagelink; var itemlink; var slimboxlink; var logopath; var logowidth = <?php echo $config->logowidth; ?> ; var logoheight = <?php echo $config->logoheight; ?> ; toggle = 1; <?php if ($config->logoimage) { ?> logopath = "<?php echo JURI::base(); ?> administrator/components/com_hotelguide/assets/images/<?php echo $config->logoimage; ?> "; <?php } else { ?> logopath = "<?php echo JURI::base(); ?> administrator/components/com_hotelguide/assets/images/yourlogo.gif"; logowidth = 160; logoheight = 25; <?php } ?> <?php if ($child) { foreach ($mapdatas as $mapdata) { $text = substr($mapdata[0]->hoteltype, 0, 18) . "...."; ?> CreateMarker(clusterer, sidebar, "", "", "", "", "", "", "","", "", "", "", "", "", "<?php echo $text; ?> "); <?php foreach ($mapdata as $item) { if ($item->lon == 0) { continue; } ?> point = new GLatLng(<?php echo $item->lat; ?> , <?php echo $item->lon; ?> ); <?php if ($item->zoom < 1 || !$item->zoom) { $item->zoom = 3; } ?> maxZoom = Math.max(maxZoom, <?php echo $item->zoom; ?> ); autoCenterBounds.extend(point); <?php if ($regione == 'hotel' && $item->mainimage) { ?> itemlink = "<?php echo JRoute::_(hotelguideHelperRoute::getItemRoute($item->slug)); ?> "; thumblink = "<?php echo JURI::base(); ?> images/hotelguide/gallery/hotel_<?php echo $item->id; ?> /smallcrop/<?php echo $item->mainimage; ?> "; imagelink = "<?php echo JURI::base(); ?> images/hotelguide/gallery/hotel_<?php echo $item->id; ?> /resize/<?php echo $item->mainimage; ?> "; slimboxlink = "<?php echo JURI::base(); ?> images/hotelguide/gallery/hotel_<?php echo $item->id; ?> /album/<?php echo $item->mainimage; ?> "; <?php } else { ?> thumblink = "<?php echo JURI::base(); ?> components/com_hotelguide/assets/images/no_list.gif"; imagelink = "<?php echo JURI::base(); ?> components/com_hotelguide/assets/images/no_image.gif"; slimboxlink = "<?php echo JURI::base(); ?> components/com_hotelguide/assets/images/no_thumb.jpg"; <?php $item->imagewidth = 160; $item->imageheight = 120; } $desc = $item->title; ?> //CreateMarker(clusterer, sidebar, <?php //echo $item->lat; ?> , <?php //echo $item->lon; ?> , "<?php //echo $desc; ?> ", thumblink, imagelink, itemlink, slimboxlink, <?php //echo $item->zoom; ?> , <?php //echo $item->imagewidth; ?> , <?php //echo $item->imageheight; ?> , logopath, logowidth, logoheight, ""); <?php } } } else { if ($regione == 'city') { $cattitle = JText::sprintf('HG_ACCOMMODATIONS_IN', $cattitle); } else { if ($regione == 'country' || $regione == 'states') { $cattitle = JText::sprintf('HG_CITIES_IN', $cattitle); } else { if ($regione == 'continent') { $cattitle = JText::sprintf('HG_COUNTRIES_IN', $cattitle); } } } ?> //CreateMarker(clusterer, sidebar, "", "", "", "", "", "", "","", "", "", "", "", "", "<?php //echo $cattitle; ?> "); <?php foreach ($mapdatas as $item) { if ($item->lon == 0) { continue; } ?> point = new GLatLng(<?php echo $item->lat; ?> , <?php echo $item->lon; ?> ); <?php if ($item->zoom < 1 || !$item->zoom) { $item->zoom = 3; } ?> maxZoom = Math.max(maxZoom, <?php echo $item->zoom; ?> ); autoCenterBounds.extend(point); <?php if (($regione == 'city' || $regione == 'states') && $item->image) { ?> itemlink = "<?php echo JRoute::_(hotelguideHelperRoute::getCityRoute($item->cityslug)); ?> "; thumblink = "<?php echo JURI::base(); ?> images/hotelguide/city/scrop/<?php echo $item->image; ?> "; imagelink = "<?php echo JURI::base(); ?> images/hotelguide/city/resize/<?php echo $item->image; ?> "; slimboxlink = "<?php echo JURI::base(); ?> images/hotelguide/city/album/<?php echo $item->image; ?> "; <?php } else { if (($regione == 'country' || $regione == 'continent') && $item->image) { ?> itemlink = "<?php echo JRoute::_(hotelguideHelperRoute::getCountryRoute($item->slug)); ?> "; thumblink = "<?php echo JURI::base(); ?> images/hotelguide/country/scrop/<?php echo $item->image; ?> "; imagelink = "<?php echo JURI::base(); ?> images/hotelguide/country/resize/<?php echo $item->image; ?> "; slimboxlink = "<?php echo JURI::base(); ?> images/hotelguide/country/album/<?php echo $item->image; ?> "; <?php } else { if ($regione == 'hotel' && $item->mainimage) { ?> itemlink = "<?php echo JRoute::_(hotelguideHelperRoute::getItemRoute($item->slug)); ?> "; thumblink = "<?php echo JURI::base(); ?> images/hotelguide/gallery/hotel_<?php echo $item->id; ?> /smallcrop/<?php echo $item->mainimage; ?> "; imagelink = "<?php echo JURI::base(); ?> images/hotelguide/gallery/hotel_<?php echo $item->id; ?> /resize/<?php echo $item->mainimage; ?> "; slimboxlink = "<?php echo JURI::base(); ?> images/hotelguide/gallery/hotel_<?php echo $item->id; ?> /album/<?php echo $item->mainimage; ?> "; <?php } else { ?> //thumblink = "<?php echo JURI::base(); ?> components/com_hotelguide/assets/images/no_list.gif"; thumblink = "<?php echo JURI::base(); ?> images/hotelguide/gallery/hotel_<?php echo $item->id; ?> /smallcrop/<?php echo $item->mainimage; ?> "; imagelink = "<?php echo JURI::base(); ?> images/hotelguide/gallery/hotel_<?php echo $item->id; ?> /resize/<?php echo $item->mainimage; ?> "; slimboxlink = "<?php echo JURI::base(); ?> images/hotelguide/gallery/hotel_<?php echo $item->id; ?> /album/<?php echo $item->mainimage; ?> "; //imagelink = "<?php echo JURI::base(); ?> components/com_hotelguide/assets/images/no_image.gif"; //slimboxlink = "<?php echo JURI::base(); ?> components/com_hotelguide/assets/images/no_image.gif"; <?php $item->imagewidth = 120; $item->imageheight = 120; } } } if (isset($item->assignedrestos)) { $desc = JText::sprintf('HG_MAP_ACCOMMODATIONS', $item->nam, $item->assignedrestos); } else { if ($regione == 'hotel') { $desc = $item->title; } else { $desc = $item->title; } } ?> //CreateMarker(clusterer, sidebar, <?php //echo $item->lat; ?> , <?php //echo $item->lat; ?> , "<?php //echo $desc; ?> ", thumblink, imagelink, itemlink, slimboxlink, <?php //echo $item->zoom; ?> , <?php //echo $item->imagewidth; ?> , <?php //echo $item->imageheight; ?> , logopath, logowidth, logoheight, ""); <?php } } ?> // Create our "tiny" marker icon var blueIcon = new GIcon(G_DEFAULT_ICON); blueIcon.image = "http://gmaps-samples.googlecode.com/svn/trunk/markers/red/blank.png"; // Set up our GMarkerOptions object markerOptions = { icon:blueIcon }; var latlng = new GLatLng(<?php echo $item->lat; ?> ,<?php echo $item->lon; ?> ); map.addOverlay(new GMarker(latlng, markerOptions)); map.setCenter(autoCenterBounds.getCenter(), Math.min(map.getBoundsZoomLevel(autoCenterBounds), maxZoom), maptype); <?php /*if ($googlead) { ?> var publisherID = '<?php echo $adid ?>'; var adsManagerOptions = { maxAdsOnMap : 1, style: G_ADSMANAGER_STYLE_ADUNIT, // The channel field is optional - replace this field with a channel number // of your own for Google AdSense tracking channel: '<?php echo $slot ?>' }; adsManager = new GAdsManager(map, publisherID, adsManagerOptions); adsManager.enable(); <?php }*/ ?> //give the map a little time to fully load then remove the background setTimeout('document.getElementById("map_canvas").style.backgroundImage = "";',1000); } <?php if ($ajaxmap) { ?> function loadScript() { if (toggle == 0) { loadMap(); } } <?php } else { ?> function addLoadEvent(func) { var oldonload = window.onload; if (typeof window.onload != 'function'){ window.onload = func } else { window.onload = function() { oldonload(); func(); } } } addLoadEvent(loadMap); <?php } ?> </script> <?php }
//$friendlyurl Extrae unicamente el url del hotel list($url_path, $friendlyurl) = explode(":", $link); echo '<div class="accordionitem"><a href="../' . $friendlyurl . '.html" style="color:#fff">' . stripslashes($hotel->title) . '</a>'; if ($hotel->starrate) { echo '<span style="padding:0 7px;"><img style="margin:0" src="' . JURI::base() . 'components/com_hotelguide/assets/images/' . $hotel->starrate . 'star.png" alt="Star Rate"/></span>'; } if ($hotel->price) { echo '<span style="position: absolute; right:5px; font-size:12px; font-weight:bold; color:' . $this->hgconf->pricecolor . ';">' . JText::_('HG_FROM') . ' ' . hg_html::getCurrency($hotel->id, $hotel->price); echo '</span>'; } echo '</div>'; } echo '<div style="clear:both;"></div>' . "\n"; if (count($item->hotels) > 0) { echo '<p style="text-align:right; margin-right:5px">'; $alllink = JRoute::_(hotelguideHelperRoute::getCityRoute($item->slug)); echo '<a href="' . $alllink . '" style="color:#fff">'; echo JText::sprintf('HG_SEE_ALL_ACCOMMODATIONS', $item->assignedhotels, $item->name); echo '</a></p>'; } else { echo '<p style="text-align:right; margin-right:5px">'; echo JText::_('HG_NO_ACCOMMODATION'); echo '</p>'; } echo '</div>' . "\n"; echo '</div>' . "\n"; echo '</div>' . "\n"; echo '</dd>' . "\n"; $k = 1 - $k; $n++; }
if ($this->states->image) { echo '<a href="' . JURI::base() . 'images/hotelguide/states/album/' . $this->states->image . '" rel="lightbox" title="' . $this->states->image . '"><img class="img_left imgshadow" style="padding:4px; margin: 6px 10px 0 0; border-color:' . $this->hgconf->bordercolor . '" src="' . JURI::base() . 'images/hotelguide/states/resize/' . $this->states->image . '" align="left" width="' . $this->states->imagewidth . 'px" height="' . $this->states->imageheight . 'px" alt="' . htmlentities($this->states->name) . '" /></a>'; } if ($this->states->description != '') { echo '<p style="text-align:left">'; echo $this->states->description; echo '</p>'; echo '<div style="clear:both;"></div>' . "\n"; } echo '<h3 class="title" style="margin-top:20px">'; echo JText::sprintf('HG_ALL_CITIES_IN', $this->states->name); echo '</h3>'; echo '<div id="list_wrapper"><ul class="multiple_columns">' . "\n"; foreach ($this->cityname as $city) { echo '<li style="width:28%">' . "\n"; $link = JRoute::_(hotelguideHelperRoute::getCityRoute($city->cityslug)); echo '<a href="' . $link . '">' . $city->name . '</a>' . "\n"; echo '</li>' . "\n"; } echo '</ul></div>' . "\n"; echo '<div style="clear:both;"></div>' . "\n"; if ($this->hgconf->states_links && count($this->sponsors) > 0) { echo '<h3 class="title" style="margin:10px 0 0 0; text-align:right;">'; echo '<span style="font-size:11px; font-weight:normal;">' . JText::_('HG_SPONSOR_LINKS') . '</span>'; echo '</h3>'; echo '<div style="clear:both;padding-top:5px;"></div>' . "\n"; require HOTELGUIDE_VIEWS . DS . 'hotelguide' . DS . 'tmpl' . DS . 'default_sponsors.php'; } if ($this->hgconf->box == 'None') { echo '<div class="clear"></div>' . "\n"; } else {