Support » Plugin: Trackserver » GPS-Download-Link

  • Resolved SamuelFernandez

    (@samuelfernandez)


    I would like to make individual tours available for download. How can I make this available to visitors?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author tinuzz

    (@tinuzz)

    Use the [tslink] shortcode.

    Parameter descriptions and some examples are here:
    https://github.com/tinuzz/wp-plugin-trackserver

    Search for ‘tslink’ on the page.

    Thread Starter SamuelFernandez

    (@samuelfernandez)

    Thanks for the fast response…

    Is there a way to use a link? So no shortcode?

    At the moment this is just a link. The problem is when I want to use a button.

    Plugin Author tinuzz

    (@tinuzz)

    Ah, so you need the ‘href’ value part only, without the HTML tag…

    Trackserver doesn’t support that right now, but it would be quite easy to add:

    Find the function ‘handle_shortcode3’, in either class-trackserver-shortcode.php or class-trackserver.php (the structure of Trackserver’s code has changed a bit since the last official release).

    At the top of the function, add this to the $defaults array:

    'href_only' => false,

    Then, near the bottom of the function change this line:

    $out = '<a href="' . $alltracks_url . '" ' . $class_str . '>' . htmlspecialchars( $text ) . '</a>';

    to

          if ( $atts['href_only'] === false ) {
            $out = '<a href="' . $alltracks_url . '" ' . $class_str . '>' . htmlspecialchars( $text ) . '</a>';
          } else {
            $out = $alltracks_url;
          }
    

    Then, you can use

    [tslink id=... href_only=y]

    to generate the URL.

    If you use PHP code (template?) to render the button, you can get the link like this:

    $url = do_shortcode( '[tslink id=... href_only=y]' )

    I haven’t tested the latter, though. I think it should work.

    I’ll include the ‘href_only’ shortcode attribute in the next release.

    Does this help?

    Plugin Author tinuzz

    (@tinuzz)

    The change described above will be part of the next release.

    Closing due to inactivity.

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.