Welcome Guest [Log In] [Register]
Search Members Calendar | Rules ZB Code Index IF Code Index
ZBCode
  • Navigation
  • ZBCode
  • Coding Resources
  • Code Requests
  • Completed Requests
  • [Completed] [ZB] Music on Members Profile
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
[Completed] [ZB] Music on Members Profile
Tweet Topic Started: Oct 6 2009, 07:56 PM (359 Views)
habs1 Oct 6 2009, 07:56 PM Post #1


Posts:
40
Group:
Member
Member
#3,471
Joined:
Sep 6, 2009
Is there a code that makes it so I could add a music file onto someones profile page?

If there are any copy right issues with songs and such, I can deal with that, its not really for songs, its for usermade audio and stuff like that, I really just need the code.
Offline Profile Goto Top
 
Reid Oct 6 2009, 09:08 PM Post #2
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
Sure, where would you like the file to go? Are you going to do it through YouTube or do you want it to be a direct link to a file?
The Resource Board
Offline Profile Goto Top
 
habs1 Oct 7 2009, 02:44 PM Post #3


Posts:
40
Group:
Member
Member
#3,471
Joined:
Sep 6, 2009
A direct link to an MP3 file.
Offline Profile Goto Top
 
Reid Oct 7 2009, 03:51 PM Post #4
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
Try this...
Code:
 
<script type='text/javascript'>
// <![CDATA[
var users = [];
users.push(['Reid', 'some_link.mp3']);

var music_player_size = [ 140, 40 ];

// end of settings
if (location.href.indexOf('/profile')!=-1) {
var l = users.length;
while (l--) {
if ($('#profile_menuwrap').next().text() == users[l][0]) {
$('dl.user_profile').parents('tr').prev().before("<tr><td class='c_desc'>Music</td><td><embed src='" + users[l][1] + "' width='" + music_player_size[0] + "' height='" + music_player_size[1] + "' autostart='false' loop='false' /></td></tr>");
}
}
}
// ]]>
</script>
Simply add more lines that says users.push and follow the format there, which is this:
Code:
 
users.push(["Username", "Link to mp3 file"]);
The other option is the line that says music_player_size - simply edit that as well. It's width then height.

That should force some music to appear on a person's profile. Stick this code below the board.
The Resource Board
Offline Profile Goto Top
 
habs1 Oct 9 2009, 09:34 AM Post #5


Posts:
40
Group:
Member
Member
#3,471
Joined:
Sep 6, 2009
I can't seem to get it to work...

Code:
 
<script type='text/javascript'>// <![CDATA[var users = [];users.push(['Shwinger', 'http://www.fileden.com/files/2009/8/17/2547022/vidtomp3.com-12505136092747.mp3']);var music_player_size = [ 140, 40 ];// end of settingsif (location.href.indexOf('/profile')!=-1) { var l = users.length; while (l--) { if ($('#profile_menuwrap').next().text() == users[l][0]) { $('dl.user_profile').parents('tr').prev().before("<tr><td class='c_desc'>Music</td><td><embed src='" + users[l][1] + "' width='" + music_player_size[0] + "' height='" + music_player_size[1] + "' autostart='false' loop='false' /></td></tr>"); } }}// ]]></script>


Did I do something wrong?
Offline Profile Goto Top
 
PIWYRCOM Oct 9 2009, 10:21 AM Post #6
Member Avatar
PrideInWhatYouRide

Posts:
368
Group:
Member
Member
#53
Joined:
Jul 17, 2008
Coding language
None
Try coping the code as shown, not all on one line.
(IE always did this for me, google chrome does not)

and.... this also works with youtube !!
» TEST FORUM »
FIND IT HERE !
Spoiler: click to toggle

→ Infinite Results (themes)
→ ZBThemeZone (themes)

→ Big Boards (codes/themes)
→ ZBCodes (codes/themes)
→ The Coding Zone (codes/themes)

→ Code Index ('Official')
→ ZetaDoc's ('Official - How To Info')

Posted Image

Offline Profile Goto Top
 
habs1 Oct 9 2009, 11:35 AM Post #7


Posts:
40
Group:
Member
Member
#3,471
Joined:
Sep 6, 2009
Wierd, I still can't get it to work.
Offline Profile Goto Top
 
Reid Oct 9 2009, 04:18 PM Post #8
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
Can I have a link to your board?
The Resource Board
Offline Profile Goto Top
 
habs1 Oct 9 2009, 04:25 PM Post #9


Posts:
40
Group:
Member
Member
#3,471
Joined:
Sep 6, 2009
http://sfodx.com/site/
Offline Profile Goto Top
 
Reid Oct 9 2009, 05:56 PM Post #10
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
Try this instead:
Code:
 
<script type='text/javascript'>
// <![CDATA[
var users = [];
users.push(['Miley Cyrus', 'http://www.youtube.com/watch?v=Q7C8tJos0zE']);

var music_player_size = [ 140, 40 ];

// end of settings
if (location.href.indexOf('/profile')!=-1) {
var l = users.length;
while (l--) {
if ($('#profile_menuwrap').next().text() == users[l][0]) {
$('dl.user_info').parents('tr').prev().before("<tr><td class='c_desc'>Music</td><td><embed src='" + users[l][1] + "' width='" + music_player_size[0] + "' height='" + music_player_size[1] + "' autostart='false' loop='false' /></td></tr>");
}
}
}
// ]]>
</script>
Although that isn't a direct link to a .mp3 file... it'll simply load youtube in a very tiny window.
The Resource Board
Offline Profile Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
Go to Next Page
« Previous Topic · Completed Requests · Next Topic »
Locked Topic
  • Pages:
  • 1
  • 2

Track Topic · E-mail Topic Time: 2:27 PM Jul 11
Hosted for free by ZetaBoards · Privacy Policy