Viewing 5 replies - 16 through 20 (of 20 total)
  • Thread Starter landwire

    (@landwire)

    I have gone down the direct DB route using and rewriting the code from the API
    and it works fine. Just made into a small plugin to sit on top of maps markers. Thanks for all your help!

    Thread Starter landwire

    (@landwire)

    Just changed ticket to not resolved in the hope you see this….
    FYI: all code in leaflet-api.php (line 600-635 roughly)

    I am not sure if those below are copy and paste mistakes or intentional or mistakes at all! I am not a great coder and just getting started with many things…

    Should first and second $_GET be $_POST?

    $createdon = isset($_POST['createdon']) && ( $_GET['createdon'] == date('Y-m-d H:i:s',strtotime($_GET['createdon'])) ) ? $_POST['createdon'] : (isset($_GET['createdon']) && ( $_GET['createdon'] == date('Y-m-d H:i:s',strtotime($_GET['createdon'])) ) ? $_GET['createdon'] : current_time('mysql',0));

    also here use of [‘createdon’] and $_GET

    $updatedon = isset($_POST['updatedon']) && ( $_GET['createdon'] == date('Y-m-d H:i:s',strtotime($_GET['createdon'])) ) ? $_POST['updatedon'] : (isset($_GET['updatedon']) && ( $_GET['createdon'] == date('Y-m-d H:i:s',strtotime($_GET['createdon'])) ) ? $_GET['updatedon'] : current_time('mysql',0));

    And I do not understand the $query_view['kml_timestamp'] variable which only exists in this place in your whole plugin files. Could that be a mistake too?

    $_GET['kml_timestamp']) && ( $_GET['kml_timestamp'] == date('Y-m-d H:i:s',strtotime($_GET['kml_timestamp'])) ) ? $_GET['kml_timestamp'] : $query_view['kml_timestamp']);
    Plugin Author Robert Seyfriedsberger

    (@harmr)

    Hi Sascha,

    regarding how to call the API without a form (even though you already found a solution):
    —————————————————–
    if your server supports curl (which is normally the case), the examples you linked would also work with the MapsMarker API.
    I’d basically prefer file_get_contents as listed in the example as this also can deal with both json and xml:
    $response = file_get_contents(‘https://your-domain/wp-content/plugins/leaflet-maps-marker-pro/leaflet-api.php?key=xxx&signature=xxx&expires=xxxx&action=add&type=marker&markername=Headquarters&geocode=Main Street 1 Washington’);
    if $response is JSON, use json_decode to turn it into php array:
    $response = json_decode($response);
    if $response is XML, use simple_xml class:
    $response = new SimpleXMLElement($response);
    Will add a 2do on my list to update the faqs

    Anyway I`d be interested in having a look at your custom plugin if possible….
    ——————————————————-
    regarding leaflet-api.php: thanks for noticing, these are definitely a bugs. I already fixed them and updated the current free+pro releases – so please re-download the package manually and overwrite leaflet-api.php on your server.

    best,

    Robert

    Thread Starter landwire

    (@landwire)

    Robert,
    have sent you an email with plugin file.
    Sascha

    Plugin Author Robert Seyfriedsberger

    (@harmr)

    thx

Viewing 5 replies - 16 through 20 (of 20 total)
  • The topic ‘Creating a marker by function or by any code?’ is closed to new replies.