Andy Samberg Channels Mark Wahlberg
This is so hilarious, I had to post it. Take a deep breath and try not to burst laughing.
Cache Free Auto Playlist in Nifty Audio Player
While I did not write most of this code, I did contribute the portion for cache free playback on a client machine. A useful feature if you don’t want someone ripping your music or learning the path to your mp3 files. I’ve modified the code below to include headers for cache free playback on a client-side machine. This is useful if you don’t want people to rip your music files or expose the directory in which they are stored. The cache free playback has been tested on IE 5+, FF 1.5+, Safari 2+ and Opera 8.02+. Chrome was not tested as it is in beta.
There is also a $file variable on line 112 you can uncomment if your mp3 file names are artist_-_title.mp3. This will allow auto.php to read your file names correctly for playback but display them in the play list without the unsightly _underscores_. Check out Nifty Audio Player at FlashNifties.com.
Save the code below as auto.php or similar. It’s inconsequential really.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 | <?php /********************************************************************************/ /* *****************************************/ /* auto.php for Nifty Audio Player *****************************************/ /* portions by http://digicave.org *****************************************/ /* v.01 10/02/2008 *****************************************/ /* *****************************************/ /********************************************************************************/ $file_dir = "music"; //change this to a folder name $omit_chars = 0; //how many characters to cut off the title's front $target = $file_dir; /********************************************************************************/ /* *****************************************/ /* CACHE PREVENTION DURING PLAYBACK *****************************************/ /* *****************************************/ /********************************************************************************/ if (isset($_GET['nocache'])) { $fileonly = stripslashes($_GET['param']); $file = $target.'/'.$fileonly; $fh = fopen($file,"rb"); while (!feof($fh)) { header("Cache-Control: no-store, must-revalidate"); header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Content-Type: audio/mpeg"); header('Content-Length: ' . filesize($file)); print(fread($fh, (1*(1024*1024)))); } fclose($fh); } else { print '<?xml version="1.0" encoding="utf-8"?> <!-- PROPERTY FORMAT LEGEND: --> <!--Rectangle: topColor,bottomColor,fillAlpha,cornerRadius,strokeColor,strokeAlpha,strokeWidth--> <!--Text: font,color,alpha,size,bold--> <!--Simple Property: color,alpha--> <music playerMode="1" displayTimeInfo="true" playerWidth="350" playerHeight="35" playerX="20" playerY="10" flyOut="bottom" autoStart="true" buttonSize="25" buttonPadding="5" buttonY="5" playInSequence="true" playerVolume="100" embedFonts="false" playerBg="282828,000000,100,5,171717,100,1" playerBgShine="FFFFFF,FFFFFF,10,5,333333,0,1" buttonBg="444444,000000,100,7,000000,100,1" buttonInnerStroke="363636,000000,100,7,333333,100,1" buttonBgHover="0D97F2,075d99,100,7,064B79,100,1" buttonIcon="888888,100" buttonIconHover="FFFFFF,100" displaySongText="Verdana,A4A4A4,100,10,false" displaySongTimeTotal="Arial,A4A4A4,100,10,false" displaySongTimeElapsed="Arial,FFFFFF,100,10,true" displaySongTextY="2" displaySongTimeY="2" pauseDisplayFor="2" songTitleScrollTime="3" sliderHeight="5" sliderY="21" sliderButtonWidth="10" sliderButtonHeight="10" sliderBg="000000,333333,100,3,0,0,0" sliderFill="0D97F2,075d99,100,3,0,0,0" sliderStramProgress="333333,444444,100,3,0,0,0" sliderButton="FFFFFF,666666,100,10,333333,100,1" volumeHeight="70" volumeBg="222222,000000,100,9,333333,100,1" volumeSliderBg="333333,444444,100,3,0,0,0" volumeSliderFill="0D97F2,075d99,100,3,0,0,0" volumeText="Arial,FFFFFF,100,10,false" volumeSliderButton="FFFFFF,666666,100,9,333333,100,1" listOpen="true" listHeight="180" listPadding="10" listScrollbarWidth="9" listBg="222222,000000,100,15,333333,100,1" listScrollbar="666666,100" listScrollbarBg="000000,100" listItemHeight="20" listItemBg="333333,100" listItemBgActive="075d99,100" listTitleText="Verdana,999999,100,10,false" listTitleTextActive="Verdana,FFFFFF,100,10,false" listTitleScrollTime="5" ><group>'; $dir = opendir($file_dir); $xml_string= array(); while ($file=readdir($dir)) { $filer = $_SERVER["SCRIPT_NAME"]; $break = explode('/', $filer); $pfile = $break[count($break) - 1]; // If you require your filenames to include _underscores, uncomment the next line //$file = str_replace(" ", "_", $file); $urlHurl = $pfile."?nocache&param=".$file; if(substr($file, -3) == "mp3") { $parts = explode(".", $file); $tmp_str = '<song file="'.$urlHurl.'" title="'.substr(str_replace("_", " ", $parts[0]), $omit_chars).'" />'; array_push($xml_string, $tmp_str); } } sort($xml_string); for($i=0; $i<count($xml_string); $i++) { print $xml_string[$i]; } closedir($dir); print '</group></music>'; } ?> |
Configuration:
1. Open auto.php in your favorite text editor and edit the $file_dir value to point to your music files directory. No slashes!
$file_dir = "music"; //change this to a folder name
2. If your file names are artist_-_title.mp3, uncomment line 112. Change this:
//$file = str_replace(" ", "_", $file);to this:
$file = str_replace(" ", "_", $file);
If your file names are artist - title.mp3, skip this step.
3. Save auto.php and upload.
4. Open player.html and add this variable to your script tag
so.addVariable("xmlPath", "auto.php");
5. Save player.html
Directory Structure:
/player.html
/auto.php
audio_player_files/audioPlayer.swf
audio_player_files/flashdetect.js
music/artist - title.mp3
music/blah - blah.mp3
Load your player.html. Done!
Enjoy cache free playback.
Travis Barker & DJ AM in critical condition
I’m in total shock right now. I woke up this morning to news that Travis’ plane had crashed just after midnight while during takeoff in Columbia, SC. Word is he and AM were swatting at each other in the street trying to put out the flames. Travis was burned from the waist down while DJ AM suffered burns to his face. Tragic.
The pair were transported to Augusta Georgia Burn Center 75 miles from the crash site. You don’t get transported to a ‘burn’ center if your injuries aren’t life threatening. Travis’ wiki page says he’s “expected to survive.” Notice it says, “survive” not “recover.” He must have been burned badly.
There was very little more available about DJ AM. Only that he was once engaged to Nicole Richie.
May God heal them quickly and comfort their families and the families of those who perished; pilot Sarah Lemmon, 31, of Anaheim Hills; co-pilot James Bland, 52, of Carlsbad; Chris Baker, 29, of Studio City; and Charles Still, 25, of Los Angeles.
So sad.

