soda...fertisch
Addon "More Marker"
to every image you can add the categorie number, to show marker from another categories.
any changes relate to:
http://www.4homepages.de/forum/index.php?topic=16533.msg88318#msg88318download "install_gmap_show_cat.php" from the attachment, copy in your root and call it to.
search in includes/db_field_definitions.php:
$additional_image_fields['image_gmap_show'] = array($lang['image_gmap_show'], "radio", 1);insert below:
$additional_image_fields['image_gmap_show_cat'] = array($lang['image_gmap_show_cat'], "text", 0);search in /lang/<your_language>/main.php:
$lang['image_gmap_show'] = "Show Google Map?";insert below:
$lang['image_gmap_show_cat'] = "Show Google Map Categories: <span class=\"smalltext\">Categorie numbers must be seperated by ',' </span> ";replace step 4.) in details.php
// >>>>>>>>>>>>>>>>>> [MOD] Google-Map >>>>>>>>>>>>>>>>>>
$image_gmap_show = $image_row['image_gmap_show'];
if ($image_gmap_show == 1) {
$image_gmap_longitude = $image_row['image_gmap_longitude'];
$image_gmap_latitude = $image_row['image_gmap_latitude'];
$image_gmap_zoom = $image_row['image_gmap_zoom'];
$image_gmap_type = $image_row['image_gmap_type'];
if ($image_gmap_type == 1) {
$image_gmap_type2 = "G_NORMAL_MAP";
} elseif ($image_gmap_type == 2) {
$image_gmap_type2 = "G_SATELLITE_MAP";
} elseif ($image_gmap_type == 3) {
$image_gmap_type2 = "G_HYBRID_MAP";
}
if ($config['language_dir'] == "deutsch") {
$gmap_language = "de";
} else{
$gmap_language = "en";
}
$gmap = 1;
$image_gmap_show_cat = (!empty($image_row['image_gmap_show_cat'])) ? "AND cat_id IN (".$cat_id.",".$image_row['image_gmap_show_cat'].")" : "AND cat_id = ".$cat_id."";
$sql = "SELECT image_id,cat_id, image_name, image_active, image_thumb_file,image_media_file, image_gmap_longitude, image_gmap_latitude, image_gmap_show, image_gmap_show_cat
FROM ".IMAGES_TABLE."
WHERE image_active = 1 AND image_gmap_show = '1' AND cat_id NOT IN (".get_auth_cat_sql("auth_viewcat", "NOTIN").") $image_gmap_show_cat
";
$result = $site_db->query($sql);
$z = 1;
$point = "";
while ($image_row = $site_db->fetch_array($result)){
$image_gmap_thumb_file = get_file_path($image_row['image_thumb_file'], "thumb", $image_row['cat_id'], 0, 1);
$file_src = "".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_row['image_id'])."";
$image_gmap_point = "<table border='0' cellspacing='0' cellpadding='0'><tr><td><a href=".$file_src."><img src='"
.$image_gmap_thumb_file."' border='1' width='100' height='75' alt='"
.$image_row['image_name']."'></a></td><td> </td></td><td valign='top'>"
."<small>".$lang['image_gmap_text1']."<br><b>".$image_row['image_name']."</b><br>".$lang['image_gmap_text2']
."</small><span style='font-size:8px;'><br><br><b>Lat:</b> "
.$image_row['image_gmap_latitude']."°<br><b>Lon:</b>".$image_row['image_gmap_longitude']."°</span>"
."</td></tr></table>";
$point .= "var info$z = [new GInfoWindowTab(\"Das Bild\", \"" .$image_gmap_point. "\")];\n\n";
$point .= "var point$z = new GMarker(new GLatLng(\"".$image_row['image_gmap_latitude']."\",\"".$image_row['image_gmap_longitude']."\"));\n";
$point .= "map.addOverlay(point$z);\n";
$point .= "GEvent.addListener(point$z, \"click\", function() {point$z.openInfoWindowTabsHtml(info$z);});\n";
if($image_row['image_id'] == $image_id){
$point .= "point$z.openInfoWindowTabsHtml(info$z);\n\n";
};
$z++;
} //while
$gmap_java = "";
$gmap_java = "
<script src=\"http://maps.google.com/maps?file=api&v=2&hl=".$gmap_language."&key=ABQIAAAAaLpTp8_LEv_qTL274046DhTNkUTZtW5G6SR5lAPTRyRgUgm6gBTQaowkA-EWB3nH-6w29F5U0RvGpg\" type=\"text/javascript\"></script> \n
<script type=\"text/javascript\">
function load() {
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById(\"map\")); \n
map.addControl(new GLargeMapControl()); \n
map.addControl(new GMapTypeControl()); \n
map.addControl(new GScaleControl()); \n
map.addControl(new GOverviewMapControl()); \n
map.setCenter(new GLatLng(" .$image_gmap_latitude. "," .$image_gmap_longitude. "), " .$image_gmap_zoom. ", " .$image_gmap_type2. "); \n
".$point."
}
}
</script> \n";
$site_template->register_vars(array(
"gmap" => $gmap,
"gmap_java" => $gmap_java,
));
} else {
$gmap = 0;
$site_template->register_vars(array(
"gmap" => $gmap,
"gmap_java" => "",
));
}
unset($gmap_java);
// <<<<<<<<<<<<<<<<<< [MOD] Google-Map <<<<<<<<<<<<<<<<<<
have fun!
mfg Andi