solved Aparna Module with Downloadable Audio

MAD
MAD
@madc
10 years ago
600 posts
Can't get this to work.
I created a module which has an upload field which works fine on the site and they all play in the player.

But if we try and download the podcasts from this page
https://www.punkbandpromotions.com/loud-fast-shitty/loud-fast-shitty-radio
the url's are wrong
eg https://www.punkbandpromotions.com/loud-fast-shitty-radio/download/audio_file/64

If I click on that it goes to a white page and says
Error: Invalid media id - no media item found

my code for that page

{ jrCore_module_url module= "prLoudFastShitty" assign= "murl" } 
{ if isset( $_items ) }
    { foreach from=$_items item=" item " }
        < div class=" item " >

            < div class=" block_config " >
                < div class=" add_to_cart_section " title=" Free Download " >
                < span class=" add_to_cart_price " >Free< /span >


            { if $ _conf.jrAudio_block_download == ' off'  && ( empty( $ item.audio_file_item_price ) || $ item.audio_file_item_price == ' 0 ' ) }
                { if jrUser_is_logged_in () }
                      < a href=" {$ jamroom_url} / {$ murl } / download / audio_file /{ $ item._item_id } " > { jrCore_icon icon= " download " }< /a >
                { else }
                < a href= " {$jamroom_url } / user / login " title = " Log in to Download " > { jrCore_icon icon =" download " } < /a >
                 { /if }
             { /if }


                < /div >
                 {jrCore_item_list_buttons module =" prLoudFastShitty " item= $item }
            < /div >

             < h2 > < a href=" { $ jamroom_url } / { $ item.profile_ur l} / { $ murl } / { $ item._item_id } / { $ item.loudfastshitty_title_url } " >{ $ item.loudfastshitty_title } < /a >< /h2 >
            < br >
        < /div >

    { /foreach }
{ /if }

its this bit that seems to be the problem

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

They exist and are playing. How do I get them to be able to be downloadable ?

ps: Code edited to be viewable here



--
~ https://punkbandpromotions.com ~
Check us out for all your Punk/Alternative Music!
Check us out on Facebook:- https://facebook.com/PunkBandPromotion

updated by @madc: 05/01/14 06:14:30PM
brian
@brian
10 years ago
10,148 posts
You don't want to use "audio_file" as the field - that's going to be specific to the jrAudio module - it needs to be the name of the file field that you specified on the file upload form (i.e. the form field name).

Let me know if that helps.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
MAD
MAD
@madc
10 years ago
600 posts
Thanks @brian ( again and again and again .... you guys are right onto this sh$*! :)
I added

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


which worked.
Is that anywhere in the docs BTW?
I never would have worked that one out ie. putting the field after the download section in the url


--
~ https://punkbandpromotions.com ~
Check us out for all your Punk/Alternative Music!
Check us out on Facebook:- https://facebook.com/PunkBandPromotion

updated by @madc: 03/30/14 10:07:35AM
brian
@brian
10 years ago
10,148 posts
that's a good question - I will check that out and see if we need to add something in. The download/stream URL is basically in the format:

module/(download|stream)/field_name/item_id

It's the same for all modules.

Hope this helps!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net

updated by @brian: 03/30/14 11:01:35AM
MAD
MAD
@madc
10 years ago
600 posts
Ok I have added another radio station using the same module
but the item_list is as the above
I need it to call in another field from the module

My code that works but doubles up on the download buttons

            <div class="block_config">
                <div class="add_to_cart_section" title="Free Download">
                <span class="add_to_cart_price">Free</span>


            {if $_conf.jrAudio_block_download == 'off' && (empty($item.audio_file_item_price) || $item.audio_file_item_price == '0')}
                {if jrUser_is_logged_in()}
                      <a href="{$jamroom_url}/{$murl}/download/loudfastshitty_podcast/{$item._item_id}">{jrCore_icon icon="download"}</a>
<a href="{$jamroom_url}/{$murl}/download/loudfastshitty_sick_boy_radio_podcast/{$item._item_id}">{jrCore_icon icon="download"}</a>
                {else}
                <a href="{$jamroom_url}/user/login" title="Log in to Download">{jrCore_icon icon="download"}</a>
                {/if}
             {/if}

                </div>
                {jrCore_item_list_buttons module="prLoudFastShitty" item=$item}
            </div>

What would I need to add to make it one button that works on their podcast page?
At the moment it is bringing in 2 download buttons. One works loudfastshitty_sick_boy_radio_podcast
the other works as well on the other page

the first profile quota is #5 ( lfs podcast )
second is #9 ( sick boys radio podcast )

I tried adding some if statements but that just broke the page

Cheers!!


--
~ https://punkbandpromotions.com ~
Check us out for all your Punk/Alternative Music!
Check us out on Facebook:- https://facebook.com/PunkBandPromotion

updated by @madc: 03/31/14 08:17:58AM
brian
@brian
10 years ago
10,148 posts
Yeah you want to use an if statement - something like this should work:

{if $item.profile_quota_id == 5}
    <a href="{$jamroom_url}/{$murl}/download/loudfastshitty_podcast/{$item._item_id}">{jrCore_icon icon="download"}</a>
{else}
    <a href="{$jamroom_url}/{$murl}/download/loudfastshitty_sick_boy_radio_podcast/{$item._item_id}">{jrCore_icon icon="download"}</a>
{/if}

Let me know if that works.

Hope this helps!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
MAD
MAD
@madc
10 years ago
600 posts
Mate, Sorry if I am talking out of line here
But you answered that question within 4 minutes and solved my problem>????
You got me on speed dial haven't you.

Worked a treat!!!
Getting down to the last of it now thank god
Want to concentrate on promotions and not BUILDNG SITES lol

/...........................\
Cheers @brian.
AMAZING SUPPORT!
\............................/

You can screenshot that for vanities sake :P


--
~ https://punkbandpromotions.com ~
Check us out for all your Punk/Alternative Music!
Check us out on Facebook:- https://facebook.com/PunkBandPromotion

updated by @madc: 03/31/14 08:16:13AM
brian
@brian
10 years ago
10,148 posts
Lol - you caught me at a good time - I'm hacking away right now and just checking in about every 15 - 20 mins, so glad I could answer it quick.

Thanks!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
MAD
MAD
@madc
10 years ago
600 posts
Sorry but I have another problem.
I have two quotas using the same aparna module ( eg Podcasts )

When I want to pull in a playlist into their player on their pages it breaks one or the other depending on what was last created.
I have brought it down to this

{* PODCASTS *}
                    <h3>Sick Boys Radio Podcasts</h3><br>
{jrCore_list module="prLoudFastShitty" field="loudfastshitty_sick_boy_radio_podcast" template="profile_sbr_podcasts.tpl" order_by="_created desc" autoplay=false limit=5}

If i remove this
order_by="_created desc"
then they both work depending on which one was added last
BUT the order is not descending

This is my other profiles code

{* LFS PODCASTS *}
                    <h3>Loud Fast Shitty Podcasts</h3><br>
{jrCore_list module="prLoudFastShitty" field="loudfastshitty_podcast" template="profile_loudfastshitty_podcasts.tpl" order_by="_created desc" autoplay=false limit=5}

and their respective templates

{if isset($_items)}
    {jrCore_media_player type="jrAudio_player_dark" module="prLoudFastShitty" field="loudfastshitty_sick_boy_radio_podcast" items=$_items} 
{/if}

and

{if isset($_items)}
    {jrCore_media_player type="jrAudio_player_dark" module="prLoudFastShitty" field="loudfastshitty_podcast" items=$_items} 
{/if}

So it seams as though it is using the modules last created additions rather than the fields last created

Any ideas anyone?

links
https://www.punkbandpromotions.com/loud-fast-shitty/podcasts
https://www.punkbandpromotions.com/sick-boys-radio/podcasts
( turn your volume down or turn off the players )

As you can see right now the Sick Boys Radio player on the left is broken but was working before we added 5 more at loud fast sh!tty pages
And vice versa

Screen shot of my form designer



--
~ https://punkbandpromotions.com ~
Check us out for all your Punk/Alternative Music!
Check us out on Facebook:- https://facebook.com/PunkBandPromotion

updated by @madc: 04/01/14 01:43:11AM
MAD
MAD
@madc
10 years ago
600 posts
@michael the legend strikes again.
He helped my in IRC
the problem was my code
I added something like this to my tpl files ( both different of course as they used 2 different fields )

{jrCore_list module="prLoudFastShitty" search="loudfastshitty_sick_boy_radio_podcast_size > 0" template="profile_sbr_podcasts.tpl" order_by="_created desc" autoplay=false limit=5}

This was the important change
search="loudfastshitty_sick_boy_radio_podcast_size > 0" 
Thanks @michael. You sir a legend!
Too many legends around here!


--
~ https://punkbandpromotions.com ~
Check us out for all your Punk/Alternative Music!
Check us out on Facebook:- https://facebook.com/PunkBandPromotion

Tags