0
I read a thread on the forum where someone ask how to have a playlist automatically loaded in the player when a site was visited. Germi showed how to change the playlist_id from 0 to the one you wanted pre-loaded.
This got me thinking it would be nice to have a random playlist available each time someone visited...so I put together a small bit of code to do that. I have attached a file with instructions for inserting it into the proper module.
After it is inserted, you only need make a playlist titled Random and each time the site is visited, it will be changed.
Remember to always first back-up any file before you make modifications.
Enjoy - David [file name=randomcodeformc-20100204.txt size=2928]http://joomlamusicsolutions.com/images/fbfiles/files/randomcodeformc-20100204.txt[/file]
This got me thinking it would be nice to have a random playlist available each time someone visited...so I put together a small bit of code to do that. I have attached a file with instructions for inserting it into the proper module.
After it is inserted, you only need make a playlist titled Random and each time the site is visited, it will be changed.
Remember to always first back-up any file before you make modifications.
Enjoy - David [file name=randomcodeformc-20100204.txt size=2928]http://joomlamusicsolutions.com/images/fbfiles/files/randomcodeformc-20100204.txt[/file]
Responses (8)
-
Accepted Answer
-
Accepted Answer
-
Accepted Answer
0g0g0 -
I just checked the code in the file listed above and all is there. Check that you placed the functions in the correct location. Go back to the file and insure you place the two new functions getRandomPlaylistID and setRandomPlaylist($rID) inside of the class modMusColJWplayerHelper.
The function getRandomPlaylistID should be located around line 23.
David -
Accepted Answer
0it's my helper and don't works,
please, do you see this ?
Thank you [file name=helper.txt size=10894]http://www.joomlamusicsolutions.com/images/fbfiles/files/helper.txt[/file] -
Accepted Answer
0I just downloaded your helper.php and used it in place of mine and all works well. I tried in both FF and IE8, When I refreshed the page a new set of songs shows in the player.
Also, when I use the popup and go to playlists and select various playlists, when I come back to the Random one it reloads a new random playlist.
The only difference I noticed in yours is that you also replaced the $playlist_id == ""... code in the getPopupPlayer function. I did not say to do that in my file as I had tested that and found if you then restore the popup player, a different set of songs shows in the restored player. I took that out of my version.
So, I am not sure what may be happening in your environment.
Sorry I can not be of more help.
David -
Accepted Answer
-
Accepted Answer
Your Reply
Please login to post a reply
You will need to be logged in to be able to post a reply. Login using the form on the right or register an account if you are new here.
Register Here »