{ Dev Farm }

Web & Windows Development

[How-To] Use wp-gpx-maps on a non-wordpress website

Home Forum Wp Gpx Maps Stand-alone [How-To] Use wp-gpx-maps on a non-wordpress website

Questo argomento contiene 6 risposte, ha 2 partecipanti, ed è stato aggiornato da  Paul 2 anni fa.

Stai vedendo 7 articoli - dal 1 a 7 (di 7 totali)
  • Autore
    Articoli
  • #3059 Risposta

    max
    Amministratore del forum

    The sample below show how to use wp-gpx-maps wordpress plugin outside wordpress.

    – Get latest plugin version: http://wordpress.org/extend/plugins/wp-gpx-maps/
    – unzip and place the plugin files
    – set the variables $uploadDir, $uploadUrl, $pluginDir, $gpxUrl
    – done!

    If you want a better code optimization you can directly edit the plugin files!

    N.B. Obviously NextGEN Gallery integration in not working and it throws exceptions!

    demo: http://www.pedemontanadelgrappa.it/wp-gpx-maps-stand-alone.php

    <?php
    
    $uploadDir = "/www.pedemontanadelgrappa.it/wp-content/uploads"; // Must be writable. The plugin will create the /gpx and /gpx/~cache subfolders
    $uploadUrl = "http://www.pedemontanadelgrappa.it/wp-content/uploads/gpx/"; // gpx download path
    $pluginDir = "wp-content/plugins/wp-gpx-maps/"; // wordpress plugin path
    $gpxUrl = "/wp-content/uploads/gpx/activity_108739907-1.gpx"; // your gpx file
    
    /* wordpress function wrapper */
    function load_plugin_textdomain(){}
    function is_admin() {return false;}
    function add_action(){}
    function add_shortcode(){}
    function register_activation_hook(){}
    function register_deactivation_hook(){}
    function add_filter(){}
    function get_option(){return "";}
    function wp_upload_dir(){return Array ( "basedir" => $uploadDir ); }
    function plugins_url(){return $uploadUrl ;}
    function __($val){return $val;}
    
    include $pluginDir.'wp-gpx-maps.php';
    ?>
    <!DOCTYPE html>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>WP GPX Maps - standalone</title>
    <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
    <script src="https://maps.googleapis.com/maps/api/js?sensor=false&v=3.9" type="text/javascript" ></script>
    <script src="http://code.highcharts.com/highcharts.js" type="text/javascript" ></script>
    <script src="<?php echo $pluginDir; ?>WP-GPX-Maps.js" type="text/javascript" ></script>
    <style type="text/css" media="screen">
    <?php
    echo print_WP_GPX_Maps_styles();
    ?>
    </style>
    </head>
    <body>
    <?php
    
    /*
    plugin call with all the possible settings
    more info here: http://wordpress.org/extend/plugins/wp-gpx-maps/faq/
    */
    
    echo handle_WP_GPX_Maps_Shortcodes( Array (
    "gpx"=> $gpxUrl,
    "width"=> "100%",
    "mheight"=> "450px",
    "mtype"=>"HYBRID",
    "gheight"=> "200px",
    "showcad"=>false,
    "showhr"=> false,
    "waypoints"=> false,
    "showspeed"=> false,
    "showgrade"=> false,
    "zoomonscrollwheel"=> false,
    "donotreducegpx"=> false,
    "pointsoffset"=> 10,
    "uom"=>"0",
    "uomspeed"=>"0",
    "mlinecolor"=>"#3366cc",
    "glinecolor"=>"#3366cc",
    "glinecolorspeed"=>"#ff0000",
    "glinecolorhr"=>"#ff77bd",
    "glinecolorcad"=>"#beecff",
    "glinecolorgrade"=>"#beecff",
    "chartfrom1"=>"",
    "chartto1"=>"",
    "chartfrom2"=>"",
    "chartto2"=> "",
    "starticon"=> "",
    "endicon"=> "",
    "currenticon"=> "",
    "waypointicon"=> "",
    "nggalleries"=> "",
    "ngimages"=>"",
    "download"=> "",
    "dtoffset"=> 0,
    "skipcache"=> "",
    "summary"=> "",
    "summarytotlen"=> false,
    "summarymaxele"=> false,
    "summaryminele"=> false,
    "summaryeleup"=>false,
    "summaryeledown"=> false,
    "summaryavgspeed"=> false,
    "summarytotaltime"=>false,
    ) );
    
    ?>
    
    </body>
    </html>

    #21620 Risposta

    Belat

    Hi,

    I’m interested using the plugin outside WP. I copied the code above and replaced the directories but the page is empty, even the scripts are not loaded. Could you please explain how to use the files without a CMS, just for a single GPX file in a bit more detail?

    Thanks,
    Be

    #21655 Risposta

    max
    Amministratore del forum

    Hi, this is a working sample, just unzip the folder and everything should work

    #23525 Risposta

    Dener Fernandes

    Hi,

    This code non-wordpress was exactly what I was looking for, just unable to display the Heart rate, values ​​comes zeroed, on wordpress is shown, but the plug-in non-wordpress not. What can it be?

    My GPX: http://www.personalon.com.br/activity_398049934.gpx

    On wordpress: http://personalon.com.br/blog/nutricao/teste/

    Could you please help me?

    Att;

    :good:

    #23527 Risposta

    max
    Amministratore del forum

    You should set the variable

    echo handle_WP_GPX_Maps_Shortcodes( Array (
    “gpx”=> $gpxUrl,
    “width”=> “100%”,
    “mheight”=> “450px”,
    “mtype”=>”HYBRID”,
    “gheight”=> “200px”,
    “showcad”=>false,
    “showhr”=> true,
    “waypoints”=> false,

    #24710 Risposta

    Paul

    Hi Max!

    Thank you very much! That’s exactly what I need for my website. But since I a couple of comments.

    How do I get a message for updates?

    I use the pages so created as an iFrame into my website. It would be nice if the full screen function would work out of the iframe out. So they will only work within the iframes.

    When activating the scroll-zoom must be “true” to be quoted.

    The text of the numbers of elevations in Altidue graphics are unfortunately obscured. Can this be fixed?

    #24711 Risposta

    Paul

    Ok, i have find it yourself.
    http://api.highcharts.com/highcharts#xAxis.labels.x
    in the javascript file ->
    #####
    var yaxe = {
    title: { text: null },
    labels: {
    align: ‘left’,
    // START EDIT
    x: 0,
    // END EDIT
    formatter: function() {
    return Highcharts.numberFormat(this.value, l_y.dec,decPoint,thousandsSep) + l_y.suf;
    }
    }
    }
    ######

    Another Question: Is it possible to operate the plugin complete without Google? Or is Google an integral part?

Stai vedendo 7 articoli - dal 1 a 7 (di 7 totali)
Rispondi a: [How-To] Use wp-gpx-maps on a non-wordpress website

You can use BBCodes to format your content.
Your account can't use Advanced BBCodes, they will be stripped before saving.

Le tue informazioni:




:bye:  :good:  :negative:  :scratch:  :wacko:  :yahoo:  B-) 
more...
 

Non è possibile lasciare nuovi commenti.