The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Profile Songs?

2 posters

Go down

In progress Profile Songs?

Post by MockingJaye November 6th 2015, 12:57 am

Hello,

I am looking for a answer/code for profile songs....

Basically what I want is to have a small sleek media player on the profile page of every user, which the user can customize to play a single song of their choosing.  I don't want anything for the entire forum and so on, just what I said above.  I looked and it looked like it was possible but I'm not entirely sure on what to do because I couldn't find anything with that was direct or what I wanted exactly. 

The Forum Link: http://thevoid.forumotion.net/

Forum Version: PhpBB2

Thank you for the help in advance.
MockingJaye
MockingJaye
Forumember

Female Posts : 30
Reputation : 1
Language : English

http://infinitefairytail.canadian-forum.com/

Back to top Go down

In progress Re: Profile Songs?

Post by Kirbs November 6th 2015, 3:46 am

Hi,

Go to ACP >> Users & Groups >> Users >> Profiles >> Press this button Profile Songs? Ajouter
Make a new field just like this https://i.imgur.com/Y8QqXRm.png then hit Save

Go to ACP >> Modules >> HTML & JAVASCRIPT >> Javascript codes management >> Click on this button Profile Songs? ZRQkE56

Title: Profile Music
Placement: In all the pages
Javascript code:
Code:
$(function(){
  if(RegExp("/u[0-9]+").test(window.location.pathname)) {
      var mobileAgents = new RegExp("Android|BlackBerry|Blazer|BOLT|SymbianOS|Doris|Mobile|Phone|Fennec|GoBrowser|Iris|Maemo|MIB\/2\.2|Minimo|NetFront|Opera Mini|Opera Mobi|SEMC|Skyfire|Teleca|uZardWeb","i");
      if(mobileAgents.test(navigator.userAgent)) {
        return;
      }
      var profsong = $("#field_id4 dt + dd div:first-of-type") || undefined;
      if(!profsong) {
        return;
      }
      var trueorfalse = profsong.text().trim().charAt(0) !== "-" || false;
      if(trueorfalse) {
            var vid = profsong.text().replace(/\/watch\?v\=/,"/v/"),
            friends = $('.forumline:nth-of-type(2)'),
            name = $('div.nav a + span strong'),
            namecolor = name.css('color');
          var field = document.getElementById('field_id4');
field.style.display = "none";
field.nextSibling.style.display = "none";
            friends.after('<table width="100%" cellspacing="1" cellpadding="0" border="0" class="forumline"><tbody><tr><td class="catLeft"><span class="genmed module-title"><span style="color: '+namecolor+';"><strong>'+name.text()+'</strong></span>\'s Profile Song</span></td></tr><tr><td><object width= "298" height="24"><param name="movie" value="'+vid+'?autoplay=1&rel=0&fs=0&autohide=0"></param><param name="allowFullScreen" value="false"></param><param name="allowscriptaccess" value="always"></param><embed src="'+vid+'?autoplay=1&rel=0&fs=0&autohide=0" type="application/x-shockwave-flash" allowfullscreen="false" width="298" height="24" allowscriptaccess="always"></embed></object></td></tr></table>');
        } else {
            return;
        }
  } else {
      return;
  }
});

Make sure the link you put in your profile is a YouTube link otherwise it won't work. Hope i helped Wink
Kirbs
Kirbs
Forumember

Posts : 628
Reputation : 18
Language : English

Back to top Go down

In progress Re: Profile Songs?

Post by MockingJaye November 6th 2015, 1:40 pm

I was hoping to get a media player that would go under the friends section, also I tried what you put anyway cause whatever works works, so I did everything and when I went to put the link it just showed the link and didn't play music when I went to view my profile.
MockingJaye
MockingJaye
Forumember

Female Posts : 30
Reputation : 1
Language : English

http://infinitefairytail.canadian-forum.com/

Back to top Go down

In progress Re: Profile Songs?

Post by Kirbs November 6th 2015, 4:43 pm

Hi,

I just made an account on your website and i couldn't find that profile music field, make sure its visible on profiles
Kirbs
Kirbs
Forumember

Posts : 628
Reputation : 18
Language : English

Back to top Go down

In progress Re: Profile Songs?

Post by MockingJaye November 6th 2015, 6:48 pm

It was, I took it off, I had two of the admins check it out and they couldn't get it to play either.  They put the link in the field and nothing happened, just showed the link so I took it off.
MockingJaye
MockingJaye
Forumember

Female Posts : 30
Reputation : 1
Language : English

http://infinitefairytail.canadian-forum.com/

Back to top Go down

In progress Re: Profile Songs?

Post by Kirbs November 7th 2015, 12:17 am

I need you to put it back, once you do that let me know so i can find out the ID for the profile music field and give you the full code Wink
Kirbs
Kirbs
Forumember

Posts : 628
Reputation : 18
Language : English

Back to top Go down

In progress Re: Profile Songs?

Post by MockingJaye November 7th 2015, 7:34 pm

Okay, I put the code back in and everything.  You're ready to go.
MockingJaye
MockingJaye
Forumember

Female Posts : 30
Reputation : 1
Language : English

http://infinitefairytail.canadian-forum.com/

Back to top Go down

In progress Re: Profile Songs?

Post by Kirbs November 8th 2015, 3:11 pm

Hi,
Sorry for the late reply kinda busy with college any ways, replace the first javascript code i gave you with this and it should be ready to Wink
Code:

    $(function(){      var proffield = 'field_id-1';      if(RegExp("/u[0-9]+").test(window.location.pathname)) {          var mobileAgents = newRegExp("Android|BlackBerry|Blazer|BOLT|SymbianOS|Doris|Mobile|Phone|Fennec|GoBrowser|Iris|Maemo|MIB\/2\.2|Minimo|NetFront|Opera Mini|Opera Mobi|SEMC|Skyfire|Teleca|uZardWeb","i");         if(mobileAgents.test(navigator.userAgent)){            return;          }          var profsong =$("dl#"+proffield+" dt + dd div:first-of-type") || undefined;          if(!profsong) {            return;          }          var trueorfalse =profsong.text().trim().charAt(0) !== "-" ||false;          if(trueorfalse) {                var vid =profsong.text().replace(/\/watch\?v\=/,"/v/"),                            friends =$('#profile-advanced-right .module:eq(1)'),                name = $('.page-title span strong'),                namecolor =name.css('color');                $('dl#'+proffield).css('display','none').next().css('display','none');                friends.after('<table width="100%" cellspacing="1" cellpadding="0" border="0" class="forumline"><tbody><tr><td class="catLeft"><span class="genmed module-title"><span style="color: '+namecolor+';"><strong>'+name.text()+'</strong></span>\'sProfile Song</span></td></tr><tr><td><object width= "298" height="24"><param name="movie" value="'+vid+'?autoplay=1&rel=0&fs=0&autohide=0"></param><param name="allowFullScreen" value="false"></param><param name="allowscriptaccess" value="always"></param><embed src="'+vid+'?autoplay=1&rel=0&fs=0&autohide=0" type="application/x-shockwave-flash" allowfullscreen="false" width="298" height="24" allowscriptaccess="always"></embed></object></td></tr></table>');            } else {                return;            }      } else {          return;      }    });
Kirbs
Kirbs
Forumember

Posts : 628
Reputation : 18
Language : English

Back to top Go down

In progress Re: Profile Songs?

Post by MockingJaye November 8th 2015, 3:46 pm

Okay, I put the new script in but it's still not working, am I suppose to put the song in a special way, like you do with images or?
MockingJaye
MockingJaye
Forumember

Female Posts : 30
Reputation : 1
Language : English

http://infinitefairytail.canadian-forum.com/

Back to top Go down

In progress Re: Profile Songs?

Post by Kirbs November 8th 2015, 11:39 pm

Hi,
Try to replace it with this one and make sure the field is visible in profiles and the link you are using is a YouTube link.
Code:
        $(function(){          var proffield = 'JS_field_id1';          if(RegExp("/u[0-9]+").test(window.location.pathname)) {              var mobileAgents = newRegExp("Android|BlackBerry|Blazer|BOLT|SymbianOS|Doris|Mobile|Phone|Fennec|GoBrowser|Iris|Maemo|MIB\/2\.2|Minimo|NetFront|Opera Mini|Opera Mobi|SEMC|Skyfire|Teleca|uZardWeb","i");             if(mobileAgents.test(navigator.userAgent)){                return;              }              var profsong =$("#"+proffield+" .field_uneditable") ||undefined;              if(!profsong) {                return;              }              var trueorfalse =profsong.html().trim().charAt(0) !== "-" ||false;              if(trueorfalse) {                    var vid =profsong.text().replace(/\/watch\?v\=/,"/v/"),                                friends =$('#profile-advanced-right .module:eq(1)'),                    name = $('.page-title span strong'),                    namecolor =name.css('color');                    $('dl#'+proffield).css('display','none').next().css('display','none');                                   friends.after('<table width="100%" cellspacing="1" cellpadding="0" border="0" class="forumline"><tbody><tr><td class="catLeft"><span class="genmed module-title"><span style="color: '+namecolor+';"><strong>'+name.text()+'</strong></span>\'sProfile Song</span></td></tr><tr><td><object width= "298" height="24"><param name="movie" value="'+vid+'?autoplay=1&rel=0&fs=0&autohide=0"></param><param name="allowFullScreen" value="false"></param><param name="allowscriptaccess" value="always"></param><embed src="'+vid+'?autoplay=1&rel=0&fs=0&autohide=0" type="application/x-shockwave-flash" allowfullscreen="false" width="298" height="24" allowscriptaccess="always"></embed></object></td></tr></table>');                } else {                    return;                }          } else {              return;          }        });
Kirbs
Kirbs
Forumember

Posts : 628
Reputation : 18
Language : English

Back to top Go down

In progress Re: Profile Songs?

Post by MockingJaye November 8th 2015, 11:46 pm

replaced it, still not playing when I open up my profile.
MockingJaye
MockingJaye
Forumember

Female Posts : 30
Reputation : 1
Language : English

http://infinitefairytail.canadian-forum.com/

Back to top Go down

In progress Re: Profile Songs?

Post by Kirbs November 9th 2015, 3:05 pm

Hi,

Try using this one instead, if it doesnt work im sorry to inform you that i ran out of solutions o.o maybe someone else could help then.
Code:
 $(function(){
  if(RegExp("/u[0-9]+").test(window.location.pathname)) {
      var mobileAgents = new RegExp("Android|BlackBerry|Blazer|BOLT|SymbianOS|Doris|Mobile|Phone|Fennec|GoBrowser|Iris|Maemo|MIB\/2\.2|Minimo|NetFront|Opera Mini|Opera Mobi|SEMC|Skyfire|Teleca|uZardWeb","i");
      if(mobileAgents.test(navigator.userAgent)) {
        return;
      }
      var profsong = $("#field_id1 dt + dd div:first-of-type") || undefined;
      if(!profsong) {
        return;
      }
      var trueorfalse = profsong.text().trim().charAt(0) !== "-" || false;
      if(trueorfalse) {
            var vid = profsong.text().replace(/\/watch\?v\=/,"/v/"),
            friends = $('.forumline:nth-of-type(2)'),
            name = $('div.nav a + span strong'),
            namecolor = name.css('color');
          var field = document.getElementById('field_id4');
field.style.display = "none";
field.nextSibling.style.display = "none";
            friends.after('<table width="100%" cellspacing="1" cellpadding="0" border="0" class="forumline"><tbody><tr><td class="catLeft"><span class="genmed module-title"><span style="color: '+namecolor+';"><strong>'+name.text()+'</strong></span>\'s Profile Song</span></td></tr><tr><td><object width= "298" height="24"><param name="movie" value="'+vid+'?autoplay=1&rel=0&fs=0&autohide=0"></param><param name="allowFullScreen" value="false"></param><param name="allowscriptaccess" value="always"></param><embed src="'+vid+'?autoplay=1&rel=0&fs=0&autohide=0" type="application/x-shockwave-flash" allowfullscreen="false" width="298" height="24" allowscriptaccess="always"></embed></object></td></tr></table>');
        } else {
            return;
        }
  } else {
      return;
  }
});

Good luck!
Kirbs
Kirbs
Forumember

Posts : 628
Reputation : 18
Language : English

Back to top Go down

In progress Re: Profile Songs?

Post by MockingJaye November 10th 2015, 6:38 pm

Okay, I have tried that one and still not working.
MockingJaye
MockingJaye
Forumember

Female Posts : 30
Reputation : 1
Language : English

http://infinitefairytail.canadian-forum.com/

Back to top Go down

In progress Re: Profile Songs?

Post by Kirbs November 10th 2015, 10:24 pm

You need to stop removing the profile field.. Every time you do that it changes the field ID which is probably why the code is not working. Let me know when you add it back and this time do NOT remove it.
Kirbs
Kirbs
Forumember

Posts : 628
Reputation : 18
Language : English

Back to top Go down

In progress Re: Profile Songs?

Post by MockingJaye November 10th 2015, 10:43 pm

I put the last three codes in and didn't remove the field. It didn't work and it really wasn't what I/we wanted on our forum in the first place but if it worked, it worked but it didn't.
MockingJaye
MockingJaye
Forumember

Female Posts : 30
Reputation : 1
Language : English

http://infinitefairytail.canadian-forum.com/

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum