〖原创〗〖笨笨的第三个PW_hack〗————增强自带的wmv功能,使其能控制大小以及自
这是一个比较简单的hack,只是增加了一个函数而矣首先,先备份:)
现在开始
打开require/bbscode.php
找到
if($allow['mpeg']){
然后在和标签之后,另加入以下代码段
/*
在此处添加标签。
此代码由笨笨啊书写
2005/09/30
netknave@163.com
*/
global $temptext; //用变量来清晰代码
$temptext="<object id=\"NSPlay\" width=\\2 height=\\4 classid=\"CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95\" codebase=\"http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715\" standby=\"Loading Microsoft Windows Media Player components...\" type=\"application/x-oleobject\">";
$temptext.="<param name=\"AutoRewind\" value=1>";
$temptext.="<param name=\"FileName\" value=\"\\8\">";
$temptext.="<param name=\"ShowControls\" value=\"1\">";
$temptext.="<param name=\"ShowPositionControls\" value=\"1\">";
$temptext.="<param name=\"ShowAudioControls\" value=\"1\">";
$temptext.="<param name=\"ShowTracker\" value=\"1\">";
$temptext.="<param name=\"ShowDisplay\" value=\"0\">";
$temptext.="<param name=\"ShowStatusBar\" value=\"0\">";
$temptext.="<param name=\"ShowGotoBar\" value=\"0\">";
$temptext.="<param name=\"ShowCaptioning\" value=\"0\">";
$temptext.="<param name=\"AutoStart\" value=\\6>";
$temptext.="<param name=\"Volume\" value=\"80\">";
$temptext.="<param name=\"AnimationAtStart\" value=\"0\">";
$temptext.="<param name=\"TransparentAtStart\" value=\"0\">";
$temptext.="<param name=\"AllowChangeDisplaySize\" value=\"1\">";
$temptext.="<param name=\"AllowScan\" value=\"1\">";
$temptext.="<param name=\"EnableContextMenu\" value=\"1\">";
$temptext.="<param name=\"ClickToPlay\" value=\"1\">";
$temptext.="</object>";
$temptext.="<br /><br />[<a target=_blank href=\\8>点击这里下载此歌曲</a>]";
$message = preg_replace("/(\)(.+?)(\[\/mp\])/is",$temptext,$message);
在下面的
}else{
$message = preg_replace("/(\)(.+?)(\[\/wmv\])/is","<img src='$imgpath/$stylepath/file/music.gif' align='absbottom'> <a target=_blank href='\\2'>\\2</a>",$message);
$message = preg_replace("/(\)(.+?)(\[\/rm\])/is","<img src='$imgpath/$stylepath/file/music.gif' align='absbottom'> <a target=_blank href='\\2'>\\2</a>",$message);
以后,再加入
$message = preg_replace("/(\)(.+?)(\[\/mp\])/is","<img src='$imgpath/$stylepath/file/music.gif' align='absbottom'> <a target=_blank href='\\8'>\\8</a>",$message);
保存bbscode.php退出
再打开
data/wind_editor.js
到文件最末尾的}之后,新加一个函数
function mpadd()
{
if (helpmode)
{
alert('mp标签\\n使用mp标记,可以输入可以控制大小以及是否自动播放的播放器.\\n使用方法:\\n ed2k下载地址\n例如,http://localhost/aa.mp3 \n表示的是建立一个400*300的播放器,且自动播放');
}
else if (nomode || document.selection && document.selection.type == "Text")
{
AddTxt="\n"+text+"\n";
AddText(AddTxt);
} else {
txt=prompt('输入播放器的长宽,以及是否自动播放',"400,300,true");
AddTxt="\n";
txt=prompt('输入要播放的电影绝对URL,如\nhttp://www.zjoubbs.com/aaa.mp3',"http://");
AddTxt=AddTxt+txt+"\n";
AddText(AddTxt);
}
}
保存退出
打开template\wind\editor.htm
找到
<img onClick=wmv() alt='插入wmv在线播放' src='$imgpath/post/editor/mpeg.gif' >
替换为
<img onClick=mpadd() alt='插入wmv在线播放' src='$imgpath/post/editor/mpeg.gif' >
<!--
<img onClick=wmv() alt='插入wmv在线播放' src='$imgpath/post/editor/mpeg.gif' >
-->
OK
搞定了
这时,再点击那个wmv播放器的时候,将会提示输入长,宽,是否自动播放
默认的值请在js里修改 强烈要求图片也能控制大小 对了RM格式最好也能控制 这样为了兼容性,最好是另外写一段代码,嗯,好的,这个我试试
页:
[1]