Tagging: @Jscript
Last edited by Eugeo Ayano on January 15th 2015, 3:18 am; edited 1 time in total
_playSound function (url) {
 document.getElementById ("sound") innerHTML = "<embed src = '" + url + "' hidden = true autostart = true loop = false>.";
}
I had forgotten to get back to this topic. I saw the code but where would I change the forum version since the code is for phpBB2 and I have phpBB3. Also, when I create the profile field what settings do I have to use? Sorry if I sound a bit noobish when it comes to JS @CrystalsoulCrystalSoul wrote:http://www.avacweb.com/t1482-profile-songs-for-phpbb-2?highlight=profile+songs
Hey, here is the code but you need to adjust it depending on what type of forum you have and the profile field you are going to use.
$(function(){
  if(_userdata.user_level == 1){
 Â
$('head').append(' <style>#pflinfo {color: red;font-weight:
bold;background: none repeat scroll 0% 0% black;display:
inline-block;padding: 5px;border: 1px solid white;border-radius:
5px;transition: 2s;}#pflinfo:hover {font-size:3em;padding:
10px;}</style> ')
  $('#profile-tab-field-profil dl').each(function(){
  $(this).append(' <span id="pflinfo" style="">'+$(this).attr("id")+'</span> ');});
Â
 $('#profile-advanced-details dl').each(function(){$(this).append('
<span id="pflinfo" style="">'+$(this).attr("id")+'</span>
');
  });}});
$(function(){
var proffield = 'field_id-9';
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 = $("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>\'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;
}
});
field_id-9
$(function(){
var proffield = 'field_id-8';
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 = $("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>\'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;
}
});
profile_field_13_10
$(function(){
var proffield = 'profile_field_13_10';
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 = $("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>\'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;
}
});
$(function(){
var proffield = 'JS_field_id10';
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 = $("#"+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>\'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;
}
});