The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Add mp3 bb code in topics

View previous topic View next topic Go down

Solved Add mp3 bb code in topics

Post by chandoi on January 10th 2015, 5:35 pm

I am desperated to find out how to add mp3 bb code to my forum phpbb3 such as [mp3]url[/mp3] to post music in the topic. 
Please help.
Thanks


Or is there anyway to have the bb code like something similar to this site from phpbb?


Just from my forum, I can not get into 
 tab "Posting", page "BBCodes", add BBCode for me to install manually

chandoi
Forumember

Posts : 39
Reputation : 2
Language : English

http://4everfriends.forumvi.com

Back to top Go down

Solved Re: Add mp3 bb code in topics

Post by chandoi on January 12th 2015, 5:16 pm

Can someone help me to put these codes into my forum?


bbcode usage:
CODE: SELECT ALL
[mp3]{URL}[/mp3]



HTML replacement:
CODE: SELECT ALL
<object type="application/x-shockwave-flash" data="mp3player/emff_lila_info.swf" width="200" height="55">
<param name="allowScriptAccess" value="sameDomain">
<param name="movie" value="mp3player/emff_lila_info.swf" />
<param name="quality" value="high">
<param name="FlashVars" value="src={URL}" />
<embed src="mp3player/emff_lila_info.swf" quality="high" name="lilaplayer" allowscriptaccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" align="middle" width="200" height="55">
</object>


chandoi
Forumember

Posts : 39
Reputation : 2
Language : English

http://4everfriends.forumvi.com

Back to top Go down

Solved Re: Add mp3 bb code in topics

Post by Ange Tuteur on January 13th 2015, 5:11 am

Hello @chandoi,

Try this :
Go to Administration panel > Modules > JavaScript codes management > Create a new script

Title : Your choice
Placement : In all the pages
Code:
$(function(){$(function(){
  var icone = '';
  for (var i=0,p=$('.post .content'); i<p.length; i++) if (p[i].innerHTML.match(/\[mp3 src=".*?"\]\[\/mp3\]/i)) p[i].innerHTML = p[i].innerHTML.replace(/\[mp3 src="(.*?)"\]\[\/mp3\]/i,'<object type="application/x-shockwave-flash" data="mp3player/emff_lila_info.swf" width="200" height="55"><param name="allowScriptAccess" value="sameDomain"><param name="movie" value="mp3player/emff_lila_info.swf" /><param name="quality" value="high"><param name="FlashVars" value="src=$1" /><embed src="mp3player/emff_lila_info.swf" quality="high" name="lilaplayer" allowscriptaccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" align="middle" width="200" height="55"></object>');
  $('.sceditor-button-youtube').after('<a class="sceditor-button sceditor-button-mp3"><div style="background-image:url('+icone+')"></div></a>');
  $('.sceditor-button-mp3').click(function() { $('#text_editor_textarea').sceditor('instance').insertText('[mp3 src="','"][/mp3]') });
})});

Icone is the image of the button, by default it'll be blank next to the youtube button. Insert the url of your file into the src attribute. I'm not sure if the code you provide will work though, but you can try.. Wink

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2683
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Add mp3 bb code in topics

Post by chandoi on January 13th 2015, 8:49 pm

Thanks for the help!
Anyway, this is the URL I inserted after pressing blank button:
[mp3 src="http://k003.kiwi6.com/hotlink/7u30zk92jy/Nh_c_kh_ng_l_i_-_Nh_c_th_nh_ph_ng_-_Petalia.org.mp3"][/mp3]



It turned out blank white

chandoi
Forumember

Posts : 39
Reputation : 2
Language : English

http://4everfriends.forumvi.com

Back to top Go down

Solved Re: Add mp3 bb code in topics

Post by chandoi on January 14th 2015, 8:22 pm

Why can't we have the BB code usage function in ACP?
It will be a lot easier for everyone who wants to add custom BB codes

chandoi
Forumember

Posts : 39
Reputation : 2
Language : English

http://4everfriends.forumvi.com

Back to top Go down

Solved Re: Add mp3 bb code in topics

Post by Ange Tuteur on January 15th 2015, 6:59 am

Try this instead :
Code:
$(function(){$(function(){
  var icone = '';
  for (var i=0,p=$('.post .content'); i<p.length; i++) if (p[i].innerHTML.match(/\[mp3 src=".*?"\]\[\/mp3\]/i)) p[i].innerHTML = p[i].innerHTML.replace(/\[mp3 src="(.*?)"\]\[\/mp3\]/i,'<audio controls><source src="$1" type="audio/mpeg"/>Sorry, the audio tag is not supported.</audio>');
  $('.sceditor-button-youtube').after('<a class="sceditor-button sceditor-button-mp3"><div style="background-image:url('+icone+')"></div></a>');
  $('.sceditor-button-mp3').click(function() { $('#text_editor_textarea').sceditor('instance').insertText('[mp3 src="','"][/mp3]') });
})});

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2683
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Add mp3 bb code in topics

Post by chandoi on January 15th 2015, 5:01 pm

It works! Thank you.
The only thing is how I insert an image instead of a blank space after youtube in the editor.

chandoi
Forumember

Posts : 39
Reputation : 2
Language : English

http://4everfriends.forumvi.com

Back to top Go down

Solved Re: Add mp3 bb code in topics

Post by Ange Tuteur on January 16th 2015, 8:32 am

where you see icone = '' in the script I gave you. You insert your image between the quotes. Like this :
icone = 'http://i59.servimg.com/u/f59/18/21/41/30/set2_a11.gif'

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2683
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Add mp3 bb code in topics

Post by chandoi on January 18th 2015, 11:17 pm

All good! Thank you very much. You da man.... Very Happy
You can lock this topic now.

chandoi
Forumember

Posts : 39
Reputation : 2
Language : English

http://4everfriends.forumvi.com

Back to top Go down

Solved Re: Add mp3 bb code in topics

Post by Ange Tuteur on January 18th 2015, 11:56 pm

You're welcome ^^

Topic archived

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2683
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

View previous topic View next topic Back to top


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