Save me sending files that might get changed later, here is all the code to add a built-in Flash MP3 player:
Frameworks/textsanitizer/config.php
define('EXTCODE_ENABLE_FMP3', 1); // FMP3
Frameworks/textsanitizer/module.textsanifizer.php
if (EXTCODE_ENABLE_FMP3 == 1){$this->loadExtension("fmp3");}
Frameworks/textsanitizer/plugins/fmp3.php
function textsanitizer_fmp3(&$ts)
{$ts->patterns[] = "/[fmp3=(['"]?)([^"']*),([^"']*),([^"']*)\1]([^"]*)[/fmp3]/sU";
$rp = "<object id='fmp3' width='260' height='60' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0'>";
$rp .= "<param name='movie' value='".XOOPS_URL."/Frameworks/textsanitizer/plugins/FMP3/FMP3.swf?mp3=\5&action=stop&title=\4&color=\2&loop=no&lma=no&textcolor=\3'>";
$rp .= "<param name='quality' value='high'>";
$rp .= "<param name='bgcolor' value='#FFFFFF'>";
$rp .= "<param name='wmode' value='transparent'>";
$rp .= "<embed src='".XOOPS_URL."/Frameworks/textsanitizer/plugins/FMP3/FMP3.swf?mp3=\5&action=stop&title=\4&color=\2&loop=no&lma=no&textcolor=\3' width='260' height='60' quality='high' bgcolor='#FFFFFF' wmode='transparent' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' name='fmp3' allowScriptAccess='sameDomain'></embed>";
$rp .= "</object>";
$ts->replacements[] = $rp;}
Frameworks/textsanitizer/plugins/fmp3/
Place these files into its own folder.class/xoopseditor/dhtmlext/xoops.js
function xoopsCodeFMP3(id, enterFMP3Phrase, enterFMP3ColorBgPhrase, enterFMP3ColorPhrase, enterFMP3TitlePhrase){var selection = getSelect(id);
if (selection.length > 0){var text = selection;}
else{var text = prompt(enterFMP3Phrase, "");}
var domobj = xoopsGetElementById(id);
if (text.length>0){var text2 = prompt(enterFMP3ColorBgPhrase, "ffffff");
var text3 = prompt(enterFMP3ColorPhrase, "000000");
var text4 = prompt(enterFMP3TitlePhrase, "");
var result = "[fmp3="+text2+","+text3+","+text4+"]" + text + "[/fmp3]";
xoopsInsertText(domobj, result);}
domobj.focus();}
class/xoopseditor/dhtmlext/dhtmlext.php
if(defined("EXTCODE_ENABLE_FMP3") && EXTCODE_ENABLE_FMP3 == 1){$code .= "<img src='".$image_path."/mp3.gif' alt='"._ALTFMP3."' onclick='xoopsCodeFMP3("$textarea_id","".htmlspecialchars(_ENTERFMP3URL, ENT_QUOTES)."","".htmlspecialchars(_ENTERCOLORBG, ENT_QUOTES)."","".htmlspecialchars(_ENTERCOLOR, ENT_QUOTES)."","".htmlspecialchars(_ENTERTITLE, ENT_QUOTES)."");' onmouseover='style.cursor="hand"'/> ";}
class/xoopseditor/dhtmlext/languages.php
define("_ENTERCOLORBG", "background color:");
define("_ENTERCOLOR", "color:");
define("_ENTERFMP3URL", "MP3 URL:");
define("_ENTERTITLE", "title:");
There is an option for looping the music, yet since this is only practical on a musicians site; to begin haven’t made this as an option, as it begins to get confusing when you have too many options for BBcode, which is suppose to be simple….