What is the ?

The is a minimalist Flash™ MP3 free player. I was admiring the easiness of using the Wordpress plugin “Audio Player” from Martin Laine in my Blog and was so surprised to not find such a MOD for my phpBB forum.
So I decided to build one, not as brilliant for the moment as the Martin Laine’s one, but who knows what will be the future of the
?


The and phpBBThe

The is actually dedicated to a MOD for phpBB forums.
Source modifications are very light: only 2 small portions of source code to be inserted into includes/bbcode.php file.

 

How does the forum member use it?

He just has to use the [mp3] [/mp3] bbcodes around his MP3 url, and the published post will show the player ready to load and play this mp3 file.
 

How does the player work?

Well, it just loads an mp3 file and plays it when you press the play button.
Once the file is loaded, you can access any position in the file by just clicking on the loading bar. No “advanced” feature like setting up pan or volume. I don’t have much time and I don't think it is very useful, is it?

 

A very simple 3 steps MOD installation

NOTE: MOD was created for version 2.0.19 of phpBB forum but should work for many previous versions.

Download and unzip the archive.
In your phpBB forum root directory, make a “plugin” subdirectory and put the “jcfplayer.swf” file in it.
Do the following source modifications:

In includes/bbcode.php file:

Find :

// [CODE] and [/CODE] for posting code (HTML, PHP, C etc etc) in your posts.
$text = bbencode_second_pass_code($text, $uid, $bbcode_tpl);

Insert after:

// JCFPluginMarker =============================== Start
$text = str_replace("[mp3:$uid]", '<object type="application/x-shockwave-flash" data="plugin/jcfplayer.swf" width="310" height="30" id="audioplayer1"><param name="movie" value="plugin/jcfplayer.swf" /><param name="FlashVars" value="soundFile=', $text);
$text = str_replace("[/mp3:$uid]", '" /><param name="quality" value="high" /><param name="menu" value="false" /><param name="wmode" value="transparent" /></object>', $text);
// JCFPluginMarker =============================== End

Find :


function bbencode_first_pass($text, $uid)
{
// pad it with a space so we can distinguish between FALSE and matching the 1st char (index 0).
// This is important; bbencode_quote(), bbencode_list(), and bbencode_code() all depend on it.
$text = " " . $text;


Insert after :

// JCFPluginMarker =============================== Start
// [MP3] and [/MP3]
$text = bbencode_first_pass_pda($text, $uid, '[mp3]', '[/mp3]', '', false, '');
// JCFPluginMarker =============================== End

That’s it! Should be working now.


I have tested it for Internet Explorer and Mozilla Firefox. I don’t know for the other browsers…

 

Future releases?

I don’t know.
I just made this for an urgent personal need, and when I saw the final result, pretty surprised it is working quite properly, I thought it could interest some other phpBB masters! :)
If it does, maybe I will propose new versions with a proper “fixed bugs list” and “brand new features list”.
I’m especially thinking of different skins.
We’ll see...

Jcfrog, march the 18th, 2006.


LovizoL (c) 2006 - All rights reserved