<h2>Get the word out!</h2> <p>While you are waiting for it to download why not let people know about <?php release_title(); ?> ?</p> <p>It's one of the only ways we get the word out, so we'd really appreciate it.</p> <p><a href="<?php release_twitter_promotional_tweet(); ?> " target="_blank">Tweet Now On Twitter</a></p> <p><a href="<?php release_facebook_share_link(); ?> " target="_blank">Share Now On Facebook</a></p> <?php if (artist_has_twitter()) { ?> <h2>Follow <?php artist_name(); ?> on Twitter</h2> <p>Find out what <?php artist_name(); ?> is up to on Twitter.</p> <p> <a href="https://twitter.com/intent/user?screen_name=<?php artist_twitter_user_name(); ?> " target="_blank">Follow Now</a> </p>
/** * Creates a Twitter intent URL for tweeting about downloading a specific release. * * @author Alex Andrews <*****@*****.**> * @param bool $echo When true we echo the link to the MP3 download. * @return string The Twitter URL that pre-sets the tweet we are encouraging. */ function release_twitter_promotional_tweet($echo = true) { $artist = ''; if (artist_has_twitter()) { $artist = '@' . artist_twitter_user_name(false); } else { $artist = artist_name(false); } $release_link = release_download_short_link(false); if (!$release_link) { $release_link = release_download_link(false); } $stream_link = release_stream_short_link(false); if (!$stream_link) { $stream_link = release_soundcloud_url(false); } $tweet = urlencode('I just downloaded ' . release_title(false) . ' by ' . $artist . ' at @recordsonribs - Download now ' . $release_link . ', listen now ' . $stream_link); $url = 'https://twitter.com/intent/tweet?text=' . $tweet; if ($echo) { echo $url; } return $url; }