We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Locked Topic
[ C ] Background Music Profile Field
Topic Started: Jul 22 2015, 08:18 PM (455 Views)
Tyler Dream
Member Avatar
Member
[ *  *  *  * ]
ZB
URL in mini profile

I'm looking for a code that would allow members to select whether they want background music enabled and if they do want it enabled, it would show another profile field which would ask them to select what bg music they would like.
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
So you plan to make a multiple choice field that will allow users to select the background music they want, or were you wanting an input box where users can insert a URL to produce the background music they're wishing to play?

Also, do you want the background music to appear in a separate window? Not displaying it in a separate window will make the song restart every time a new page is accessed.
Offline Profile Goto Top
 
Tyler Dream
Member Avatar
Member
[ *  *  *  * ]
I would like a multiple choice field that would either turn the bg music on/off and then if they select yes, they can choose from a predefined list of songs.
Offline Profile Goto Top
 
Tyler Dream
Member Avatar
Member
[ *  *  *  * ]
bump
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
What's the file type you are going to be using for the songs?
Offline Profile Goto Top
 
Tyler Dream
Member Avatar
Member
[ *  *  *  * ]
.mp3
Offline Profile Goto Top
 
Tyler Dream
Member Avatar
Member
[ *  *  *  * ]
bump :p
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Cory
Jul 24 2015, 07:26 PM
Also, do you want the background music to appear in a separate window? Not displaying it in a separate window will make the song restart every time a new page is accessed.
You never really did answer this question.
Offline Profile Goto Top
 
Tyler Dream
Member Avatar
Member
[ *  *  *  * ]
My bad I didn't see it, and separate window is fine
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Admin CP Posted Image Users & Groups Posted Image Profile Fields

Create a new Multiple choice field with the following specifications:

Title: Background Music
No to all the options.
Choices: Use this format:
Code:
 
None
Song Title (MP3 URL)
Song Title (MP3 URL)
Song Title (MP3 URL)
Admin CP Posted Image Board Customization Posted Image Website Maker Posted Image Create New Webpage

Page ID: music
Page Title: Background Music
Link to this page in the board menu?: No
Page Content:
Code:
 
<div id="music" class="c"></div>

<script type="text/javascript">
//<![CDATA[
$('#music').append('<audio loop="loop" autoplay="autoplay" controls><source src="' + $.zb.get('BGMusic') + '" type="audio/mpeg"></audio><br /><br /><a href="' + main_url + '" target="_blank"><big>Go to the Homepage</big></a>');
//]]>
</script>
Admin CP Posted Image Themes Posted Image Board Template Posted Image Below the Board
Code:
 
<script type="text/javascript">
$('table.profile td.c_desc:contains(Background Music)').parent('tr').hide();

$('#edit_profile td.c_desc:contains(Background Music)').next('td').find('select option').each(function() {
if ($(this).text().indexOf('(') !== -1) {
var options = $(this).text().split('(')[0];
$(this).attr('label', options);
}
});

$('#edit_profile td.c_desc:contains(Background Music)').next('td').find('select').change(function() {
$.zb.del('NWOpen');
});

$('#edit_profile').closest('form').submit(function() {
if ($(this).find('td.c_desc:contains(Background Music)').next('td').find('option:selected').text().indexOf('(') !== -1) {
var mURL = $(this).find('option:selected').text().split('(')[1].split(')')[0];
$.zb.set('BGMusic', mURL);
} else {
$.zb.del('BGMusic');
}
});

if ($.zb.get('BGMusic').indexOf('http://') !== -1 && location.href.indexOf('/pages/music/') === -1 && $.zb.get('NWOpen') !== 'true') {
window.location.href = main_url + 'pages/music/';
$.zb.set('NWOpen', true);
}
</script>
Offline Profile Goto Top
 
Roby
Member Avatar
#27

Completed!

Your request has been completed. If you have any questions or concerns regarding the state of your request, please feel free to contact me via PM.
Offline Profile Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Closed Requests · Next Topic »
Locked Topic