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
blindmime



Joined: 07 Mar 2004
Posts: 1107

Posted: 07/08/06 11:44 
A simple urlencode doesn't seem to work for any playlist I've attempted. I've had to add additional parsing for ranking, newchart, newsearch calls, for instance (as noted above):


Code

<?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 );

?>


This is in a php page, however.

I do have playlists running with smary's urlencode function, but I've had to add an extra bit of parsing to them as well:


Code

{$RADIO_PLAY_URL|urlencode|replace:'amp%3B':''}


It would be helpful to know where you're putting your player so I know what kind of page is being generated with the code.


_________________
tapegerm.com
homemademusic.com
Back to top
oberon



Joined: 11 Jan 2007
Posts: 26

Posted: 01/29/07 12:28 
Sorry for being such a newb here but I am having trouble trying to make sense of this. I don't know anyting about php really.

I would like to have the spotlight artist that is displayed on the main page to have the songs played with the xspf flash player.

This brings up a question for me as well. Why isn't jamroom run entirely with a flash player? Wouldn't this also protect artsists music from download and also ensure cross platform play?

Anyway back to my problem...I see that a playlist has to some how be created for this feature (spotlight playlist) but am wondering if you can use code like this (taken from a test artist page)


Code
....26band_id%3D2%26song_id%3Dall%26type%.....


and just have the "band_id" value changed to whatever the spotlight Band id is. Again i appoligise for not knowing this stuff.... but take whatever is the band_id variable {$BAND_ID} and have it swapped with whatever the spotlight band id is.

I know this isn't real code but just to explain what I am saying

{BAND_ID}=spotlight band id


Code
....26{Band_id}%3D2%26song_id%3Dall%26type%.....


LOL sorry if this doesn't make sense.

Back to top
Brian
Jamroom Team


Joined: 09 Jul 2003
Posts: 37583
Location: Seattle, WA

Posted: 01/29/07 12:40 

oberon:
Sorry for being such a newb here but I am having trouble trying to make sense of this. I don't know anyting about php really.

I would like to have the spotlight artist that is displayed on the main page to have the songs played with the xspf flash player.

This brings up a question for me as well. Why isn't jamroom run entirely with a flash player?


Some people don't want it to work that way Wink Jamroom is customizable, so purposefully limiting the playback to flash only wouldn't be something I would do.


Quote:

Wouldn't this also protect artsists music from download and also ensure cross platform play?


Yes - and no. Jamroom already works hard to protect the media, and having a "flash" player is no guarantee of being able to protect the media. Also, what if a listener would prefer to listen to their songs on WMP, iTunes or Winamp? or XMMS? for some sites, giving the listener a choice is more important than forcing a choice on the listener.


Quote:

Anyway back to my problem...I see that a playlist has to some how be created for this feature (spotlight playlist) but am wondering if you can use code like this (taken from a test artist page)


Code
....26band_id%3D2%26song_id%3Dall%26type%.....


and just have the "band_id" value changed to whatever the spotlight Band id is. Again i appoligise for not knowing this stuff.... but take whatever is the band_id variable {$BAND_ID} and have it swapped with whatever the spotlight band id is.

I know this isn't real code but just to explain what I am saying

{BAND_ID}=spotlight band id


Code
....26{Band_id}%3D2%26song_id%3Dall%26type%.....


LOL sorry if this doesn't make sense.


You can always embed the flash player using the {jr_flash_player} template function - that would be your easiest route:

http://www.jamroom.net/Jamroom3_jr_flash_player

Hope this helps!

- Brian


_________________
Make sure and check out:
* The Jamroom FAQ
* The Jamroom Documentation
Back to top
oberon



Joined: 11 Jan 2007
Posts: 26

Posted: 01/29/07 13:18 
Again apologies,

I haven't been able to get the flash player to load using that function.
like shouldn't this work?

Code

{jr_flash_player player_type="http://www.kilohertz.mobi/test/themes/Cobalt/dsplayer_cobalt_large.swf" band_id="1"}



I Just get a white square.

Anyhoo, I can embed the flash player the other way but am still wondering if there is a way to have the "band_id" as some kind of variable
so i can just swap the band-id in the flash player settings to go to wahtever "band_id" comes out of the spotlight ranking... featured band... thing...

Back to top
smith.kyle
CodeSmith


Joined: 27 Apr 2006
Posts: 22009
Location: Southern California

Posted: 01/29/07 13:21 
On the docs for the jr_flash_player function, note that the height and width params are required (otherwise it won't know how big to make it since there are a number of possible flash players of all different sizes). You will want to model it after this:

Code

{jr_flash_player player_type="`$JAMROOM_URL`/themes/Cobalt/dsplayer_cobalt_large.swf" width="430" height="200" band_id=$BAND_ID}



_________________
kyle[at]jamroom.net

Yes...that's a soda machine...

I get bored when no one's posting...
Back to top
oberon



Joined: 11 Jan 2007
Posts: 26

Posted: 01/29/07 14:27 
Hi smith

Thanks. its still not working but I'll figure it out.

Thanks guys

Back to top
smith.kyle
CodeSmith


Joined: 27 Apr 2006
Posts: 22009
Location: Southern California

Posted: 01/29/07 14:40 
If you are still seeing a white square, it means that your flash player is not in the directory specified in the function. Make sure and double check that.


_________________
kyle[at]jamroom.net

Yes...that's a soda machine...

I get bored when no one's posting...
Back to top
oberon



Joined: 11 Jan 2007
Posts: 26

Posted: 01/29/07 14:42 
I got it now actually. But now the drop down menu on the list menu drops down "beneath" the flash player.

Back to top
smith.kyle
CodeSmith


Joined: 27 Apr 2006
Posts: 22009
Location: Southern California

Posted: 01/29/07 14:47 
I can't search for it right now because I'm in class, but Daddysylem posted a solution to this a while back. I think its either in the User site design and integration or user documentation and how tos. You could also search for "javascript" and "flash player"


_________________
kyle[at]jamroom.net

Yes...that's a soda machine...

I get bored when no one's posting...
Back to top
oberon



Joined: 11 Jan 2007
Posts: 26

Posted: 01/29/07 14:49 
Get those eyes on that board there sonny!

Ok thanks. Pay attention in class will ya Shocked

Back to top
daddysylem
DS Flash Players


Joined: 30 Mar 2005
Posts: 4086
Location: Southern California

Posted: 01/29/07 16:13 

oberon:
I got it now actually. But now the drop down menu on the list menu drops down "beneath" the flash player.


This should help........
http://www.jamroom.net/phpBB2/viewtopic.php?t=8126


_________________
I have no idea why I do this..................
Email: daddysylem[at]dsplayerskins.com
DSPlayerSkins.com
GCFireSprinkler.com
Back to top
neoidea



Joined: 06 Nov 2007
Posts: 266

Posted: 06/21/08 12:42 

blindmime:
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.


Great Info and tutorial but...what after that? What is the link to put this in my site? I know, that I must to use this file (xspf_header.tpl) in this link but...how?

Please, help me;)

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

< Previous12
 
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.