[Solved] How to Add a Download Button for a free song?

CAPER
CAPER
@caper
11 years ago
125 posts
How can I add a free download button in the charts and other areas of my site for free songs. The profiles have the button just not in certain areas.
updated by @caper: 01/30/14 07:28:45PM
CAPER
CAPER
@caper
11 years ago
125 posts
for example list_audio.tpl
douglas
@douglas
11 years ago
2,793 posts
Which skin are you using?


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
CAPER
CAPER
@caper
11 years ago
125 posts
im using mskin 5
michael
@michael
11 years ago
7,746 posts
The button code will look something like this:

{jrCore_module_url module="jrAudio" assign="murl"}

<a href="{$jamroom_url}/{$murl}/download/audio_file/{$item._item_id}">{jrCore_icon icon="download"}</a><br>

updated by @michael: 12/29/13 09:45:51PM
CAPER
CAPER
@caper
11 years ago
125 posts
That worked perfectly is there a way to only show it for free downloads only and only for songs that were already purchased?
CAPER
CAPER
@caper
11 years ago
125 posts
Also when you click on the download button and it shows the message that it needs to be purchased would there be a way to make it a pop up instead of going to a white page to show that message?
SteveX
SteveX
@ultrajam
11 years ago
2,584 posts
You can check for free downloads by checking if there is a song price.

For songs that have already been purchased, you'd need to check the purchase history for the viewing user and if the song has been purchased send the user to their My Files. This would be a lot of work for the server to check on every show of every song in every list for every visitor, so probably best to avoid doing it.

You can use an onclick to show a popup. If you are using a core page button the onclick will be the third parameter.
Or in a link
onclick="if(confirm('Are you sure you want to download this? ')){ window.location='{$jamroom_url}/{$murl}/download/audio_file/{$item._item_id}' }"
But as with the check for songs that have already been purchased, you will need to look up that information for every user and every song just to show a list of songs. So I'd say it would be better to check after the confused user has accidentally clicked to try to buy the same song again rather than checking every song for every user before displaying your list of songs just in case a user gets confused and tries to buy the same song again.


--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)
CAPER
CAPER
@caper
11 years ago
125 posts
Thank You

Tags