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]
Attachments:
Responses (8)
  • Accepted Answer

    Sunday, February 21 2010, 01:43 AM - #Permalink
    0
    Hello, I love what you offer, did you adjust to the new version?
    The reply is currently minimized Show
  • Accepted Answer

    Sunday, February 21 2010, 02:47 AM - #Permalink
    0
    It works fine in the new version. I am running the new version with the above code and it works great.

    David
    The reply is currently minimized Show
  • Accepted Answer

    Sunday, February 21 2010, 01:54 PM - #Permalink
    0
    could you send your helper.php

    Unfortunately I can not properly amended mine
    Fatal error: Call to undefined method modMusColJWplayerHelper::getRandomPlaylistID() in .../modules/mod_muscol_jwplayer/helper.php on line 109
    The reply is currently minimized Show
  • Accepted Answer

    Sunday, February 21 2010, 02:17 PM - #Permalink
    0
    g0g0 -

    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
    The reply is currently minimized Show
  • Accepted Answer

    Sunday, February 21 2010, 04:41 PM - #Permalink
    0
    it'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]
    Attachments:
    The reply is currently minimized Show
  • Accepted Answer

    Sunday, February 21 2010, 05:48 PM - #Permalink
    0
    I 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
    The reply is currently minimized Show
  • Accepted Answer

    Monday, February 22 2010, 04:32 PM - #Permalink
    0
    Thank you very much,

    I'll get a little more on my side, maybe because I'm not yet 20 album
    The reply is currently minimized Show
  • Accepted Answer

    Monday, February 22 2010, 05:37 PM - #Permalink
    0
    I had not considered that. Let me look and see if that could cause a problem.

    Thanks for pointing that out! :)
    The reply is currently minimized Show
Your Reply