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 = ";
$rp .= ".XOOPS_URL."/Frameworks/textsanitizer/plugins/FMP3/FMP3.swf?mp3=\5&action=stop&title=\4&color=\2&loop=no&lma=no&textcolor=\3'>";
$rp .= "";
$rp .= "";
$rp .= "";
$rp .= "";
$rp .= "";
$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 .= ".$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….