Bravo List
Register
Go Back   > Bravo List > Source Code > Archived Trackers > TBDev > Mods & Themes
Reply
  #1  
Old 10th March 2008, 17:27
Fynnon's Avatar
Fynnon Fynnon is offline
xxx
 
Join Date: Nov 2007
P2P
Posts: 971
Default 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;
Upload whatever .mp3's you want to be played to the playlist folder. But I would suggest you name the mp3's something easy to to type out. You'll see why in a mo :)

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>
You can obviously add as many tracks in the format as you want. I currently have over 20 :)


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);
Add:

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);
Now in takeprofedit.php, just after:
Code:
$avatar = $_POST["avatar"];
$avatars = ($_POST["avatars"] != "" ? "yes" : "no");
Add
Code:
$intromusic = $_POST["intromusic"];
And just after:
Code:
if (is_valid_id($stylesheet))
  $updateset[] = "stylesheet = '$stylesheet'";
if (is_valid_id($country))
  $updateset[] = "country = $country";
Add
Code:
$updateset[] = "intromusic =  " . sqlesc($intromusic);
So it looks like:
Code:
if (is_valid_id($country))
  $updateset[] = "country = $country";

$updateset[] = "intromusic =  " . sqlesc($intromusic);
You can add it wherever you want it to display in index.php, but I placed mine at the top.

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.");
}
}
}
Add, after you have ammended the the changes!!

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 parts you need to pay attention to when editing, are obviously the link's, changing YOUR-SITE-HERE your site's URL of course, but also pay attention to the playlist and button in the link, You need to change those to the folders name ("duh" I hear you all cry, just making sure to wipe any nose's, that may need wiping :) )

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
Reply With Quote
The Following User Says Thank You to Fynnon For This Useful Post:
SooR (15th January 2009)
  #2  
Old 10th October 2010, 17:03
DaDuKuTzU's Avatar
DaDuKuTzU DaDuKuTzU is offline
Member
 
Join Date: Jul 2009
P2P
Posts: 4
Default
thanks! Really works!
Reply With Quote
  #3  
Old 20th January 2012, 15:41
laciz23's Avatar
laciz23 laciz23 is offline
Member
 
Join Date: Oct 2011
P2P
Posts: 2
Default
Is thare a way to make a replay option ?
Reply With Quote
Reply

Tags
index , music

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

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



All times are GMT +2. The time now is 12:46. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2021, vBulletin Solutions Inc.