diff options
Diffstat (limited to 'site/app/views/addons/share.thtml')
-rw-r--r-- | site/app/views/addons/share.thtml | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/site/app/views/addons/share.thtml b/site/app/views/addons/share.thtml new file mode 100644 index 0000000..9cfad8d --- /dev/null +++ b/site/app/views/addons/share.thtml @@ -0,0 +1,24 @@ +<?php + + $url = FULL_BASE_URL . $html->url("/addon/{$addon_id}"); + + $description = $html->truncateChars(250, $description); + + $title = $share_title; + + // Grab the URL template for the link sharing service and fill in the + // placeholders with the strings composed above. + $link_data = compact('url', 'title', 'description'); + foreach ($link_data as $name => $value) { + $service_url = str_replace( + '{'.strtoupper($name).'}', + rawurlencode($value), + $service_url + ); + } + + // Finally, bounce the user off to the populated sharing URL. + header('HTTP/1.1 302 Found'); + header('Location: ' . $service_url); + exit; +?> |