Topic: [mp3][/mp3] Mod - Updated from a 1.2 release...

Hi

I did not make this Mod, I simply updated some of the coding to work with punbb 1.3.4.
All credit goes to the original author whos 1.2 Mod can be found here

Ok first step is to download the original mod and extract the flash player "dewplayer-multi.swf"

Then follow the below instructions.

##
##
##          Mod title :  Flash MP3 Player
##
##        Mod version :  2.0.0
##     Works on PunBB :  mod tested on the 1.3.4 version
##       Release date :  2009-12-12
##
##    Original Author :  Nicolas D. a.k.a. nicolas2k10 (nicolas2k10 at gmail.com)
    Update Author :      Source Code

##
##        Description :  This mod add the BBCode mp3 tag.
##                       This tag makes possible the insertion of a flash mp3 player in the posts.
##                       The MP3 files provided in parameter can be local or distant (http).
##
##              Usage :  One file : [mp3 url="path/file.mp3"]
##                       Many files : [mp3 url="path/file1.mp3|path/file2.mp3"]
##
##     Affected files :  include/parser.php
##                       post.php
##
##         Affects DB :  No
##
##              Notes :  This mod is based on a contribution of "Ju"
##                       (http://forums.punbb.org/viewtopic.php?id=7398) and use
##                       the DewPlayer (http://www.alsacreations.fr/?dewplayer).
##                       The flash code which is produced is valid Xhtml 1.0 Strict.
                 
                **** All credit goes to the original author and those mentioned above ****
##
##
##         DISCLAIMER :  Please note that "mods" are not officially supported by
##                       PunBB. Installation of this modification is done at your
##                       own risk. Backup your forum database and any and all
##                       applicable files before proceeding.
##



#
#---------[ 1. UPLOAD ]--------------------------------------------------------
#

dewplayer-multi.swf to /


#------------------------------------------------------------------------------
#
#---------[ 2. OPEN ]----------------------------------------------------------
#
#------------------------------------------------------------------------------

include/parser.php


#
#---------[ 3. FIND ]---------------------------------------------
#

        // Add paragraph tag around post, but make sure there are no empty paragraphs
    $text = preg_replace('#<br />\s*?<br />((\s*<br />)*)#i', "</p>$1<p>", $text);
    $text = str_replace('<p><br />', '<p>', $text);
    $text = str_replace('<p></p>', '', '<p>'.$text.'</p>');


#
#---------[ 4. AFTER, ADD ]----------------------------------------------------
#

    // Mod: Flash MP3 Player (8 new lines follow)
    $player_url     = 'dewplayer-multi.swf';
    $player_bgcolor = 'ffffff';
    $player_width   = 240;
    $player_height  = 20;
    $player_param   = '?bgcolor='.$player_bgcolor.'&amp;mp3=$2';  // For more options: http://www.alsacreations.fr/?dewplayer
    $player_alternative = '<strong>Flash not detected</strong>';
    $player_code = "\n\t\t\t\t\t<object type=\"application/x-shockwave-flash\" data=\"".$player_url.$player_param."\" width=\"".$player_width."\" height=\"".$player_height."\">\n\t\t\t\t\t  <param name=\"movie\" value=\"".$player_url.$player_param."\" />\n\t\t\t\t\t  <param name=\"bgcolor\" value=\"#".$player_bgcolor."\" />\n\t\t\t\t\t  ".$player_alternative."\n\t\t\t\t\t</object>\n\t\t\t\t\t";
    $text = preg_replace("/\[mp3 url=(&quot;|\"|'|)(.*?)\\1\]/", $player_code, $text);


#------------------------------------------------------------------------------
#
#---------[ 5. OPEN ]----------------------------------------------------------
#
#------------------------------------------------------------------------------

post.php


#
#---------[ 6. FIND ]---------------------------------------------
#

        list($q_poster, $q_message) = $forum_db->fetch_row($result);


#
#---------[ 7. AFTER, ADD ]----------------------------------------------------
#

        // Mod: Flash MP3 Player (1 new line follow)
        $q_message = preg_replace("/\[mp3 url=(&quot;|\"|'|)(.*?)\\1\]/", "[url]$2[/url]", $q_message);


#------------------------------------------------------------------------------
#
#---------[ 8. SAVE/UPLOAD ]---------------------------------------------------
#
#------------------------------------------------------------------------------

Once again full credit to the original author(s).

Re: [mp3][/mp3] Mod - Updated from a 1.2 release...

Could you create an extension based on this mod, please?

Re: [mp3][/mp3] Mod - Updated from a 1.2 release...

I have finished it! big_smile

http://punbb.informer.com/forums/topic/ … lease-mp3/

Taiwan is a country.
I am sorry for my English.