|
|
|
|
![]() ![]() |
May 17 2005, 05:21 PM
Post
#1
|
|
|
Sorry for not being active, Uni :( ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 933 Joined: 24-August 04 From: South Wales, UK Member No.: 892 |
This scripts is so simple, you dont need to edit ANY of it! All you have to do is make a folder called 'songs' and put some audio files in it.
Here is the whole page, I named it index.php and put it in a folder called 'music': CODE <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>PHP jukebox</title> </head> <body> <!-- ©2005 Craig lloyd. All rights reserved. Visit cragllo.com for more scripts --> <?php /** * ©2005 Craig lloyd. All rights reserved. * * Mod Title: Simple PHP Jukebox * Author: Craig Lloyd * Author Email: cragllo@cragllo.com * Author Homepage: http://www.cragllo.com/ * Description: A Simple Jukebox script to enable visitors to your site * to choose a song from a given list and play that song. * Release: v1.0, 17th May 2005 *** * Demo: None * Installation Level: Easy * Installation Time: 1 minute * Files To Edit: None * Included Files: index.php * Included Folders: songs/ * ----------------------[ HOW TO INSTALL ]---------------------------- * Simply upload this file and create a folder called 'songs' * Then just upload .mp3 files into the 'songs' folder * * Either show this page in an iframe or include it into any page * If you include it, the page it is included in has to be in teh same * folder as the songs folder!! */ //---------[ DO NOT EDIT UNLESS YOU KNOW WHAT YOU ARE DOING! ]--------- // Get information from form $song = $_POST['song']; $go = $_POST['go']; if($go){ ?> <!-- Player Start --> <object classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab" width="240" height="43"> <param name="FileName" value="songs/<?=$song;?>"> <param name="AutoStart" value="true"> <param name="ShowTracker" value="true"> <param name="ShowControls" value="true"> <param name="ShowGotoBar" value="false"> <param name="ShowDisplay" value="false"> <param name="ShowStatusBar" value="false"> <param name="AutoSize" value="false"> <param name="PlayCount" value="0"> <embed src="songs/<?=$song;?>" AutoStart="true" ShowTracker="true" ShowControls="true" PlayCount="0" ShowGotoBar="false" ShowDisplay="false" ShowStatusBar="false" AutoSize="false" pluginspage="http://www.microsoft.com/windows/windowsmedia/download/" width="240" height="43"></embed> </object> <!-- Player End --> <?php } ?> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> <select name="song"> <option value="#">Choose a song</option> <!-- List Files Start --> <? $files = Array(); $path = "songs"; $dh = opendir($path); while ($file = readdir($dh)) { if (!is_dir($path."/".$file)) { if (is_file($path."/".$file)) { if (($file!=".") && ($file!="..")) { $files[] = $file; } } } } closedir($dh); asort($files); foreach($files as $index=>$file) { echo "<option value=\"".$file."\">".$file."</option>\n"; } ?> <!-- List Songs End --> </select> <input name="go" type="submit" value="PLAY!"> </form> <span style="font-family:Arial, Helvetica, sans-serif; font-size:12px; color:#000000;">©2005 Craig lloyd. All rights reserved. <a href="http://www.cragllo.com/" target="_blank">Cragllo.com</a></span> </body> </html> After you have created that file, upload it and make a folder in the same folder as the file is in called 'songs', and just upload a few mp3's to the 'songs' folder! Thats it, your done, if you need any more help or have a question, simple reply here. Thanks, Craig. This post has been edited by cragllo: Jul 15 2006, 07:29 PM |
|
|
|
May 17 2005, 06:43 PM
Post
#2
|
|
|
Super Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 283 Joined: 10-October 04 Member No.: 1,637 |
hello cargllo,
it's nice script.. i found something similar before but which run with mx-system(phpbb powered portal system). i gotta one question, if i host my song files on other host server(which is more about good to stream bandwidth), how this script can tweak to link that file..it's something like off-site avatar setting.... is it just simply change the path?? CODE <embed src="songs/<?=$song;?>" to CODE <embed src="off-site songs link/<?=$song;?>"
|
|
|
|
May 17 2005, 09:07 PM
Post
#3
|
|
|
Sorry for not being active, Uni :( ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 933 Joined: 24-August 04 From: South Wales, UK Member No.: 892 |
Yes, you just change the little bit...
CODE <embed src="http://www.othersite.com/if_in_folder/<?=$song;?> its as simple as that This post has been edited by cragllo: May 17 2005, 09:08 PM |
|
|
|
Mar 30 2008, 09:22 AM
Post
#4
|
|
|
Trap Double Mocha Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 2,360 Joined: 21-September 07 Member No.: 50,369 |
Can you kindly suggest me a simple Jukebox to streem music on my website?
Script: Php Jukebox Can you kindly suggest me a simple Jukebox to streem music on my website? -reply by Sreenivas |
|
|
|
May 3 2008, 09:31 AM
Post
#5
|
|
|
Trap Double Mocha Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 2,360 Joined: 21-September 07 Member No.: 50,369 |
need help with WMA
Script: Php Jukebox I like this script you did a great job on it, just one thing though is there some how I can edit it or you can to play WMA files along with mp3? -question by Mitch |
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 24th July 2008 - 12:29 PM |