Maybe someone will find what from the 1. extension we have to add to 2. extension to make the URL catching within mp3 tags go away...
1. VideoTag manifest.xml
[code=xml]
<hooks>
<hook id="he_new_bbcode_link"><![CDATA[
// add our lang file
if (file_exists($ext_info['path'].'/lang/'.$forum_user['language'].'.php')) {
require($ext_info['path'].'/lang/'.$forum_user['language'].'.php');
} else {
require($ext_info['path'].'/lang/English.php');
}
$lang_help = array_merge($lang_help, $lang_help_video);
?>
<div class="entry-content">
<code>[video]<?php echo $lang_help['video_uri'] ?>[/video]</code><span><?php echo $lang_help['produces'] ?></span>
<?php echo $lang_help['video_display'] ?>
</div><?php
]]></hook>
<hook id="ps_start"><![CDATA[
// tag handling function
function handle_video_tag($videoUri) {
global $forum_config;
$match = array();
// dirty trick to play arround do_clickable
preg_match('`href="([^"]+)"`', stripslashes($videoUri), $match);
if(!empty($match[1])) {
$videoUri = $match[1];
}
// the services list
$service = array(
'youtube' => array(
'match'=>'`watch\?v=([-_a-z0-9]+)`i',
'uri'=>'http://www.youtube.com/v/%s&rel=0',
'width'=>425,
'height'=>344
),
'dailymotion' => array(
'match'=>'`video/([a-z0-9]+)_`i',
'uri'=>'http://www.dailymotion.com/swf/%s&amp;related=0&amp;canvas=medium',
'width'=>480,
'height'=>381
),
'vimeo' => array(
'match'=>'`/([0-9]+)`',
'uri'=>'http://www.vimeo.com/moogaloop.swf?clip_id=%s&server=vimeo.com&show_title=1&show_byline=1&show_portrait=0&fullscreen=1',
'width'=>400,
'height'=>302
),
'google' => array(
'match'=>'`\?docid=(-?[0-9]+)`',
'uri'=>'http://video.google.com/googleplayer.swf?docId=%s',
'width'=>425,
'height'=>364
)
);
// extract service's name and check for support
preg_match('`^http://(?:[^\.]*\.)?([^\.]*)\.[^/]*/`i', $videoUri, $match);
if(empty($match[1]) || !array_key_exists($match[1], $service)) {
return '<a href="'.$videoUri.'">[video (unkown provider)]</a>';
}
$s = $service[$match[1]];
// extract videoId
preg_match($s['match'], $videoUri, $match);
if(empty($match[1])) {
return '<a href="'.$videoUri.'">[video (cant extract ID)]</a>';
}
$playerUri = sprintf($s['uri'], $match[1]);
// display flash player
return
'<object type="application/x-shockwave-flash" data="'.$playerUri.'" width="'.$s['width'].'" height="'.$s['height'].'">'.
'<param name="movie" value="'.$playerUri.'" />'.
'<param name="wmode" value="transparent" />'.
'<param name="allowfullscreen" value="true" />'.
'<p><a href="'.$videoUri.'">[video (flash player not installed)]</a></p>'.
'</object>';
}
]]></hook>
<hook id="ps_preparse_tags_start"><![CDATA[
// add our tag to the list
$tags[] = 'video';
$tags_opened[] = 'video';
$tags_closed[] = 'video';
$tags_inline[] = 'video';
$tags_trim[] = 'video';
// we must allow url due to do_clickable
$tags_limit_bbcode['video'] = array('url');
]]></hook>
<hook id="ps_do_bbcode_replace"><![CDATA[
// add pattern to catch [video]blahblah[/video]
$pattern[] = '`\[video\]([^\[]+)\[/video\]`e';
$replace[] = 'handle_video_tag(\'$1\')';
]]></hook>
</hooks>
[/code]
2. MP3 Player manifest.xml
[code=xml]
<hooks>
<hook id="ps_parse_message_post_merge"><![CDATA[
// Mod: Flash MP3 Player (8 new lines follow)
$player_url = $ext_info['path'].'/dewplayer-multi.swf';
$player_bgcolor = 'ffffff';
$player_width = 240;
$player_height = 20;
$player_param = '?bgcolor='.$player_bgcolor.'&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\]("|\"|'|)(.*?)\\1\[/mp3\]#", $player_code, $text);
$text = preg_replace("/\[mp3 url=("|\"|'|)(.*?)\\1\]/", $player_code, $text);
]]></hook>
<hook id="po_qr_get_quote"><![CDATA[
// Mod: Flash MP3 Player (1 new line follow)
$q_message = preg_replace("/\[mp3 url=("|\"|'|)(.*?)\\1\]/", "$2", $q_message);
]]></hook>
</hooks>
[/code]