Welcome Guest [Log In] [Register]
Search Members Calendar | Rules ZB Code Index IF Code Index
ZBCode
  • Navigation
  • ZBCode
  • Coding Resources
  • Zetaboards Modifications
  • Background Music
Hey, welcome to ZBCode, the premier coding forum for ZB. Here you fill find some of the best Invisionfree and Zetaboards Codes on the network! Unfortunately, you're sorta hovering around in guest mode at the moment; why not join in on the fun? Register an account and you can start accessing the wealth of resources we have available here. Enjoy your stay at ZBCode, and remember to tell all your friends about us; the more members, the more codes available. ;)

Interested in joining? Click here.


If you are already a member of ZBCode, feel free to login right here:

Username:   Password:
Locked Topic
  • Pages:
  • 1
  • 2
  • 3
  • 4
Background Music; rather, Frontground Music
Tweet Topic Started: Apr 10 2009, 08:41 PM (5,279 Views)
Chris Apr 10 2009, 08:41 PM Post #1
Member Avatar


Posts:
34
Group:
Member
Member
#5
Joined:
Jun 10, 2008
Coding language
PHP
This is my first filled code request, ever. Usually I just make my own codes. But this one was kind of fun to make. :)
There is only one bug that I know of right now. In Firefox the iFrame will sometimes not load. To get it to work, simply hit the Refresh Button.

.::Preview::.
http://s1.zetaboards.com/Chris_Codes/pages/music

To get the player to show, click the icon that you see on the bottom left. If you click it again, the player will hide away again. :)

.::Instructions::.
Go to your Admin CP and click Website Maker. Make a new Website, and for the content put in this script:

Code:
 
<script type='text/javascript'>
jQuery(function(){
File = "...";
Width = 200;

jQuery("body").empty();
jQuery("html, body").css({"height":"100%"});
jQuery("body").append("<div id='player'><object height='25' width='"+Width+"'><param value='"+File+"' name='movie'/><param value='transparent' name='wmode'/><embed height='25' width='"+Width+"' wmode='transparent' type='application/x-shockwave-flash' src='"+File+"'></embed></object> <img id='player_toggle' class='closed' style='vertical-align: bottom' src='http://img27.imageshack.us/img27/3706/iconm.png' /><div id='exit' style='display: none;'><button>Exit</button></div></div><iframe height='100%' src='"+main_url+"index/' frameborder='0' width='100%'></iframe>");
jQuery("#player").css({"position":"fixed", "left":"-"+Width+"px", "bottom": "2px"})
jQuery("#player_toggle").click(function(){ D = false; B = jQuery(this); if (B.hasClass("closed")){jQuery("#player").animate({'left': 0}, "slow", function(){jQuery("#exit").slideDown("slow");}); B.attr("class", "open"); D = true;} if (B.hasClass("open") && !D){jQuery("#exit").slideUp("slow", function(){jQuery("#player").animate({'left': 0 - Width}, "slow");}); B.attr("class", "closed");}});
jQuery("#exit button").click(function(){location.href = main_url+"index/"});
});
</script>


You are welcome to edit any of the code, but there are some variables for the obvious stuff. To set a file, find this line:
Code:
 
File = "...";
Replace ... with the url of your Audio File.

To change the width, find this line:
Code:
 
Width = 200;
Replace 200 with the numerical width that you want.

That's all! Please let me know if you find any bugs or have some suggestions. :)
Offline Profile Goto Top
 
whosyourdaddy Apr 12 2009, 01:10 PM Post #2


Posts:
2
Group:
Member
Member
#2,785
Joined:
Apr 12, 2009
This is really neat. ^_^

Is there a way to add this to an actual post? Or is it just for the board in general?
Offline Profile Goto Top
 
Chris Apr 12 2009, 01:35 PM Post #3
Member Avatar


Posts:
34
Group:
Member
Member
#5
Joined:
Jun 10, 2008
Coding language
PHP
You can just use an embed tag if you want music in a specific topic, but not if you want it to not reload on each page change.
Offline Profile Goto Top
 
God Like Oni Apr 23 2009, 06:51 AM Post #4
Member Avatar


Posts:
299
Group:
Member
Member
#2,786
Joined:
Apr 12, 2009
Umm... does the song reload if you click a link?
Posted Image
Posted Image
Offline Profile Goto Top
 
Reid Apr 23 2009, 08:19 AM Post #5
Member Avatar
What? The land of the free? Whoever told you that was your enemy.

Posts:
1,790
Group:
Distinguished Coder
Member
#148
Joined:
Jul 20, 2008
Tobi
Apr 23 2009, 06:51 AM
Umm... does the song reload if you click a link?
It shouldn't.
The Resource Board
Offline Profile Goto Top
 
ANDREW TOPGUNS Apr 23 2009, 08:26 AM Post #6
Member Avatar
10% of the way to 1000 club!

Posts:
113
Group:
Member
Member
#2,467
Joined:
Feb 28, 2009
Coding language
HTML/CSS
Very nice code and i'm glad it doesn't reload on each link, it can also get the community involved by having requests played for certain days. :D
Posted Image
Posted Image
Offline Profile Goto Top
 
Hiddenzbu Jun 13 2009, 09:44 PM Post #7
Member Avatar


Posts:
130
Group:
Member
Member
#812
Joined:
Aug 31, 2008
Are you only allowed one song/music file via this method?
Posted Image
Offline Profile Goto Top
 
Chris Jun 19 2009, 10:06 PM Post #8
Member Avatar


Posts:
34
Group:
Member
Member
#5
Joined:
Jun 10, 2008
Coding language
PHP
If you have a player that is written intirely in a flash file, just use the link to that file. :) You can edit the height of the <object> and <embed>, and it should work just the same. :)
Offline Profile Goto Top
 
jithin Jun 20 2009, 06:17 AM Post #9


Posts:
20
Group:
Member
Member
#3,016
Joined:
May 19, 2009
i have put the script in the webste maker content but still it doesnt work
Offline Profile Goto Top
 
Chris Jun 20 2009, 08:21 PM Post #10
Member Avatar


Posts:
34
Group:
Member
Member
#5
Joined:
Jun 10, 2008
Coding language
PHP
How about posting a forum url?? :ermm:
Edited by Chris, Jun 20 2009, 08:21 PM.
Offline Profile Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
Go to Next Page
« Previous Topic · Zetaboards Modifications · Next Topic »
Locked Topic
  • Pages:
  • 1
  • 2
  • 3
  • 4

Track Topic · E-mail Topic Time: 7:41 PM Jul 10
Hosted for free by ZetaBoards · Privacy Policy