|
#1
|
||||
|
||||
Music on Index
Music Player
Ok, your going to need to grab the Button version 0.1 from the above link. Its very tiny, and not intrusive at all! Now create a folder called something like button in the root directory of your site. And upload the content's of the button_player-0.1.zip into the Newly created directory. (you really should save it something different to this, to stop people linking to yours!) Now create a folder called something like playlist (And again you really should save it something different to this, to stop people linking to yours! Im not joking, someone could easily link to your's and steal your BW!) Note, there is a link on the same address above, where you can create the code for the player, but for this little "guide", I'll assume your going to use mine. So, let's get on with the code. First off, the SQL Code:
ALTER TABLE `users` ADD `intromusic` ENUM( 'yes', 'no' ) DEFAULT 'yes' NOT NULL; Now, create and save a blank file called index.html, and place a copy in both of the newly created folder's. This is to stop people browsing, and of course downloading the contents of the folders! So, by now, I'm assuming you have done the above, and now have the .mp3's nestling in your playlist folder. So, create a file called crimbo.xspf, and edit it so that it contains links to all of the .mp3's you just uploaded. And save it in your playlist directory. Code:
<?xml version="1.0" encoding="UTF-8"?> <playlist version="0" xmlns="http://xspf.org/ns/0/"> <trackList> <track> <location>http://www.YOUR-SITE-HERE.com/playlist/01.mp3</location> </track> <track> <location>http://www.YOUR-SITE-HERE.com/playlist/02.mp3</location> </track> <track> <location>http://www.YOUR-SITE-HERE.com/playlist/03.mp3</location> </track> </trackList> </playlist> Now, in my.php, just after: Code:
tr("Accept PMs", "<input type=radio name=acceptpms" . ($CURUSER["acceptpms"] == "yes" ? " checked" : "") . " value=yes>All (except blocks) <input type=radio name=acceptpms" . ($CURUSER["acceptpms"] == "friends" ? " checked" : "") . " value=friends>Friends only <input type=radio name=acceptpms" . ($CURUSER["acceptpms"] == "no" ? " checked" : "") . " value=no>Staff only" ,1); Code:
tr("Intro Music", "<input type=radio name=intromusic" . ($CURUSER["intromusic"] == "yes" ? " checked" : "") . " value=yes>Yeppers <input type=radio name=intromusic" . ($CURUSER["intromusic"] == "no" ? " checked" : "") . " value=no>Bah Humbug" ,1); Code:
$avatar = $_POST["avatar"]; $avatars = ($_POST["avatars"] != "" ? "yes" : "no"); Code:
$intromusic = $_POST["intromusic"]; Code:
if (is_valid_id($stylesheet)) $updateset[] = "stylesheet = '$stylesheet'"; if (is_valid_id($country)) $updateset[] = "country = $country"; Code:
$updateset[] = "intromusic = " . sqlesc($intromusic); Code:
if (is_valid_id($country)) $updateset[] = "country = $country"; $updateset[] = "intromusic = " . sqlesc($intromusic); Now, This is where it could get a tad tricky. So please take care when editing the code. I would also suggest you save an index2.php with the index.php contents in, and tinker with it. Once your happy, put the code into index.php Just after: Code:
}else{ stderr("Error", "An error occured."); } } } Code:
if ($CURUSER["intromusic"] == 'yes') { ?> <object type="application/x-shockwave-flash" data="http://www.YOUR-SITE-HERE.com/button/musicplayer_f6.swf?&autoplay=true&shuffle=true&playlist_url=http://www.YOUR-SITE-HERE.com/playlist/crimbo.xspf&playlist_size=3&first_track=1&b_bgcolor=FFFF00&b_fgcolor=C0C0C0&b_colors=FF0000,FFFF00,C0C0C0,000000&" width="17" height="17"> <param name="movie" value="http://www.YOUR-SITE-HERE.com/button/musicplayer_f6.swf?&autoplay=true&shuffle=true&playlist_url=http://www.YOUR-SITE-HERE.com/playlist/crimbo.xspf&playlist_size=5&first_track=2&b_bgcolor=FFFF00&b_fgcolor=C0C0C0&b_colors=FF0000,FFFF00,C0C0C0,000000&" /> [img]noflash.gif[/img] </object> <div align="bottom"><FONT FACE="Times New Roman" SIZE="1" COLOR="#FFFF00">Disable the music by editing Your Profile</FONT></div> <? } else { print("<FONT FACE=\"Times New Roman\" SIZE=\"1\" COLOR=\"#FFFF00\">Bah HUMBUG! you disabled the crimbo music!</font>"); } Now, the little bugger thats hidden away, is playlist_size=3, You need to change that to however many .mp3's you have in your .xspf file!. Youll also need to remember to ammend that, if you add more track's at a later date :) And of course, feel free to tinker with the colours to suit your site :) So, I think thats all done. Each individual user can choose wheter or not they want to hear the newly added cheesy addition to your site :) mod by Eclectic@tbdev.net |
The Following User Says Thank You to Fynnon For This Useful Post: | ||
SooR (15th January 2009)
|
#2
|
|||
|
|||
thanks! Really works!
|
#3
|
|||
|
|||
Is thare a way to make a replay option ?
|
Tags |
index , music |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
TBDev Music Mania Edition | hellix | Downloads | 43 | 14th August 2013 12:51 |
make music | Tory | Template Shares | 1 | 12th September 2009 14:30 |
Music cat icons | hellix | TBDev | 1 | 20th December 2008 19:08 |