How To Play a list of songs the user has LIKEd?

alt=
Ekwe
@ekwe
10 years ago
212 posts
This is what I have been trying, but not working, is there a way to play specific ids assign by me? Thanks

{jrCore_media_player type="jrAudio_player_dark" module="jrAudio" field="audio_file" item_id="1,2,3" autoplay=true}
updated by @ekwe: 11/03/14 01:56:24AM
michael
@michael
10 years ago
7,746 posts
Use the playlist module, make a playlist.
alt=
Ekwe
@ekwe
10 years ago
212 posts
so {jrCore_media_player type="jrPlaylist_player_dark" module="jrPlaylist" item_id="1,2,3"}

Like this?
douglas
@douglas
10 years ago
2,793 posts
I think Michael is talking about using the jrPlaylist module:

https://www.jamroom.net/the-jamroom-network/networkmarket/56/user-playlists


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
alt=
Ekwe
@ekwe
10 years ago
212 posts
oh no, I am trying to do a list of songs rated 5 by a user. And play them on the audio player
douglas
@douglas
10 years ago
2,793 posts
I just stuck this in a template and it works for me... not sure if that is what your after, but it might help you figure out what you need to do to get the results your looking for.

    {capture name="song_row" assign="song_row"}
        {literal}
            {if isset($_items)}
                {jrCore_media_player type="jrAudio_player_dark" module="jrAudio" field="audio_file" items=$_items autoplay=false}
            {/if}
        {/literal}
    {/capture}
    {jrCore_list module="jrAudio" order_by="audio_rating_1_5 numerical_desc" template=$song_row}

Hope this helps! :)


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
alt=
Ekwe
@ekwe
10 years ago
212 posts
:) you're the best! it was actually for the jrLike module I meant to say. How to play tracks the user loves. Is this possible with this code above?
douglas
@douglas
10 years ago
2,793 posts
Try changing it to this:

{capture name="song_row" assign="song_row"}
        {literal}
            {if isset($_items)}
                {jrCore_media_player type="jrAudio_player_dark" module="jrAudio" field="audio_file" items=$_items autoplay=false}
            {/if}
        {/literal}
    {/capture}
    {jrCore_list module="jrAudio" order_by="audio_like_count numerical_desc" template=$song_row}



--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
alt=
Ekwe
@ekwe
10 years ago
212 posts
Ok, I tried that. It kinda worked. But randomly for everyone on the site. I need from the specific user only, so he sees it.

Here is what I have done, but I need to figure out how to pass it into the player now

{jrCore_list module="jrAction" profile_id=$_profile_id  search="action_module = jrLike" template="music_row_list.tpl" order_by="_item_id numerical_desc" pagebreak="40" page=$page_num pager=true}

This code is showing me the list of liked songs, but how do I get them all in one player now ? Thanks alot
douglas
@douglas
10 years ago
2,793 posts
Try this instead:

{capture name="song_row" assign="song_row"}
        {literal}
            {if isset($_items)}
                {jrCore_media_player type="jrAudio_player_dark" module="jrAudio" field="audio_file" items=$_items autoplay=false}
            {/if}
        {/literal}
    {/capture}
    {jrCore_list module="jrAudio" order_by="audio_like_count numerical_desc" profile_id=$_profile_id template=$song_row}



--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
alt=
Ekwe
@ekwe
10 years ago
212 posts
didn't work :(
paul
@paul
10 years ago
4,331 posts
Have just looked at your original post. Your after a dynamic playlist based on what a user has liked? Try this -
{capture name="my_liked_songs" assign="my_liked_songs"}
{literal}
    {if isset($_items)}
        {foreach from=$_items item="item"}{$item.like_item_id},{/foreach}
    {/if}
{/literal}
{/capture}
{jrCore_list module="jrLike" profile_id="181" search1="like_module = jrAudio" search2="like_action = like" order_by="_item_id NUMERICAL_DESC" template=$my_liked_songs assign="mls"}
{jrCore_list module="jrAudio" search="_item_id IN `$mls`" template="null" assign="_my_liked_songs"}
{jrCore_media_player type="jrAudio_player_dark" module="jrAudio" field="audio_file" items=$_my_liked_songs autoplay=true}
hth
Pa


--
Paul Asher - JR Developer and System Import Specialist
paul
@paul
10 years ago
4,331 posts
Just realised I've gone round the houses a bit with the above code. Try this instead -

    {jrCore_list module="jrAudio" order_by="audio_like_count NUMERICAL_DESC" template="null" assign="_likes" limit=$_conf.paMotaNova_default_pagebreak}
    {jrCore_media_player type="jrAudio_player_dark" module="jrAudio" field="audio_file" items=$_likes autoplay=true}
In fact, I liked this idea so much I've just implemented it here -
http://motagator.com - click on the 'most liked' link


--
Paul Asher - JR Developer and System Import Specialist
alt=
Ekwe
@ekwe
10 years ago
212 posts
:) Nicenesssssss! Genius! Just saw it, so how do I get what a specific user now likes? Should I just put in the $profile_id variable in it ?
brian
@brian
10 years ago
10,148 posts
Ekwe:
:) Nicenesssssss! Genius! Just saw it, so how do I get what a specific user now likes? Should I just put in the $profile_id variable in it ?

add:

search1="_user_id = #"

Where # is the user's ID.

Hope this helps!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
paul
@paul
10 years ago
4,331 posts
To get what a specific user has liked you're going to have to use my initial code above. Put Brian's search parameter in the first jrCore_list.


--
Paul Asher - JR Developer and System Import Specialist
gary.moncrieff
gary.moncrieff
@garymoncrieff
10 years ago
865 posts
Not to butt in, but I think he wants it to be dynamic so having a static call to a specific ID won't help him in this instance I believe.

The search parameter would need to equal the profile id currently being viewed by the user. And since a user can have multiple profiles, will searching against the user id account for this?

Sorry if I am completely wrong here.
alt=
WizzBay
@wizzbay
10 years ago
4 posts
Ekwe:
This is what I have been trying, but not working, is there a way to play specific ids assign by me? Thanks

{jrCore_media_player type="jrAudio_player_dark" module="jrAudio" field="audio_file" item_id="1,2,3" autoplay=true}

How can we integrate this feature please help.
michael
@michael
10 years ago
7,746 posts
gary.moncrieff:
Not to butt in, but I think he wants it to be dynamic so having a static call to a specific ID won't help him in this instance I believe.

The search parameter would need to equal the profile id currently being viewed by the user. And since a user can have multiple profiles, will searching against the user id account for this?

Sorry if I am completely wrong here.

Its not butting in if your trying to help. Its appreciated.

$_user is the user looking at the screen and its available pretty much everywhere. use {debug} to check though.

"{degbug}"
http://www.jamroom.net/the-jamroom-network/documentation/development/1477/debug


So where the # is you could use $_user._user_id for the current user looking at the screen.

Tags