Newbie Spellweaver
- Joined
- Dec 21, 2008
- Messages
- 42
- Reaction score
- 11
Ok, ive been seeing a few requests for a background music script for their CMS. I did put one into the phoenixms cype but i thought id release it here.
now you must be thinking, where do i put it?
my advice is to put it into header.php
ok now you have header.php open you need to search for
which is the start of the main part of your website.
once you have found that add the code in above it so it looks like this :
now youve done the code you need some music.
as you can see in the code there are file directories pointing to the mp3. Make a folder somewhere in your websites files, put your mp3's inside and change the directories in the script to point to your mp3.
I hope this has helped.
PHP:
<php
if(rand(0,3)==0) {
echo '
<bgsound src="C:\wamp\www\site\sources\bgm\bluesky.mp3" loop="infinite">';
}
elseif(rand(0,2)==0) {
echo '
<bgsound src="C:\wamp\www\site\sources\bgm\amoria.mp3" loop="infinite">';
}
elseif(rand(0,1)==0) {
echo '
<bgsound src="C:\wamp\www\site\sources\bgm\shiningharbor.mp3" loop="infinite">';
} else{
echo '
<bgsound src="C:\wamp\www\site\sources\bgm\upon the sky.mp3" loop="infinite">';
}
?>
now you must be thinking, where do i put it?
my advice is to put it into header.php
ok now you have header.php open you need to search for
PHP:
<body>
once you have found that add the code in above it so it looks like this :
PHP:
<php
if(rand(0,3)==0) {
echo '
<bgsound src="C:\wamp\www\site\sources\bgm\bluesky.mp3" loop="infinite">';
}
elseif(rand(0,2)==0) {
echo '
<bgsound src="C:\wamp\www\site\sources\bgm\amoria.mp3" loop="infinite">';
}
elseif(rand(0,1)==0) {
echo '
<bgsound src="C:\wamp\www\site\sources\bgm\shiningharbor.mp3" loop="infinite">';
} else{
echo '
<bgsound src="C:\wamp\www\site\sources\bgm\upon the sky.mp3" loop="infinite">';
}
?>
<body>
now youve done the code you need some music.
as you can see in the code there are file directories pointing to the mp3. Make a folder somewhere in your websites files, put your mp3's inside and change the directories in the script to point to your mp3.
I hope this has helped.