Beispiel #1
0
function wpgmza_return_marker_path()
{
    $file = get_option("wpgmza_xml_location");
    $content_dir = WP_CONTENT_DIR;
    $content_dir = trim($content_dir, '/');
    if (defined('WP_PLUGIN_DIR')) {
        $plugin_dir = str_replace(wpgmza_get_document_root(), '', WP_PLUGIN_DIR);
        $plugin_dir = trim($plugin_dir, '/');
    } else {
        $plugin_dir = str_replace(wpgmza_get_document_root(), '', WP_CONTENT_DIR . '/plugins');
        $plugin_dir = trim($plugin_dir, '/');
    }
    $upload_dir = wp_upload_dir();
    $upload_dir = $upload_dir['basedir'];
    $upload_dir = rtrim($upload_dir, '/');
    $file = str_replace('{wp_content_dir}', $content_dir, $file);
    $file = str_replace('{plugins_dir}', $plugin_dir, $file);
    $file = str_replace('{uploads_dir}', $upload_dir, $file);
    $file = trim($file);
    if (empty($file)) {
        $file = $upload_dir . "/wp-google-maps/";
    }
    /* 6.0.32 - checked for beginning slash, but not on local host */
    if (isset($_SERVER['SERVER_ADDR']) && $_SERVER['SERVER_ADDR'] == "127.0.0.1" || isset($_SERVER['LOCAL_ADDR']) && $_SERVER['LOCAL_ADDR'] == "127.0.0.1") {
    } else {
        if (substr($file, 0, 1) != "/") {
            $file = "/" . $file;
        }
    }
    /* 6.0.32 - check if its just returning 'wp-content/...' */
    if (substr($file, 0, 10) == "wp-content") {
        $file = wpgmza_get_site_root() . "/" . $file;
    }
    if (substr($file, -1) != "/") {
        $file = $file . "/";
    }
    return $file;
}
function wpgmza_return_marker_path()
{
    $file = get_option("wpgmza_xml_location");
    $content_dir = WP_CONTENT_DIR;
    $content_dir = trim($content_dir, '/');
    if (defined('WP_PLUGIN_DIR')) {
        $plugin_dir = str_replace(wpgmza_get_document_root(), '', WP_PLUGIN_DIR);
        $plugin_dir = trim($plugin_dir, '/');
    } else {
        $plugin_dir = str_replace(wpgmza_get_document_root(), '', WP_CONTENT_DIR . '/plugins');
        $plugin_dir = trim($plugin_dir, '/');
    }
    $upload_dir = wp_upload_dir();
    $upload_dir = $upload_dir['basedir'];
    $upload_dir = rtrim($upload_dir, '/');
    $file = str_replace('{wp_content_dir}', $content_dir, $file);
    $file = str_replace('{plugins_dir}', $plugin_dir, $file);
    $file = str_replace('{uploads_dir}', $upload_dir, $file);
    $file = trim($file);
    if (empty($file)) {
        $file = $upload_dir . "/wp-google-maps/";
    }
    if (substr($file, -1) != "/") {
        $file = $file . "/";
    }
    return $file;
}