Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Sign In
Not a member yet? Click here to register.
Navigation

How to use MP3 BBCode in ver9?

Last updated on 10 months ago
GrimlochGrimloch
Posted 10 months ago
I understand how to include BBCodes in a page and can actually set a url to an MP3. But at page display time I only get the code line itself as in:
[mp3]https://mp3url.com/music.xxx.mp3[/mp3]
... and that's all. The file doesn't play. What is the coding to display/play the mp3 file? I know that for a form html you would use:
".display_html("userform", "content", true, false, true, true)."
and for the BBCodes you would use:
".display_bbcodes("100px;", "content", "userform", "mp3")."
(the mp3 entry being the only thing I want to use in the edit form); but then on the display page how do you show/display/play the mp3?

Nevermind guys: Sorry I forgot about parseubb - Works fine.
Edited by Grimloch on 15-03-2020 07:48, 10 months ago
HarlekinHarlekin
Posted 10 months ago
The mp3 bbcode from V7 works with flash and flash need a manual activation in the browser to play. The Flash Player will be discontinued this year and the browser plugin will no longer be run in the future.

The solution would be an mp3 bbcode with the audio tag.

Open mp3_bbcode_include.php and replace:
$text = preg_replace('#\[mp3\](.*?)\[/mp3\]#si', '<strong>'.$lang['bb_mp3'].'</strong> <object type=\'application/x-shockwave-flash\' width=\'17\' height=\'17\' data=\''.INCLUDES.'HP_bbcodes/mp3player/mp3player.swf?&amp;song_url=\1\'><param name=\'movie\' value=\''.INCLUDES.'HP_bbcodes/mp3player/mp3player.swf?&amp;song_url=\1\'><param name=\'wmode\' value=\'transparent\'><param name=\'quality\' value=\'high\'><param name=\'bgcolor\' value=\'#eeeeee\'></object>', $text);

with:
$text = preg_replace('#\[mp3\](.*?)\[/mp3\]#si', '<strong>'.$lang['bb_mp3'].'</strong><br /><audio src="\1" controls="" controlslist="nodownload"></audio>', $text);


It works well for me
GrimlochGrimloch
Posted 10 months ago
@Harlekin
:
Hey man thanks this works great for me as well as shown in this image.
fortworthbonsai.org/my_stuff/mp3.jpg
... but I have a question. Is there a way to change the bgcolor of the player background?
HarlekinHarlekin
Posted 10 months ago
I haven't dealt with that yet. This is probably browser dependent. Take a look at the player with Firefox, Edge, Opera or Chrome, it looks different.
Edited by Harlekin on 15-03-2020 20:20, 10 months ago
GrimlochGrimloch
Posted 10 months ago
Yeah I see what you mean. I researched audio tag attributes and settings and bgcolor is not an option. Not a problem; as I use Firefox I simply enclosed the player in a table cell w/bgcolor. Take a look if you'd like.
https://fortworthbonsai.org/user_page...php?user=1
Edited by Grimloch on 16-03-2020 14:45, 10 months ago
afosterafoster
Posted 10 months ago
Looks great, nice work.
You can view all discussion threads in this forum.
You cannot start a new discussion thread in this forum.
You cannot reply in this discussion thread.
You cannot start on a poll in this forum.
You cannot upload attachments in this forum.
You can download attachments in this forum.
You cannot up or down-vote on the post in this discussion thread.
You cannot set up a bounty in this discussion thread.
Moderator: Support Team
Users who participated in discussion: afoster, Grimloch, Harlekin,