Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   Mods & Themes (http://www.bvlist.com/forumdisplay.php?f=109)
-   -   Music on Index (http://www.bvlist.com/showthread.php?t=199)

Fynnon 10th March 2008 17:27

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:



 
 
        http://www.YOUR-SITE-HERE.com/playlist/01.mp3
 
 
        http://www.YOUR-SITE-HERE.com/playlist/02.mp3
 
 
        http://www.YOUR-SITE-HERE.com/playlist/03.mp3
 
 


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",
"All (except blocks)
Friends only
Staff only"
,1);

Add:

Code:

tr("Intro Music",
"Yeppers
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')
{ ?>
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">
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]

Disable the music by
editing Your Profile

  else
  {
  print("Bah HUMBUG!
 you disabled the crimbo music!
");
  }

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

DaDuKuTzU 10th October 2010 17:03

thanks! Really works!

laciz23 20th January 2012 15:41

Is thare a way to make a replay option ?


All times are GMT +2. The time now is 11:16.

Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.