Jamroom Logo Jamroom 5 Core
is now Open Source!
User Support Forum Archive (Read Only)
User Site Design, Integration and Customization:
Ranking and Chart outputs as XSPF playlists
cmaguire



Joined: 22 Apr 2004
Posts: 705

Posted: 06/28/06 13:20 
I would like to know how to do the following playlists:

* Play 100 songs from a specific Quota ID
* Play Todays Top 100 most played songs
* Play 100 Newest Songs
* Play 100 Random Songs

If anyone can help me with how I would go about creating the XSPF playlists for these it would be much appreciated.

Thanks

Chris


_________________
Altsounds.com - Alternative Music online
Altsounds.FM - The Future Of Internet Radio!
Back to top
blindmime



Joined: 07 Mar 2004
Posts: 1107

Posted: 06/29/06 07:01 
Dynamic playlists are one of my favorite things about jamroom. You can put any playlist that jamroom can generate into the flash player, including dynamic newchart, ranking, and newsearch playlists, which means your options are unlimited.

Here's how:

First, create "playall" header tpl files for each of three scripts and put those files in their respective directories. The header tpl files consist of one line of code.

For ranking:

Code

{$PLAYPAGE_HIFI_MP3_URL}


For newchart:

Code

{$PLAYALL_HIFI_MP3_URL}


For newsearch:

Code

{$PLAYPAGE_HIFI_MP3}


You might name each of them xspf_header.tpl.

Here is the flash player object code. It's slightly different than the object code floating around here. I've created it so playlists can easily be made by changing one bit of code:


Code

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0"
width="450" height="170" >

<?php

ob_start();
include_once( 'YOUR PLAYLIST URL' );
$urlvalue = ob_get_contents();
ob_end_clean();
$urlvalueencoded = urlencode($urlvalue);
$finalvalue = str_replace( "%26amp%3B", "%26", $urlvalueencoded );
$finalvalue2 = str_replace( "%0A%0A", "", $finalvalue );

?>

<param name="movie"
value="http://yourdomain.com/jamroom/include/flash/xspf_player.swf?playlist_url=<?php echo $finalvalue2; ?>%26type%3Dxspf&autoload=true&info_button_text=Visit+Us"/>

<param name="quality" value="high"/>
<param name="bgcolor" value="#E6E6E6"/>
<param name="player_title" value="Jamroom Flash Player"/>
<param name="info_button_text" value="visit us"/>

<embed
src="http://yourdomain.com/jamroom/include/flash/xspf_player.swf?playlist_url=<?php echo $finalvalue2; ?>%26type%3Dxspf&autoload=true&info_button_text=Visit+Us"
quality="high" bgcolor="#E6E6E6" name="Jamroom Flash Player" allowscriptaccess="sameDomain" info_button_text="visit us"
player_title="Jamroom Flash Player"
type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/go/getflashplayer"
align="center" height="170" width="450">
</embed>
</object>


Then just change the value for YOUR PLAYLIST URL above.

For 100 random songs (i've split the following urls for display purposes):

Code

http://yourdomain.com/jamroom/ranking.php?
mode=song&order=11&show=100&
header_template=xspf_header.tpl&
row_template=blank.tpl&footer_template=blank.tpl


(I have also created blank tpl files for ranking and newsearch for the row and footer template values. These files contain no code and I'm not sure if they're actually required.)

For 100 newest songs:

Code

http://yourdomain.com/jamroom/ranking.php?
mode=song&order=3&show=100&
header_template=xspf_header.tpl&
row_template=blank.tpl&footer_template=blank.tpl


For today's top 100:

Code

http://www.yourdomain.com/jamroom/newchart.php?
order=1&chart_days=1&show=20&
header_template=xspf_header.tpl


For 100 random songs from a specific quota:

Code

http://yourdomain.com/jamroom/ranking.php?
mode=song&order=11&show=100&quota[]=8&
header_template=xspf_header.tpl&
row_template=blank.tpl&footer_template=blank.tpl


For 20 songs in the alternative rock genre:

Code

http://yourdomain.com/jamroom/newsearch.php?
mode=retrieve&search_area=genre_name&search_string=alternative+rock&
order_by=random&header_template=xspf_header.tpl&
row_template=blank.tpl&footer_template=blank.tpl


newsearch playlists open up all kinds of possibilities.


_________________
tapegerm.com
homemademusic.com
Back to top
cmaguire



Joined: 22 Apr 2004
Posts: 705

Posted: 06/29/06 07:08 
Dude you are so awesome! I'm gonna integrate this right now. I will get back to you with my right click menu requirements soon.

Thanks so much.

Chris


_________________
Altsounds.com - Alternative Music online
Altsounds.FM - The Future Of Internet Radio!
Back to top
cmaguire



Joined: 22 Apr 2004
Posts: 705

Posted: 06/29/06 07:47 
Not working for me. It's almost like the XSPF playlist is not getting generated as it just continues to say "Loading Playlist". I am currently on 2.66 do I need to be on a higher version for this to work?

http://www.altsounds.com/altsoundsfm/top100.php is an example


_________________
Altsounds.com - Alternative Music online
Altsounds.FM - The Future Of Internet Radio!
Back to top
blindmime



Joined: 07 Mar 2004
Posts: 1107

Posted: 06/29/06 08:26 

cmaguire:
Not working for me. It's almost like the XSPF playlist is not getting generated as it just continues to say "Loading Playlist". I am currently on 2.66 do I need to be on a higher version for this to work?

http://www.altsounds.com/altsoundsfm/top100.php is an example


It looks like there may be a return after "...flash/xspf_player.swf?" in both places. Viewing the source, it appears the playlist is being generated.

I'm not sure if the play.php code for xspf playlists has been updated since vers2.66. Or if the playall variables were added since then. This one seems to be working for you though.


_________________
tapegerm.com
homemademusic.com
Back to top
cmaguire



Joined: 22 Apr 2004
Posts: 705

Posted: 06/29/06 09:42 

blindmime:

cmaguire:
Not working for me. It's almost like the XSPF playlist is not getting generated as it just continues to say "Loading Playlist". I am currently on 2.66 do I need to be on a higher version for this to work?

http://www.altsounds.com/altsoundsfm/top100.php is an example


It looks like there may be a return after "...flash/xspf_player.swf?" in both places. Viewing the source, it appears the playlist is being generated.

I'm not sure if the play.php code for xspf playlists has been updated since vers2.66. Or if the playall variables were added since then. This one seems to be working for you though.


Well not necessarily true. FRom what I can see it is creating the list of songs but I am wondering if the XSPF portion is actually getting created or not. I have looked at my coding and everything seems alright.

Can't figure it out! Aaaaarrrrggh!


_________________
Altsounds.com - Alternative Music online
Altsounds.FM - The Future Of Internet Radio!
Back to top
blindmime



Joined: 07 Mar 2004
Posts: 1107

Posted: 06/29/06 10:03 

cmaguire:

blindmime:

cmaguire:
Not working for me. It's almost like the XSPF playlist is not getting generated as it just continues to say "Loading Playlist". I am currently on 2.66 do I need to be on a higher version for this to work?

http://www.altsounds.com/altsoundsfm/top100.php is an example


It looks like there may be a return after "...flash/xspf_player.swf?" in both places. Viewing the source, it appears the playlist is being generated.

I'm not sure if the play.php code for xspf playlists has been updated since vers2.66. Or if the playall variables were added since then. This one seems to be working for you though.


Well not necessarily true. FRom what I can see it is creating the list of songs but I am wondering if the XSPF portion is actually getting created or not. I have looked at my coding and everything seems alright.

Can't figure it out! Aaaaarrrrggh!


Viewing your source against mine, they look exactly the same; so it appears the playlist is fine. I wonder if you could try downloading 2.69 and just replace the play.php script? (Make a copy of your 2.66 play.php first). Then try it. Could be stream.php was altered as well. I'd try that 'cos I think everything else is working fine.

My sample are here, by the way:

http://homemademusic.com/playlists/random40track.php


_________________
tapegerm.com
homemademusic.com
Back to top
cmaguire



Joined: 22 Apr 2004
Posts: 705

Posted: 06/30/06 10:40 
I've seen yours working. I have changed the play.php and stream.php and it still doesn't work!!!!

OMG. Any other ideas?


_________________
Altsounds.com - Alternative Music online
Altsounds.FM - The Future Of Internet Radio!
Back to top
cmaguire



Joined: 22 Apr 2004
Posts: 705

Posted: 06/30/06 11:10 
The Only difference I can see between mine and your is at the end of the playlist of songs mine adds a + before &autolaod= etc. On yours it doesn't. I bet this is whats causing it but how do I change it?


_________________
Altsounds.com - Alternative Music online
Altsounds.FM - The Future Of Internet Radio!
Back to top
blindmime



Joined: 07 Mar 2004
Posts: 1107

Posted: 06/30/06 13:44 
Yeah, I can see that now. Maybe if I look at your player code I can see something.


_________________
tapegerm.com
homemademusic.com
Back to top
cmaguire



Joined: 22 Apr 2004
Posts: 705

Posted: 06/30/06 15:05 
What do you mean?


_________________
Altsounds.com - Alternative Music online
Altsounds.FM - The Future Of Internet Radio!
Back to top
blindmime



Joined: 07 Mar 2004
Posts: 1107

Posted: 06/30/06 17:53 

cmaguire:
What do you mean?


The code you're using to embed your player. Maybe if I looked at the code I might see something. I can stick any ranking, chart, or newsearch playall call in mine and it works. But it did take me a weekend of tweaking the embed code to get it work for me. At this point, I'm pretty familiar with that, I'm afraid.


_________________
tapegerm.com
homemademusic.com
Back to top
Huw
Oinkba Design


Joined: 03 Aug 2005
Posts: 1345
Location: France

Posted: 07/04/06 14:15 
Bounce..

Any further advances on this, I have the same problem as cmaguire except without the additional + .. I looked at your code blindmime and it's identical to mine. Only difference is I'm not using PHP files, just feeding straight into an embeded player in a popup.

Have to admit, this one's got me stumped.. Confused

Thanks

Back to top
blindmime



Joined: 07 Mar 2004
Posts: 1107

Posted: 07/04/06 15:29 
If you go to http://www.homemademusic.com and select "Artist Picks" under the PLAYLISTS menu, this page is created with a ranking call using tpl files. I think that's similar to what you're doing, perhaps.

Anyway, I've got this working for all possible jamroom playlist calls; also in smarty pages. The radio and smarty types took some tweaking and trial and error sometimes. So I've been through this stuff fairly thoroughly and might be able to help if I saw some code and the page it's on. The type of page would help as well.


_________________
tapegerm.com
homemademusic.com
Back to top
Huw
Oinkba Design


Joined: 03 Aug 2005
Posts: 1345
Location: France

Posted: 07/08/06 05:32 
Sorry for the delay..

Here's the embeded code:


Code
<!-- BEGIN RANDOM PLAYER -->
<div align="center">

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="290" height="102" >

<param name="movie" value="{$JAMROOM_URL}/include/flash/proton_xspf_player.swf?playlist_url={fetch file="$JAMROOM_URL/ranking.php?mode=song&order=3&show=10&header_template=proton_xspf.tpl&row_template=blank.tpl&footer_template=blank.tpl"}%26type%3Dxspf&autoload=true&playlist_title=Media+player"/>
<param name="quality" value="high"/>
<param name="bgcolor" value="#000000"/>
<param name="player_title" value="Jamroom Flash Player"/>
<param name="info_button_text" value="visit us"/>
<embed src="{$JAMROOM_URL}/include/flash/proton_xspf_player.swf?playlist_url={fetch file="$JAMROOM_URL/ranking.php?mode=song&order=3&show=10&header_template=proton_xspf.tpl&row_template=blank.tpl&footer_template=blank.tpl"}%26type%3Dxspf&autoload=true&playlist_title=Media+player"
quality="high" bgcolor="#000000" allowscriptaccess="sameDomain" info_button_text="visit us"
player_title="Jamroom Flash Player" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"
align="center" height="102" width="290"> </embed>
</object>

</div>
<!-- END PLAYER -->


The tpl files are configured the same as yours above, except I've included urlencode on all ie: {$PLAYPAGE_HIFI_MP3_URL|urlencode}

Thanks

Back to top
Display posts from previous:   
User Support Forum Archive (Read Only)
User Site Design, Integration and Customization

12Next >
 
Solutions
• Social Media Platform
• Social Networking Software
• Musician Website Manager
• Community Builder
Products
• Jamroom Core
• Jamroom Addons
• Jamroom Modules
• Jamroom Marketplace
Support
• Support Forum
• Documentation
• Support Center
• Contact Support
Community
• Community Forum
• Member Sites
• Developers
Company
• About Us
• Contact Us
• Privacy Policy
©2003 - 2010 Talldude Networks, LLC.