コード例 #1
0
function wpgmaps_tag_pro($atts)
{
    global $wpgmza_current_map_id;
    global $wpgmza_current_map_cat_selection;
    global $wpgmza_current_map_shortcode_data;
    global $wpgmza_current_map_type;
    global $wpgmza_current_mashup;
    global $wpgmza_mashup_ids;
    global $wpgmza_mashup_all;
    $wpgmza_current_mashup = false;
    extract(shortcode_atts(array('id' => '1', 'mashup' => false, 'mashup_ids' => false, 'cat' => 'all', 'type' => 'default', 'parent_id' => false, 'lat' => false, 'lng' => false), $atts));
    /* first check if we are using custom fields to generate the map */
    if (isset($atts['lng']) && isset($atts['lat']) && isset($atts['parent_id']) && $atts['lat'] && $atts['lng']) {
        $atts['id'] = $atts['parent_id'];
        /* set the main ID as the specified parent id */
        $wpgmza_current_map_id = $atts['parent_id'];
        $wpgmza_current_map_shortcode_data[$wpgmza_current_map_id]['lat'] = $atts['lat'];
        $wpgmza_current_map_shortcode_data[$wpgmza_current_map_id]['lng'] = $atts['lng'];
        $wpgmza_current_map_shortcode_data[$wpgmza_current_map_id]['parent_id'] = $atts['parent_id'];
        $wpgmza_using_custom_meta = true;
    } else {
        $wpgmza_current_map_shortcode_data[$wpgmza_current_map_id]['lat'] = false;
        $wpgmza_current_map_shortcode_data[$wpgmza_current_map_id]['lng'] = false;
        $wpgmza_current_map_shortcode_data[$wpgmza_current_map_id]['parent_id'] = false;
        $wpgmza_using_custom_meta = false;
    }
    $wpgmza_settings = get_option("WPGMZA_OTHER_SETTINGS");
    if (isset($atts['mashup'])) {
        $wpgmza_mashup = $atts['mashup'];
    }
    if (isset($atts['parent_id'])) {
        $wpgmza_mashup_parent_id = $atts['parent_id'];
    }
    if (isset($wpgmza_mashup_ids) && $wpgmza_mashup_ids == "ALL") {
    } else {
        if (isset($atts['mashup_ids'])) {
            $wpgmza_mashup_ids[$atts['id']] = explode(",", $atts['mashup_ids']);
        }
    }
    if (isset($wpgmza_mashup)) {
        $wpgmza_current_mashup = true;
    }
    if (isset($wpgmza_mashup)) {
        $wpgmza_current_map_id = $wpgmza_mashup_parent_id;
        $res = wpgmza_get_map_data($wpgmza_mashup_parent_id);
    } else {
        $wpgmza_current_map_id = $atts['id'];
        if (isset($wpgmza_settings['wpgmza_settings_marker_pull']) && $wpgmza_settings['wpgmza_settings_marker_pull'] == '0') {
        } else {
            /* only check if marker file exists if they are using the XML method */
            wpgmza_check_if_marker_file_exists($wpgmza_current_map_id);
        }
        $res = wpgmza_get_map_data($atts['id']);
    }
    if (!isset($atts['cat']) || $atts['cat'] == "all" || $atts['cat'] == "0") {
        $wpgmza_current_map_cat_selection[$wpgmza_current_map_id] = 'all';
    } else {
        $wpgmza_current_map_cat_selection[$wpgmza_current_map_id] = explode(",", $atts['cat']);
    }
    if (!isset($atts['type']) || $atts['type'] == "default" || $atts['type'] == "") {
        $wpgmza_current_map_type[$wpgmza_current_map_id] = '';
    } else {
        $wpgmza_current_map_type[$wpgmza_current_map_id] = $atts['type'];
    }
    $map_other_settings = maybe_unserialize($res->other_settings);
    $iw_output = "";
    /* handle new modern infowindow HTML output */
    if (isset($wpgmza_settings['wpgmza_iw_type']) && $wpgmza_settings['wpgmza_iw_type'] == '1' || isset($map_other_settings['wpgmza_iw_type']) && $map_other_settings['wpgmza_iw_type'] == "1") {
        if (isset($wpgmza_settings['wpgmza_settings_infowindow_link_text'])) {
            $wpgmza_settings_infowindow_link_text = $wpgmza_settings['wpgmza_settings_infowindow_link_text'];
        } else {
            $wpgmza_settings_infowindow_link_text = __("More details", "wp-google-maps");
        }
        $iw_output = "<div id='wpgmza_iw_holder_" . $wpgmza_current_map_id . "' style='display:none;'>";
        $iw_output .= "<div class='wpgmza_modern_infowindow_inner wpgmza_modern_infowindow_inner_" . $wpgmza_current_map_id . "'>";
        $iw_output .= "<div class='wpgmza_modern_infowindow_close'> x </div>";
        $iw_output .= "<div class='wpgmza_iw_image'>";
        $iw_output .= "<img src='' style='max-width:100% !important;' class='wpgmza_iw_marker_image' />";
        $iw_output .= "<div class='wpgmza_iw_title'>";
        $iw_output .= "<p class='wpgmza_iw_title_p'></p>";
        $iw_output .= "</div>";
        $iw_output .= "";
        $iw_output .= "</div>";
        $iw_output .= "<div class='wpgmza_iw_address'>";
        $iw_output .= "<p class='wpgmza_iw_address_p'></p>";
        $iw_output .= "</div>";
        $iw_output .= "<div class='wpgmza_iw_description'>";
        $iw_output .= "<p class='wpgmza_iw_description_p'></p>";
        $iw_output .= "</div>";
        $iw_output .= "<div class='wpgmza_iw_buttons'>";
        $iw_output .= "<a href='#' class='wpgmza_button wpgmza_left wpgmza_directions_button'>" . __("Directions", "wp-google-maps") . "</a>";
        $iw_output .= "<a href='#' class='wpgmza_button wpgmza_right wpgmza_more_info_button'>{$wpgmza_settings_infowindow_link_text}</a>";
        $iw_output .= "</div>";
        $iw_output .= "</div>";
        $iw_output .= "</div>";
    }
    if (isset($wpgmza_settings['wpgmza_settings_markerlist_category'])) {
        $hide_category_column = $wpgmza_settings['wpgmza_settings_markerlist_category'];
    }
    if (isset($wpgmza_settings['wpgmza_settings_markerlist_icon'])) {
        $hide_icon_column = $wpgmza_settings['wpgmza_settings_markerlist_icon'];
    }
    if (isset($wpgmza_settings['wpgmza_settings_markerlist_title'])) {
        $hide_title_column = $wpgmza_settings['wpgmza_settings_markerlist_title'];
    }
    if (isset($wpgmza_settings['wpgmza_settings_markerlist_address'])) {
        $hide_address_column = $wpgmza_settings['wpgmza_settings_markerlist_address'];
    }
    if (isset($wpgmza_settings['wpgmza_settings_markerlist_description'])) {
        $hide_description_column = $wpgmza_settings['wpgmza_settings_markerlist_description'];
    }
    if (isset($wpgmza_settings['wpgmza_settings_filterbycat_type'])) {
        $filterbycat_type = $wpgmza_settings['wpgmza_settings_filterbycat_type'];
    } else {
        $filterbycat_type = false;
    }
    if (!$filterbycat_type) {
        $filterbycat_type = 1;
    }
    $map_width_type = stripslashes($res->map_width_type);
    $map_height_type = stripslashes($res->map_height_type);
    if (!isset($map_width_type)) {
        $map_width_type = "px";
    }
    if (!isset($map_height_type)) {
        $map_height_type = "px";
    }
    if ($map_width_type == "%" && intval($res->map_width) > 100) {
        $res->map_width = 100;
    }
    if ($map_height_type == "%" && intval($res->map_height) > 100) {
        $res->map_height = 100;
    }
    $map_align = $res->alignment;
    if (!$map_align || $map_align == "" || $map_align == "1") {
        $map_align = "float:left;";
    } else {
        if ($map_align == "2") {
            $map_align = "margin-left:auto !important; margin-right:auto !important; align:center;";
        } else {
            if ($map_align == "3") {
                $map_align = "float:right;";
            } else {
                if ($map_align == "4") {
                    $map_align = "clear:both;";
                }
            }
        }
    }
    $map_style = "style=\"display:block; overflow:auto; width:" . $res->map_width . "" . $map_width_type . "; height:" . $res->map_height . "" . $map_height_type . "; {$map_align}\"";
    global $short_code_active;
    $short_code_active = true;
    wp_register_style('wpgmaps-style-pro', plugins_url('css/wpgmza_style_pro.css', __FILE__));
    wp_enqueue_style('wpgmaps-style-pro');
    global $wpgmza_short_code_array;
    $wpgmza_short_code_array[] = $wpgmza_current_map_id;
    $d_enabled = $res->directions_enabled;
    $filterbycat = $res->filterbycat;
    $map_width = $res->map_width;
    $map_width_type = $res->map_width_type;
    // for marker list
    $default_marker = $res->default_marker;
    if (isset($res->default_to)) {
        $default_to = $res->default_to;
    } else {
        $default_to = "";
    }
    $show_location = $res->show_user_location;
    if ($show_location == "1") {
        $use_location_from = "<span style=\"font-size:0.75em;\"><button id=\"wpgmza_use_my_location_from\" mid=\"" . $wpgmza_current_map_id . "\" title='" . __("Use my location", "wp-google-maps") . "' ><img src='" . plugins_url(plugin_basename(dirname(__FILE__))) . "/images/mylocation.png' title='" . __("Use my location", "wp-google-maps") . "' width='15' /></button></span>";
        $use_location_to = "<span style=\"font-size:0.75em;\"><button id=\"wpgmza_use_my_location_to\" mid=\"" . $wpgmza_current_map_id . "\" title='" . __("Use my location", "wp-google-maps") . "' ><img src='" . plugins_url(plugin_basename(dirname(__FILE__))) . "/images/mylocation.png' title='" . __("Use my location", "wp-google-maps") . "' width='15' /></button></span>";
    } else {
        $use_location_from = "";
        $use_location_to = "";
    }
    if ($default_marker) {
        $default_marker = "<img src='" . $default_marker . "' />";
    } else {
        $default_marker = "<img src='" . wpgmaps_get_plugin_url() . "/images/marker.png' />";
    }
    $dbox_width = $res->dbox_width;
    $dbox_option = $res->dbox;
    /* set the width of the directions box */
    if (isset($map_other_settings['wpgmza_dbox_width_type'])) {
        $wpgmza_dbox_width_type = $map_other_settings['wpgmza_dbox_width_type'];
    } else {
        $wpgmza_dbox_width_type = "px";
    }
    if ($dbox_option == "1") {
        $dbox_style = "display:none; width:" . $dbox_width . $wpgmza_dbox_width_type . "; clear:both;";
    } else {
        if ($dbox_option == "2") {
            $dbox_style = "float:left; width:" . $dbox_width . $wpgmza_dbox_width_type . "; padding-right:10px; display:block; overflow:auto;";
        } else {
            if ($dbox_option == "3") {
                $dbox_style = "float:right; width:" . $dbox_width . $wpgmza_dbox_width_type . "; padding-right:10px; display:block; overflow:auto;";
            } else {
                if ($dbox_option == "4") {
                    $dbox_style = "float:none; width:" . $dbox_width . $wpgmza_dbox_width_type . "; padding-bottom:10px; display:block; overflow:auto; clear:both;";
                } else {
                    if ($dbox_option == "5") {
                        $dbox_style = "float:none; width:" . $dbox_width . $wpgmza_dbox_width_type . "; padding-top:10px; display:block; overflow:auto; clear:both;";
                    } else {
                        $dbox_style = "display:none;";
                    }
                }
            }
        }
    }
    $wpgmza_marker_list_output = "";
    $wpgmza_marker_filter_output = "";
    // Filter by category
    if ($filterbycat == 1) {
        if ($filterbycat_type == "1") {
            $wpgmza_marker_filter_output .= "<p id='wpgmza_filter_" . $wpgmza_current_map_id . "' style='text-align:left; margin-bottom:0px;'>" . __("Filter by", "wp-google-maps") . "";
            $wpgmza_filter_dropdown = wpgmza_pro_return_category_select_list($wpgmza_current_map_id);
            $wpgmza_marker_filter_output .= "<select mid=\"" . $wpgmza_current_map_id . "\" name=\"wpgmza_filter_select\" id=\"wpgmza_filter_select\">";
            $wpgmza_marker_filter_output .= $wpgmza_filter_dropdown;
            $wpgmza_marker_filter_output .= "</select></p>";
        } else {
            if (intval($filterbycat_type) == 2) {
                $wpgmza_marker_filter_output .= "<p id='wpgmza_filter_" . $wpgmza_current_map_id . "' style='text-align:left; margin-bottom:0px;'>" . __("Filter by", "wp-google-maps") . "</p>";
                $wpgmza_marker_filter_output .= "<div style=\"display:block; width:100%; height:auto; margin-top:10px;\">";
                $wpgmza_marker_filter_output .= "<div class='wpgmza_filter_container' id='wpgmza_filter_container_" . $wpgmza_current_map_id . "'>";
                $wpgmza_marker_filter_output .= wpgmza_pro_return_category_checkbox_list($wpgmza_current_map_id, true, false);
                $wpgmza_marker_filter_output .= "</div>";
                $wpgmza_marker_filter_output .= "</div>";
            } else {
                $wpgmza_marker_filter_output .= "<p id='wpgmza_filter_" . $wpgmza_current_map_id . "' style='text-align:left; margin-bottom:0px;'>" . __("Filter by", "wp-google-maps") . "";
                $wpgmza_filter_dropdown = wpgmza_pro_return_category_select_list($wpgmza_current_map_id);
                $wpgmza_marker_filter_output .= "<select mid=\"" . $wpgmza_current_map_id . "\" name=\"wpgmza_filter_select\" id=\"wpgmza_filter_select\">";
                $wpgmza_marker_filter_output .= $wpgmza_filter_dropdown;
                $wpgmza_marker_filter_output .= "</select></p>";
            }
        }
    }
    $wpgmza_marker_datatables_output = "";
    if (isset($hide_category_column) && $hide_category_column == "yes") {
        $wpgmza_marker_datatables_output .= "<style>.wpgmza_table_category { display: none !important; }</style>";
    }
    if (isset($hide_icon_column) && $hide_icon_column == "yes") {
        $wpgmza_marker_datatables_output .= "<style>.wpgmza_table_marker { display: none; }</style>";
    }
    if (isset($hide_title_column) && $hide_title_column == "yes") {
        $wpgmza_marker_datatables_output .= "<style>.wpgmza_table_title { display: none; }</style>";
    }
    if (isset($hide_address_column) && $hide_address_column == "yes") {
        $wpgmza_marker_datatables_output .= "<style>.wpgmza_table_address { display: none; }</style>";
    }
    if (isset($hide_description_column) && $hide_description_column == "yes") {
        $wpgmza_marker_datatables_output .= "<style>.wpgmza_table_description { display: none; }</style>";
    }
    $sl_data = "";
    if (isset($map_other_settings['store_locator_enabled']) && $map_other_settings['store_locator_enabled'] == 1) {
        $sl_data = wpgmaps_sl_user_output_pro($wpgmza_current_map_id);
        $wpgmza_marker_filter_output = "";
    } else {
        $sl_data = "";
    }
    // GET LIST OF MARKERS
    if (isset($map_other_settings['list_markers_by']) && $map_other_settings['list_markers_by'] != "") {
        /* they are using the new listing options */
        if ($map_other_settings['list_markers_by'] == "3") {
            if ($wpgmza_current_mashup) {
                $wpgmc = new wpgmza();
                $wpgmza_marker_list_output .= $wpgmc->list_markers(false, 3, $wpgmza_mashup_parent_id, $wpgmza_current_map_cat_selection[$wpgmza_current_map_id], true, $wpgmza_mashup_ids[$atts['id']]);
            } else {
                $wpgmc = new wpgmza();
                $wpgmza_marker_list_output .= $wpgmc->list_markers(false, 3, $wpgmza_current_map_id, $wpgmza_current_map_cat_selection[$wpgmza_current_map_id]);
            }
        } else {
            if ($map_other_settings['list_markers_by'] == "1") {
                if ($wpgmza_current_mashup) {
                    $wpgmc = new wpgmza();
                    $wpgmza_marker_list_output .= $wpgmc->list_markers(false, 1, $wpgmza_mashup_parent_id, $wpgmza_current_map_cat_selection[$wpgmza_mashup_parent_id], true, $wpgmza_mashup_ids[$atts['id']], false, $res->order_markers_by, $res->order_markers_choice);
                } else {
                    $wpgmc = new wpgmza();
                    $wpgmza_marker_list_output .= $wpgmc->list_markers(false, 1, $wpgmza_current_map_id, $wpgmza_current_map_cat_selection[$wpgmza_current_map_id], false, false, false, $res->order_markers_by, $res->order_markers_choice);
                }
            } else {
                if ($map_other_settings['list_markers_by'] == "2") {
                    if ($wpgmza_current_mashup) {
                        $wpgmc = new wpgmza();
                        $wpgmza_marker_list_output .= $wpgmc->list_markers(false, 2, $wpgmza_mashup_parent_id, $wpgmza_current_map_cat_selection[$wpgmza_mashup_parent_id], true, $wpgmza_mashup_ids[$atts['id']]);
                    } else {
                        $wpgmc = new wpgmza();
                        $wpgmza_marker_list_output .= $wpgmc->list_markers(false, 2, $wpgmza_current_map_id, $wpgmza_current_map_cat_selection[$wpgmza_current_map_id]);
                    }
                } else {
                    if ($map_other_settings['list_markers_by'] == "4") {
                        if ($wpgmza_current_mashup) {
                            $wpgmc = new wpgmza();
                            $wpgmza_marker_list_output .= $wpgmc->list_markers(false, 4, $wpgmza_mashup_parent_id, $wpgmza_current_map_cat_selection[$wpgmza_mashup_parent_id], true, $wpgmza_mashup_ids[$atts['id']]);
                        } else {
                            $wpgmc = new wpgmza();
                            $wpgmza_marker_list_output .= $wpgmc->list_markers(false, 4, $wpgmza_current_map_id, $wpgmza_current_map_cat_selection[$wpgmza_current_map_id]);
                        }
                    }
                }
            }
        }
    } else {
        if ($res->listmarkers == 1 && $res->listmarkers_advanced == 1) {
            if ($wpgmza_current_mashup) {
                $wpgmza_marker_list_output .= wpgmza_return_marker_list($wpgmza_mashup_parent_id, false, $map_width . $map_width_type, $wpgmza_current_mashup, $wpgmza_mashup_ids[$atts['id']]);
            } else {
                $wpgmza_marker_list_output .= wpgmza_return_marker_list($wpgmza_current_map_id, false, $map_width . $map_width_type, false);
            }
        } else {
            if ($res->listmarkers == 1 && $res->listmarkers_advanced == 0) {
                global $wpdb;
                global $wpgmza_tblname;
                // marker sorting functionality
                if ($res->order_markers_by == 1) {
                    $order_by = "id";
                } else {
                    if ($res->order_markers_by == 2) {
                        $order_by = "title";
                    } else {
                        if ($res->order_markers_by == 3) {
                            $order_by = "address";
                        } else {
                            if ($res->order_markers_by == 4) {
                                $order_by = "description";
                            } else {
                                if ($res->order_markers_by == 5) {
                                    $order_by = "category";
                                } else {
                                    $order_by = "id";
                                }
                            }
                        }
                    }
                }
                if ($res->order_markers_choice == 1) {
                    $order_choice = "ASC";
                } else {
                    $order_choice = "DESC";
                }
                if ($wpgmza_current_mashup) {
                    $wpgmza_cnt = 0;
                    $sql_string1 = "";
                    if ($wpgmza_mashup_ids[$atts['id']][0] == "ALL") {
                        $wpgmza_sql1 = "SELECT * FROM {$wpgmza_tblname} ORDER BY `{$order_by}` {$order_choice}";
                    } else {
                        $wpgmza_id_cnt = count($wpgmza_mashup_ids[$atts['id']]);
                        foreach ($wpgmza_mashup_ids[$atts['id']] as $wpgmza_map_id) {
                            $wpgmza_cnt++;
                            if ($wpgmza_cnt == 1) {
                                $sql_string1 .= "`map_id` = '{$wpgmza_map_id}' ";
                            } elseif ($wpgmza_cnt > 1 && $wpgmza_cnt < $wpgmza_id_cnt) {
                                $sql_string1 .= "OR `map_id` = '{$wpgmza_map_id}' ";
                            } else {
                                $sql_string1 .= "OR `map_id` = '{$wpgmza_map_id}' ";
                            }
                        }
                        $wpgmza_sql1 = "SELECT * FROM {$wpgmza_tblname} WHERE {$sql_string1} ORDER BY `{$order_by}` {$order_choice}";
                    }
                } else {
                    $wpgmza_sql1 = "SELECT * FROM {$wpgmza_tblname} WHERE `map_id` = '{$wpgmza_current_map_id}' ORDER BY `{$order_by}` {$order_choice}";
                }
                $results = $wpdb->get_results($wpgmza_sql1);
                $wpgmza_marker_list_output .= "\r\n                    <div style='clear:both;'>\r\n                    <table id=\"wpgmza_marker_list\" class=\"wpgmza_marker_list_class\" cellspacing=\"0\" cellpadding=\"0\" style='width:" . $map_width . "" . $map_width_type . "'>\r\n                    <tbody>\r\n            ";
                $wpgmza_settings = get_option("WPGMZA_OTHER_SETTINGS");
                if (isset($wpgmza_settings['wpgmza_settings_image_resizing']) && $wpgmza_settings['wpgmza_settings_image_resizing'] == 'yes') {
                    $wpgmza_image_resizing = true;
                } else {
                    $wpgmza_image_resizing = false;
                }
                if (isset($wpgmza_settings['wpgmza_settings_image_height'])) {
                    $wpgmza_image_height = $wpgmza_settings['wpgmza_settings_image_height'];
                } else {
                    $wpgmza_image_height = false;
                }
                if (isset($wpgmza_settings['wpgmza_settings_image_height'])) {
                    $wpgmza_image_height = $wpgmza_settings['wpgmza_settings_image_height'] . "px";
                } else {
                    $wpgmza_image_height = false;
                }
                if (isset($wpgmza_settings['wpgmza_settings_image_width'])) {
                    $wpgmza_image_width = $wpgmza_settings['wpgmza_settings_image_width'] . "px";
                } else {
                    $wpgmza_image_width = false;
                }
                if (!$wpgmza_image_height || !isset($wpgmza_image_height)) {
                    $wpgmza_image_height = "auto";
                }
                if (!$wpgmza_image_width || !isset($wpgmza_image_width)) {
                    $wpgmza_image_width = "auto";
                }
                $wmcnt = 0;
                foreach ($results as $result) {
                    $wmcnt++;
                    $img = $result->pic;
                    $wpgmaps_id = $result->id;
                    $link = $result->link;
                    $icon = $result->icon;
                    $wpgmaps_lat = $result->lat;
                    $wpgmaps_lng = $result->lng;
                    $wpgmaps_address = $result->address;
                    /* added in 5.52 - phasing out timthumb */
                    /* timthumb completely removed in 5.54 */
                    /*if ($wpgmza_use_timthumb == "" || !isset($wpgmza_use_timthumb)) {
                    		$pic = "<img src='".wpgmaps_get_plugin_url()."/timthumb.php?src=".$result->pic."&h=".$wpgmza_image_height."&w=".$wpgmza_image_width."&zc=1' />";
                                 } else {*/
                    if (!$img) {
                        $pic = "";
                    } else {
                        if ($wpgmza_image_resizing) {
                            $pic = "<img src='" . $result->pic . "' class='wpgmza_map_image' style=\"margin:5px; height:" . $wpgmza_image_height . "px; width:" . $wpgmza_image_width . ".px\" />";
                        } else {
                            $pic = "<img src='" . $result->pic . "' class='wpgmza_map_image' style=\"margin:5px;\" />";
                        }
                    }
                    /*}*/
                    if (!$icon) {
                        $icon = $default_marker;
                    } else {
                        $icon = "<img src='" . $result->icon . "' />";
                    }
                    if ($d_enabled == "1") {
                        $wpgmaps_dir_text = "<br /><a href=\"javascript:void(0);\" id=\"{$wpgmza_current_map_id}\" title=\"" . __("Get directions to", "wp-google-maps") . " " . $result->title . "\" class=\"wpgmza_gd\" wpgm_addr_field=\"" . $wpgmaps_address . "\" gps=\"{$wpgmaps_lat},{$wpgmaps_lng}\">" . __("Directions", "wp-google-maps") . "</a>";
                    } else {
                        $wpgmaps_dir_text = "";
                    }
                    if ($result->description) {
                        $wpgmaps_desc_text = "<br />" . $result->description . "";
                    } else {
                        $wpgmaps_desc_text = "";
                    }
                    if ($wmcnt % 2) {
                        $oddeven = "wpgmaps_odd";
                    } else {
                        $oddeven = "wpgmaps_even";
                    }
                    $wpgmza_marker_list_output .= "\r\n                    <tr id=\"wpgmza_marker_" . $result->id . "\" mid=\"" . $result->id . "\" mapid=\"" . $result->map_id . "\" class=\"wpgmaps_mlist_row {$oddeven}\">\r\n                        <td height=\"40\" class=\"wpgmaps_mlist_marker\">" . $icon . "</td>\r\n                        <td class=\"wpgmaps_mlist_pic\" style=\"width:" . ($wpgmza_image_width + 20) . "px;\">{$pic}</td>\r\n                        <td  valign=\"top\" align=\"left\" class=\"wpgmaps_mlist_info\">\r\n                            <strong><a href=\"javascript:openInfoWindow({$wpgmaps_id});\" id=\"wpgmaps_marker_{$wpgmaps_id}\" title=\"" . stripslashes($result->title) . "\">" . stripslashes($result->title) . "</a></strong>\r\n                            " . stripslashes($wpgmaps_desc_text) . "\r\n                            {$wpgmaps_dir_text}\r\n                        </td>\r\n\r\n                    </tr>";
                }
                $wpgmza_marker_list_output .= "</tbody></table></div>";
            } else {
                $wpgmza_marker_list_output = "";
            }
        }
    }
    $dbox_div = "\r\n        <div id=\"wpgmaps_directions_edit_" . $wpgmza_current_map_id . "\" style=\"{$dbox_style}\" class=\"wpgmaps_directions_outer_div\">\r\n            <h2>" . __("Get Directions", "wp-google-maps") . "</h2>\r\n            <div id=\"wpgmaps_directions_editbox_" . $wpgmza_current_map_id . "\">\r\n                <table>\r\n                    <tr>\r\n                        <td><label for=\"wpgmza_dir_type_" . $wpgmza_current_map_id . "\">" . __("For", "wp-google-maps") . "</label></td><td>\r\n                            <select id=\"wpgmza_dir_type_" . $wpgmza_current_map_id . "\" name=\"wpgmza_dir_type_" . $wpgmza_current_map_id . "\">\r\n                            <option value=\"DRIVING\" selected=\"selected\">" . __("Driving", "wp-google-maps") . "</option>\r\n                            <option value=\"WALKING\">" . __("Walking", "wp-google-maps") . "</option>\r\n                            <option value=\"BICYCLING\">" . __("Bicycling", "wp-google-maps") . "</option>\r\n                            </select>\r\n                            &nbsp;\r\n                            <a href=\"javascript:void(0);\" mapid=\"" . $wpgmza_current_map_id . "\" id=\"wpgmza_show_options_" . $wpgmza_current_map_id . "\" onclick=\"wpgmza_show_options(" . $wpgmza_current_map_id . ");\" style=\"font-size:10px;\">" . __("show options", "wp-google-maps") . "</a>\r\n                            <a href=\"javascript:void(0);\" mapid=\"" . $wpgmza_current_map_id . "\" id=\"wpgmza_hide_options_" . $wpgmza_current_map_id . "\" onclick=\"wpgmza_hide_options(" . $wpgmza_current_map_id . ");\" style=\"font-size:10px; display:none;\">" . __("hide options", "wp-google-maps") . "</a>\r\n                        <div style=\"display:none\" id=\"wpgmza_options_box_" . $wpgmza_current_map_id . "\">\r\n                            <input type=\"checkbox\" id=\"wpgmza_tolls_" . $wpgmza_current_map_id . "\" name=\"wpgmza_tolls_" . $wpgmza_current_map_id . "\" value=\"tolls\" /> <label for=\"wpgmza_tolls_" . $wpgmza_current_map_id . "\">" . __("Avoid Tolls", "wp-google-maps") . "</label><br />\r\n                            <input type=\"checkbox\" id=\"wpgmza_highways_" . $wpgmza_current_map_id . "\" name=\"wpgmza_highways_" . $wpgmza_current_map_id . "\" value=\"highways\" /> <label for=\"wpgmza_highways_" . $wpgmza_current_map_id . "\">" . __("Avoid Highways", "wp-google-maps") . "</label>\r\n                        </div>\r\n\r\n                        </td>\r\n                    </tr>\r\n                    <tr class='wpgmaps_from_row'><td class='wpgmaps_from_td1'><label for=\"wpgmza_input_from_" . $wpgmza_current_map_id . "\">" . __("From", "wp-google-maps") . "</label></td><td width='90%' class='wpgmaps_from_td2'><input type=\"text\" value=\"\" id=\"wpgmza_input_from_" . $wpgmza_current_map_id . "\" style='width:80%' /> {$use_location_from}</td></tr>\r\n                    <tr class='wpgmaps_to_row'><td class='wpgmaps_to_td1'><label for=\"wpgmza_input_to_" . $wpgmza_current_map_id . "\">" . __("To", "wp-google-maps") . "</td><td width='90%' class='wpgmaps_to_td2'><input type=\"text\" value=\"{$default_to}\" id=\"wpgmza_input_to_" . $wpgmza_current_map_id . "\" style='width:80%' /> {$use_location_to}</td></tr>\r\n                    <tr>\r\n\r\n                      <td>\r\n                        </td><td>\r\n                      <input onclick=\"javascript:void(0);\" class=\"wpgmaps_get_directions\" id=\"" . $wpgmza_current_map_id . "\" type=\"button\" value=\"" . __("Go", "wp-google-maps") . "\"/>\r\n                      </td>\r\n                    </tr>\r\n                </table>\r\n            </div>\r\n\r\n\r\n    ";
    if ($dbox_option == "5" || $dbox_option == "1" || !isset($dbox_option)) {
        if ($wpgmza_current_mashup) {
            $wpgmza_anchors = $wpgmza_mashup_ids[$atts['id']];
        } else {
            $wpgmza_anchors = $wpgmza_current_map_id;
        }
        $ret_msg = "\r\n            {$wpgmza_marker_datatables_output}\r\n            <style>\r\n            .wpgmza_map img { max-width:none !important; }\r\n            .wpgmza_widget { overflow: auto; }\r\n            </style>\r\n            " . wpgmaps_check_approval_string() . "\r\n            " . wpgmaps_return_marker_anchors($wpgmza_anchors) . "\r\n            {$wpgmza_marker_filter_output}\r\n            {$sl_data}\r\n            " . apply_filters("wpgooglemaps_filter_map_div_output", "<div class=\"wpgmza_map\" id=\"wpgmza_map_" . $wpgmza_current_map_id . "\" {$map_style}> </div>", $wpgmza_current_map_id) . "\r\n            {$wpgmza_marker_list_output}\r\n\r\n            <div style=\"display:block; width:100%;\">\r\n\r\n                {$dbox_div}\r\n                    <div id=\"wpgmaps_directions_notification_" . $wpgmza_current_map_id . "\" style=\"display:none;\">" . __("Fetching directions...", "wp-google-maps") . "...</div>\r\n                    <div id=\"wpgmaps_directions_reset_" . $wpgmza_current_map_id . "\" style=\"display:none;\">\r\n                        <a href='javascript:void(0)' onclick='wpgmza_reset_directions(" . $wpgmza_current_map_id . ");' id='wpgmaps_reset_directions' title='" . __("Reset directions", "wp-google-maps") . "'>" . __("Reset directions", "wp-google-maps") . "</a>\r\n                        <br /><a href='' id='wpgmaps_print_directions_" . $wpgmza_current_map_id . "' title='" . __("Print directions", "wp-google-maps") . "'>" . __("Print directions", "wp-google-maps") . "</a>\r\n                    </div>\r\n                    <div id=\"directions_panel_" . $wpgmza_current_map_id . "\"></div>\r\n                </div>\r\n            </div>\r\n\r\n        ";
    } else {
        if ($wpgmza_current_mashup) {
            $wpgmza_anchors = $wpgmza_mashup_ids[$atts['id']];
        } else {
            $wpgmza_anchors = $wpgmza_current_map_id;
        }
        $ret_msg = "\r\n            {$wpgmza_marker_datatables_output}\r\n            <style>\r\n            .wpgmza_map img { max-width:none !important; }\r\n            .wpgmza_widget { overflow: auto; }\r\n            </style>\r\n            \r\n            <div style=\"display:block; width:100%; overflow:auto;\">\r\n\r\n            \t{$dbox_div}\r\n                <div id=\"wpgmaps_directions_notification_" . $wpgmza_current_map_id . "\" style=\"display:none;\">" . __("Fetching directions...", "wp-google-maps") . "...</div>\r\n                <div id=\"wpgmaps_directions_reset_" . $wpgmza_current_map_id . "\" style=\"display:none;\">\r\n                    <a href='javascript:void(0)' onclick='wpgmza_reset_directions(" . $wpgmza_current_map_id . ");' id='wpgmaps_reset_directions' title='" . __("Reset directions", "wp-google-maps") . "'>" . __("Reset directions", "wp-google-maps") . "</a>\r\n                    <br /><a href='' id='wpgmaps_print_directions_" . $wpgmza_current_map_id . "' title='" . __("Print directions", "wp-google-maps") . "'>" . __("Print directions", "wp-google-maps") . "</a>\r\n                </div>\r\n                <div id=\"directions_panel_" . $wpgmza_current_map_id . "\"></div>\r\n            </div>\r\n                \r\n                \r\n\r\n                {$wpgmza_marker_filter_output}\r\n                {$sl_data}\r\n\r\n            " . wpgmaps_return_marker_anchors($wpgmza_anchors) . "\r\n            " . apply_filters("wpgooglemaps_filter_map_div_output", "<div class=\"wpgmza_map\" id=\"wpgmza_map_" . $wpgmza_current_map_id . "\" {$map_style}> </div>") . "   \r\n            \r\n                <div style='text-align:center; width:90%; border:1px solid #ccc; padding:10px;'>\r\n                    <h1>" . __("The map could not load.", "wp-google-maps") . "</h1><p>" . __("This is normally caused by a conflict with another plugin or a JavaScript error that is preventing our plugin's Javascript from executing. Please try disable all plugins one by one and see if this problem persists. If it persists, please contact nick@wpgmaps.com for support.", "wp-google-maps") . "</p>\r\n                    \r\n                </div>\r\n            </div>\r\n\r\n            {$wpgmza_marker_list_output}\r\n            </div>\r\n\r\n        ";
    }
    if (function_exists("wpgmza_register_ugm_version")) {
        $ugm_enabled = $res->ugm_enabled;
        if ($ugm_enabled == 1) {
            $ret_msg .= wpgmaps_ugm_user_form($wpgmza_current_map_id);
        }
    }
    if ($wpgmza_using_custom_meta) {
        /* we're using meta fields to generate the map, ignore default functionality */
        $ret_msg = "\r\n            <style>\r\n                .wpgmza_map img { max-width:none !important; }\r\n                .wpgmza_widget { overflow: auto; }\r\n            </style>\r\n            " . apply_filters("wpgooglemaps_filter_map_div_output", "<div class=\"wpgmza_map\" id=\"wpgmza_map_" . $wpgmza_current_map_id . "\" {$map_style}> </div>") . "\r\n\r\n            ";
    }
    $wpgmza_main_settings = get_option("WPGMZA_OTHER_SETTINGS");
    if (isset($wpgmza_main_settings['wpgmza_custom_css']) && $wpgmza_main_settings['wpgmza_custom_css'] != "") {
        $ret_msg = "\r\n            <!-- WP Google Maps Custom CSS -->\r\n            <style type=\"text/css\">" . $wpgmza_main_settings['wpgmza_custom_css'] . "</style>\r\n            " . $ret_msg;
    }
    /* modern infowindow output */
    /* $ret_msg = $ret_msg.$iw_output; deprecated in version 5.63 as the info window is now being created programatically with JS */
    $ret_msg = $ret_msg;
    return $ret_msg;
}
コード例 #2
0
function wpgmaps_tag_pro($atts)
{
    global $wpgmza_current_map_id;
    global $wpgmza_current_mashup;
    global $wpgmza_mashup_ids;
    global $wpgmza_mashup_all;
    $wpgmza_current_mashup = false;
    extract(shortcode_atts(array('id' => '1', 'mashup' => false, 'mashup_ids' => false, 'parent_id' => '1'), $atts));
    $wpgmza_mashup = $atts['mashup'];
    if ($wpgmza_mashup_ids == "ALL") {
    } else {
        $wpgmza_mashup_ids = explode(",", $atts['mashup_ids']);
    }
    $wpgmza_mashup_parent_id = $atts['parent_id'];
    if ($wpgmza_mashup) {
        $wpgmza_current_mashup = true;
    }
    if ($wpgmza_mashup) {
        $wpgmza_current_map_id = $wpgmza_mashup_parent_id;
        $res = wpgmza_get_map_data($wpgmza_mashup_parent_id);
    } else {
        $wpgmza_current_map_id = $atts['id'];
        $res = wpgmza_get_map_data($atts['id']);
    }
    $wpgmza_general_settings = get_option('WPGMZA_OTHER_SETTINGS');
    $hide_category_column = $wpgmza_general_settings['wpgmza_settings_markerlist_category'];
    $map_width_type = stripslashes($res->map_width_type);
    $map_height_type = stripslashes($res->map_height_type);
    if (!isset($map_width_type)) {
        $map_width_type == "px";
    }
    if (!isset($map_height_type)) {
        $map_height_type == "px";
    }
    if ($map_width_type == "%" && intval($res->map_width) > 100) {
        $res->map_width = 100;
    }
    if ($map_height_type == "%" && intval($res->map_height) > 100) {
        $res->map_height = 100;
    }
    $map_align = $res->alignment;
    if (!$map_align || $map_align == "" || $map_align == "1") {
        $map_align = "float:left;";
    } else {
        if ($map_align == "2") {
            $map_align = "margin-left:auto !important; margin-right:auto; !important; align:center;";
        } else {
            if ($map_align == "3") {
                $map_align = "float:right;";
            } else {
                if ($map_align == "4") {
                    $map_align = "clear:both;";
                }
            }
        }
    }
    $map_style = "style=\"display:block; overflow:auto; width:" . $res->map_width . "" . $map_width_type . "; height:" . $res->map_height . "" . $map_height_type . "; {$map_align}\"";
    global $short_code_active;
    $short_code_active = true;
    global $wpgmza_short_code_array;
    $wpgmza_short_code_array[] = $wpgmza_current_map_id;
    $d_enabled = $res->directions_enabled;
    $filterbycat = $res->filterbycat;
    $map_width = $res->map_width;
    $map_width_type = $res->map_width_type;
    // for marker list
    $default_marker = $res->default_marker;
    $show_location = $res->show_user_location;
    if ($show_location == "1") {
        $use_location_from = "<span style=\"font-size:0.75em;\"><a href='javascript:void(0);' id='wpgmza_use_my_location_from' mid='{$wpgmza_current_map_id}' title='" . __("Use my location", "wp-google-maps") . "'>" . __("Use my location", "wp-google-maps") . "</a></span>";
        $use_location_to = "<span style=\"font-size:0.75em;\"><a href='javascript:void(0);' id='wpgmza_use_my_location_to' mid='{$wpgmza_current_map_id}' title='" . __("Use my location", "wp-google-maps") . "'>" . __("Use my location", "wp-google-maps") . "</a></span>";
    }
    if ($default_marker) {
        $default_marker = "<img src='" . $default_marker . "' />";
    } else {
        $default_marker = "<img src='" . wpgmaps_get_plugin_url() . "/images/marker.png' />";
    }
    $dbox_width = $res->dbox_width;
    $dbox_option = $res->dbox;
    if ($dbox_option == "1") {
        $dbox_style = "display:none;";
    } else {
        if ($dbox_option == "2") {
            $dbox_style = "float:left; width:" . $dbox_width . "px; padding-right:10px; display:block; overflow:auto;";
        } else {
            if ($dbox_option == "3") {
                $dbox_style = "float:right; width:" . $dbox_width . "px; padding-right:10px; display:block; overflow:auto;";
            } else {
                if ($dbox_option == "4") {
                    $dbox_style = "float:none; width:" . $dbox_width . "px; padding-bottom:10px; display:block; overflow:auto; clear:both;";
                } else {
                    if ($dbox_option == "5") {
                        $dbox_style = "float:none; width:" . $dbox_width . "px; padding-top:10px; display:block; overflow:auto; clear:both;";
                    } else {
                        $dbox_style = "display:none;";
                    }
                }
            }
        }
    }
    $wpgmza_marker_list_output = "";
    $wpgmza_marker_filter_output = "";
    // Filter by category
    if ($filterbycat == 1) {
        $wpgmza_marker_filter_output .= "<p style='text-align:left; margin-bottom:0px;'>" . __("Filter by", "wp-google-maps") . "";
        $wpgmza_filter_dropdown = wpgmza_pro_return_category_select_list();
        $wpgmza_marker_filter_output .= "<select mid=\"" . $wpgmza_current_map_id . "\" name=\"wpgmza_filter_select\" id=\"wpgmza_filter_select\">";
        $wpgmza_marker_filter_output .= $wpgmza_filter_dropdown;
        $wpgmza_marker_filter_output .= "</select></p>";
    }
    if ($hide_category_column) {
        $wpgmza_marker_filter_output .= "<style>.wpgmza_table_category { display: none; }</style>";
    }
    // GET LIST OF MARKERS
    if ($res->listmarkers == 1 && $res->listmarkers_advanced == 1) {
        if ($wpgmza_current_mashup) {
            $wpgmza_marker_list_output .= wpgmza_return_marker_list($wpgmza_mashup_parent_id, false, $map_width . $map_width_type, $wpgmza_current_mashup, $wpgmza_mashup_ids);
        } else {
            $wpgmza_marker_list_output .= wpgmza_return_marker_list($wpgmza_current_map_id, false, $map_width . $map_width_type, false);
        }
    } else {
        if ($res->listmarkers == 1 && $res->listmarkers_advanced == 0) {
            global $wpdb;
            global $wpgmza_tblname;
            // marker sorting functionality
            if ($res->order_markers_by == 1) {
                $order_by = "id";
            } else {
                if ($res->order_markers_by == 2) {
                    $order_by = "title";
                } else {
                    if ($res->order_markers_by == 3) {
                        $order_by = "address";
                    } else {
                        if ($res->order_markers_by == 4) {
                            $order_by = "description";
                        } else {
                            if ($res->order_markers_by == 5) {
                                $order_by = "category";
                            } else {
                                $order_by = "id";
                            }
                        }
                    }
                }
            }
            if ($res->order_markers_choice == 1) {
                $order_choice = "ASC";
            } else {
                $order_choice = "DESC";
            }
            if ($wpgmza_current_mashup) {
                $wpgmza_cnt = 0;
                $sql_string1 = "";
                if ($wpgmza_mashup_ids[0] == "ALL") {
                    $wpgmza_sql1 = "SELECT * FROM {$wpgmza_tblname} ORDER BY `{$order_by}` {$order_choice}";
                } else {
                    $wpgmza_id_cnt = count($wpgmza_mashup_ids);
                    foreach ($wpgmza_mashup_ids as $wpgmza_map_id) {
                        $wpgmza_cnt++;
                        if ($wpgmza_cnt == 1) {
                            $sql_string1 .= "`map_id` = '{$wpgmza_map_id}' ";
                        } elseif ($wpgmza_cnt > 1 && $wpgmza_cnt < $wpgmza_id_cnt) {
                            $sql_string1 .= "OR `map_id` = '{$wpgmza_map_id}' ";
                        } else {
                            $sql_string1 .= "OR `map_id` = '{$wpgmza_map_id}' ";
                        }
                    }
                    $wpgmza_sql1 = "SELECT * FROM {$wpgmza_tblname} WHERE {$sql_string1} ORDER BY `{$order_by}` {$order_choice}";
                }
            } else {
                $wpgmza_sql1 = "SELECT * FROM {$wpgmza_tblname} WHERE `map_id` = '{$wpgmza_current_map_id}' ORDER BY `{$order_by}` {$order_choice}";
            }
            $results = $wpdb->get_results($wpgmza_sql1);
            $wpgmza_marker_list_output .= "\n                <table id=\"wpgmza_marker_list\" class=\"wpgmza_marker_list_class\" cellspacing=\"0\" cellpadding=\"0\" style='width:" . $map_width . "" . $map_width_type . "'>\n                <tbody>\n        ";
            $wpgmza_settings = get_option("WPGMZA_OTHER_SETTINGS");
            $wpgmza_image_height = $wpgmza_settings['wpgmza_settings_image_height'];
            $wpgmza_image_width = $wpgmza_settings['wpgmza_settings_image_width'];
            if (!$wpgmza_image_height || !isset($wpgmza_image_height)) {
                $wpgmza_image_height = "100";
            }
            if (!$wpgmza_image_width || !isset($wpgmza_image_width)) {
                $wpgmza_image_width = "100";
            }
            foreach ($results as $result) {
                $wmcnt++;
                $img = $result->pic;
                $wpgmaps_id = $result->id;
                $link = $result->link;
                $icon = $result->icon;
                $wpgmaps_lat = $result->lat;
                $wpgmaps_lng = $result->lng;
                $wpgmaps_address = $result->address;
                if (!$img) {
                    $pic = "";
                } else {
                    $wpgmza_use_timthumb = $wpgmza_settings['wpgmza_settings_use_timthumb'];
                    if ($wpgmza_use_timthumb == "" || !isset($wpgmza_use_timthumb)) {
                        $pic = "<img src='" . wpgmaps_get_plugin_url() . "/timthumb.php?src=" . $result->pic . "&h=" . $wpgmza_image_height . "&w=" . $wpgmza_image_width . "&zc=1' title='' alt='' style=\"\" />";
                    } else {
                        $pic = "<img src='" . $result->pic . "' class='wpgmza_map_image' style=\"float:right; margin:5px; height:" . $wpgmza_image_height . "px; width:" . $wpgmza_image_width . ".px\" />";
                    }
                }
                if (!$icon) {
                    $icon = $default_marker;
                } else {
                    $icon = "<img src='" . $result->icon . "' />";
                }
                if ($d_enabled == "1") {
                    $wpgmaps_dir_text = "<br /><a href=\"javascript:void(0);\" id=\"{$wpgmza_current_map_id}\" title=\"" . _("Get directions to", "wp-google-maps") . " " . $result->title . "\" class=\"wpgmza_gd\" wpgm_addr_field=\"" . $wpgmaps_address . "\" gps=\"{$wpgmaps_lat},{$wpgmaps_lng}\">" . __("Directions", "wp-google-maps") . "</a>";
                }
                if ($result->description) {
                    $wpgmaps_desc_text = "<br />" . $result->description . "";
                } else {
                    $wpgmaps_desc_text = "";
                }
                if ($wmcnt % 2) {
                    $oddeven = "wpgmaps_odd";
                } else {
                    $oddeven = "wpgmaps_even";
                }
                $wpgmza_marker_list_output .= "\n                <tr id=\"wpgmza_marker_" . $result->id . "\" mid=\"" . $result->id . "\" mapid=\"" . $result->map_id . "\" class=\"wpgmaps_mlist_row {$oddeven}\">\n                    <td height=\"40\" class=\"wpgmaps_mlist_marker\">" . $icon . "</td>\n                    <td class=\"wpgmaps_mlist_pic\" style=\"width:" . ($wpgmza_image_width + 20) . "px;\">{$pic}</td>\n                    <td  valign=\"top\" align=\"left\" class=\"wpgmaps_mlist_info\">\n                        <strong><a href=\"javascript:openInfoWindow({$wpgmaps_id});\" id=\"wpgmaps_marker_{$wpgmaps_id}\" title=\"" . $result->title . "\">" . $result->title . "</a></strong>\n                        {$wpgmaps_desc_text}\n                        {$wpgmaps_dir_text}\n                    </td>\n\n                </tr>";
            }
            $wpgmza_marker_list_output .= "</tbody></table>";
        } else {
            $wpgmza_marker_list_output = "";
        }
    }
    $dbox_div = "\n        <div id=\"wpgmaps_directions_edit_" . $wpgmza_current_map_id . "\" style=\"{$dbox_style}\" class=\"wpgmaps_directions_outer_div\">\n            <h2>" . __("Get Directions", "wp-google-maps") . "</h2>\n            <div id=\"wpgmaps_directions_editbox_" . $wpgmza_current_map_id . "\">\n                <table>\n                    <tr>\n                        <td>" . __("For", "wp-google-maps") . ":</td><td>\n                            <select id=\"wpgmza_dir_type_" . $wpgmza_current_map_id . "\" name=\"wpgmza_dir_type_" . $wpgmza_current_map_id . "\">\n                            <option value=\"DRIVING\" selected=\"selected\">" . __("Driving", "wp-google-maps") . "</option>\n                            <option value=\"WALKING\">" . __("Walking", "wp-google-maps") . "</option>\n                            <option value=\"BICYCLING\">" . __("Bicycling", "wp-google-maps") . "</option>\n                            </select>\n                            &nbsp;\n                            <a href=\"javascript:void(0);\" mapid=\"" . $wpgmza_current_map_id . "\" id=\"wpgmza_show_options_" . $wpgmza_current_map_id . "\" onclick=\"wpgmza_show_options(" . $wpgmza_current_map_id . ");\" style=\"font-size:10px;\">" . __("show options", "wp-google-maps") . "</a>\n                            <a href=\"javascript:void(0);\" mapid=\"" . $wpgmza_current_map_id . "\" id=\"wpgmza_hide_options_" . $wpgmza_current_map_id . "\" onclick=\"wpgmza_hide_options(" . $wpgmza_current_map_id . ");\" style=\"font-size:10px; display:none;\">" . __("hide options", "wp-google-maps") . "</a>\n                        <div style=\"display:none\" id=\"wpgmza_options_box_" . $wpgmza_current_map_id . "\">\n                            <input type=\"checkbox\" id=\"wpgmza_tolls_" . $wpgmza_current_map_id . "\" name=\"wpgmza_tolls_" . $wpgmza_current_map_id . "\" value=\"tolls\" /> " . __("Avoid Tolls", "wp-google-maps") . " <br />\n                            <input type=\"checkbox\" id=\"wpgmza_highways_" . $wpgmza_current_map_id . "\" name=\"wpgmza_highways_" . $wpgmza_current_map_id . "\" value=\"highways\" /> " . __("Avoid Highways", "wp-google-maps") . "\n                        </div>\n\n                        </td>\n                    </tr>\n                    <tr><td>" . __("From", "wp-google-maps") . ":</td><td width='90%'><input type=\"text\" value=\"\" id=\"wpgmza_input_from_" . $wpgmza_current_map_id . "\" style='width:80%' /> {$use_location_from}</td><td></td></tr>\n                    <tr><td>" . __("To", "wp-google-maps") . ":</td><td width='90%'><input type=\"text\" value=\"\" id=\"wpgmza_input_to_" . $wpgmza_current_map_id . "\" style='width:80%' /> {$use_location_to}</td><td></td></tr>\n                    <tr>\n\n                      <td>\n                        </td><td>\n                      <input onclick=\"javascript:void(0);\" class=\"wpgmaps_get_directions\" id=\"" . $wpgmza_current_map_id . "\" type=\"button\" value=\"" . __("Go", "wp-google-maps") . "\"/>\n                      </td>\n                    </tr>\n                </table>\n            </div>\n\n\n    ";
    if ($dbox_option == "5" || $dbox_option == "1" || !isset($dbox_option)) {
        if ($wpgmza_current_mashup) {
            $wpgmza_anchors = $wpgmza_mashup_ids;
        } else {
            $wpgmza_anchors = $wpgmza_current_map_id;
        }
        $ret_msg = "\n            <style>\n            .wpgmza_map img { max-width:none !important; }\n            </style>\n            " . wpgmaps_return_marker_anchors($wpgmza_anchors) . "\n            {$wpgmza_marker_filter_output}\n            <div id=\"wpgmza_map_" . $wpgmza_current_map_id . "\" class='wpgmza_map' {$map_style}>&nbsp;</div>\n            {$wpgmza_marker_list_output}\n            <div id=\"display:block; width:100%;\">\n\n                {$dbox_div}\n                    <div id=\"wpgmaps_directions_notification_" . $wpgmza_current_map_id . "\" style=\"display:none;\">" . __("Fetching directions...", "wp-google-maps") . "...</div>\n                    <div id=\"wpgmaps_directions_reset_" . $wpgmza_current_map_id . "\" style=\"display:none;\"><a href='javascript:void(0)' onclick='wpgmza_reset_directions(" . $wpgmza_current_map_id . ");' id='wpgmaps_reset_directions' title='" . __("Reset directions", "wp-google-maps") . "'>" . __("Reset directions", "wp-google-maps") . "</a></div>\n                    <div id=\"directions_panel_" . $wpgmza_current_map_id . "\"></div>\n                </div>\n            </div>\n\n        ";
    } else {
        $ret_msg = "\n            <style>\n            .wpgmza_map img { max-width:none !important; }\n            </style>\n\n            <div id=\"display:block; width:100%; overflow:auto;\">\n\n                {$dbox_div}\n                    <div id=\"wpgmaps_directions_notification_" . $wpgmza_current_map_id . "\" style=\"display:none;\">" . __("Fetching directions...", "wp-google-maps") . "...</div>\n                    <div id=\"wpgmaps_directions_reset_" . $wpgmza_current_map_id . "\" style=\"display:none;\"><a href='javascript:void(0)' onclick='wpgmza_reset_directions(" . $wpgmza_current_map_id . ");' id='wpgmaps_reset_directions' title='" . __("Reset directions", "wp-google-maps") . "'>" . __("Reset directions", "wp-google-maps") . "</a></div>\n                    <div id=\"directions_panel_" . $wpgmza_current_map_id . "\"></div>\n                </div>\n                {$wpgmza_marker_filter_output}\n            <div id=\"wpgmza_map_" . $wpgmza_current_map_id . "\" class='wpgmza_map' {$map_style}>&nbsp;</div>\n            {$wpgmza_marker_list_output}\n            </div>\n\n        ";
    }
    if (function_exists("wpgmza_register_ugm_version")) {
        $ugm_enabled = $res->ugm_enabled;
        if ($ugm_enabled == 1) {
            $ret_msg .= wpgmaps_ugm_user_form($wpgmza_current_map_id);
        }
    }
    return $ret_msg;
}