Skip to content

Commit

Permalink
Essentially the player now works with SoundCloud - will fork for peop…
Browse files Browse the repository at this point in the history
…le who don't want to use this service presently.
  • Loading branch information
conatus committed Sep 18, 2010
1 parent 671ff47 commit 7930fcc
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 8 deletions.
4 changes: 3 additions & 1 deletion js/player.js
@@ -1 +1,3 @@
function popUp(URL){day=new Date();id=day.getTime();eval("page"+id+" = window.open(URL, '"+id+"', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=320,height=140,left = 560,top = 410');");}
function popUp(URL) {
window.open(URL, '', 'toolbar=no,scrollbars=no,location=no,statusbar=no,menubar=no,resizable=no,width=300,height=300');
}
31 changes: 24 additions & 7 deletions player.php
Expand Up @@ -19,16 +19,33 @@ function show_player ($release_slug) {

$release = get_release_by_slug ($release_slug, FALSE, FALSE);

if (is_wp_error($release)){
ribcage_404();
}
if (is_wp_error($release)){
ribcage_404();
}

$artist['artist_name'] = get_artistname_by_id($release['release_artist']);

if (is_wp_error($artist)){
ribcage_404();
}
if (is_wp_error($artist)){
ribcage_404();
}

$table = array(
'Š'=>'S', 'š'=>'s', 'Đ'=>'Dj', 'đ'=>'dj', 'Ž'=>'Z', 'ž'=>'z', 'Č'=>'C', 'č'=>'c', 'Ć'=>'C', 'ć'=>'c',
'À'=>'A', 'Á'=>'A', 'Â'=>'A', 'Ã'=>'A', 'Ä'=>'A', 'Å'=>'A', 'Æ'=>'A', 'Ç'=>'C', 'È'=>'E', 'É'=>'E',
'Ê'=>'E', 'Ë'=>'E', 'Ì'=>'I', 'Í'=>'I', 'Î'=>'I', 'Ï'=>'I', 'Ñ'=>'N', 'Ò'=>'O', 'Ó'=>'O', 'Ô'=>'O',
'Õ'=>'O', 'Ö'=>'O', 'Ø'=>'O', 'Ù'=>'U', 'Ú'=>'U', 'Û'=>'U', 'Ü'=>'U', 'Ý'=>'Y', 'Þ'=>'B', 'ß'=>'Ss',
'à'=>'a', 'á'=>'a', 'â'=>'a', 'ã'=>'a', 'ä'=>'a', 'å'=>'a', 'æ'=>'a', 'ç'=>'c', 'è'=>'e', 'é'=>'e',
'ê'=>'e', 'ë'=>'e', 'ì'=>'i', 'í'=>'i', 'î'=>'i', 'ï'=>'i', 'ð'=>'o', 'ñ'=>'n', 'ò'=>'o', 'ó'=>'o',
'ô'=>'o', 'õ'=>'o', 'ö'=>'o', 'ø'=>'o', 'ù'=>'u', 'ú'=>'u', 'û'=>'u', 'ý'=>'y', 'ý'=>'y', 'þ'=>'b',
'ÿ'=>'y', 'Ŕ'=>'R', 'ŕ'=>'r',
);

$url = $artist['artist_name']." ".$release['release_title'];
$url = preg_replace('/ /', '-', $url);
$url = strtr($url, $table);
$url = strtolower($url);
$url = preg_replace('/\p{P}(?<!-)/', '', $url);
$url = urlencode("http://soundcloud.com/records-on-ribs/sets/".$url);
?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
Expand All @@ -42,7 +59,7 @@ function show_player ($release_slug) {
</style>
</head>
<body>
<embed src="<?php echo get_option('siteurl'); ?>/wp-content/plugins/ribcage/flash/mp3player.swf" width="320" height="140" allowfullscreen="true" allowscriptaccess="always" flashvars="&file=<?php echo get_option('siteurl').'/stream/'.$release_slug.'/xspf/'; ?>&height=140&width=320&displaywidth=120&showicons=false&repeat=list&autostart=true&shuffle=false&callback=<?php echo get_option('siteurl'); ?>/player/stats/" />
<object height="300" width="300"> <param name="movie" value="http://player.soundcloud.com/player.swf?url=<?php echo $url ?>&amp;auto_play=true&amp;player_type=artwork&amp;color=ff0004&amp;buying=false&amp;show_playcount=false&amp;download=false&amp;text_buy_set='Free Download'"></param> <param name="allowscriptaccess" value="always"></param> <embed allowscriptaccess="always" height="300" src="http://player.soundcloud.com/player.swf?url=<?php echo $url ?>&amp;auto_play=true&amp;player_type=artwork&amp;color=ff0004&amp;buying=false&amp;show_playcount=false&amp;download=false&amp;text_buy_set='Free Download" type="application/x-shockwave-flash" width="300"></embed> </object>
</body>
</html>
<?php
Expand Down

0 comments on commit 7930fcc

Please sign in to comment.