$message = preg_replace("/[mp](.+?)[/mp]/eis","mediaplayer('\1','-01')",$message);
preg_replace("/([flv=)([0-9]{1,3})(,)([0-9]{1,3})(,)([0-1]{1,1})(])(.+?)([/flv])/eis","flv('\8','\6','\2','\4')",$message);[Copy to clipboard]
?>
function flv($url,$auto,$width=450,$height=350) { global $player_num,$player_pre; $pid=$player_pre.'_'.$player_num; $auto==1?$auto="&autoPlay=true":$auto=''; $player="<object style='width:{$width}px; height:{$height}px;' id='VideoPlayback' align='middle' type='application/x-shockwave-flash' data='image/flv.swf?videoUrl={$url}&thumbnailUrl=flv.jpg&playerMode=normal$auto'> "; $player.="<param name='allowScriptAccess' value='sameDomain' />"; $player.="<param name='movie' value='image/flv.swf?videoUrl={$url}&thumbnailUrl=flv.jpg&playerMode=normal$auto'/>"; $player.="<param name='quality' value='best' />"; $player.="<param name='bgcolor' value='#ffffff' />"; $player.="<param name='scale' value='noScale' />"; $player.="<param name='wmode' value='window' />"; $player.="<param name='salign' value='TL' /> </object>"; $player_num++; Return $player;}
function flv() { if (helpmode){ alert("flv影片插入 flv 影片.用法: [flv=宽度,高度,自动]flv 文件的地址[/rm]"); } else if (nomode || document.selection && document.selection.type == "Text") { AddTxt=" [flv=450,340,1]"+text+"[/flv]"; AddText(AddTxt); } else { txt2=prompt("宽度,高度,自动","450,340,1"); if (txt2!=null) { txt=prompt("flv 文件的地址","http://"); if (txt!=null) { if (txt2=="") { AddTxt="[flv=450,340,1]"+txt; AddText(AddTxt); AddTxt="[/flv]"; AddText(AddTxt); } else { AddTxt=" [flv="+txt2+"]"+txt; AddText(AddTxt); AddTxt="[/flv]"; AddText(AddTxt); } } } }}
<img onClick=mp3() alt='插入mp3在线播放' src='$imgpath/post/editor/mp3.gif' >
<img onClick=flv() alt='插入flv文件在线播放' src='$imgpath/post/editor/flv.gif' >
引用第2楼cjz974于2006-05-10 22:05发表的“”:演示?