|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
- 多媒体在线播放*自定义窗口大小*是否自动播放*插入按扭* FOR D4
- 本插件只有简单的几个功能:
- 1. 支持WMV和RM类型文件在线播放(支持flash)
- 2. 自定义播放窗口大小
- 3. 可定义是否自动播放
- 4. 播放文件插入按扭
- 手动插入格式(宽、高、自播)默认为:
- [wmv=360,300,1]http://[/wmv]
- [rm=360,300,1]http://[/rm]
- 需要修改的文件有
- include/discuzcode.func.php
- include/bbcode.js
- templates\default\templates.lang.php
- templates\default\post_bbinsert.htm
- 打开include/discuzcode.func.php,查找
- CODE:[Copy to clipboard]"/\[img\]\s*([^\[\<\r\n]+?)\s*\[\/img\]/ies",
- 下面添加:
- CODE:[Copy to clipboard] "/\[swf=(\d+?)[x|\,](\d+?)\]\s*(.+?)\s*\[\/swf\]/ies",
- "/\[wmv\]\s*(.+?)\s*\[\/wmv\]/ies",
- "/\[mp3\]\s*(.+?)\s*\[\/mp3\]/ies",
- "/\[ron\]\s*(.+?)\s*\[\/ron\]/ies",
- "/\[rm\]\s*(.+?)\s*\[\/rm\]/ies",
- "/\[wmv=(\d+?)[x|\,](\d+?)[x|\,](\d+?)\]\s*(.+?)\s*\[\/wmv\]/ies",
- "/\[rm=(\d+?)[x|\,](\d+?)[x|\,](\d+?)\]\s*(.+?)\s*\[\/rm\]/ies",
- 查找
- CODE:[Copy to clipboard] "bbcodeurl('\\1', ' <img src="images/attachicons/flash.gif" align="absmiddle"> <a href="%s" target="_blank">Flash: %s</a> ')",
- 替换为
- CODE:[Copy to clipboard] "bbcodeurl('\\1', ' <img src="images/attachicons/flash.gif" align="absmiddle"> <a href="%s" target="_blank">在新窗口中打开</a><br><br><embed width="360" height="300" src="%s" type="application/x-shockwave-flash"></embed>')",
- 查找(紧跟着这段)
- CODE:[Copy to clipboard] "bbcodeurl('\\1', '<img src="%s" border="0" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt=\'Click here to open new window\\nCTRL+Mouse wheel to zoom in/out\';}" onmouseover="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor=\'hand\'; this.alt=\'Click here to open new window\\nCTRL+Mouse wheel to zoom in/out\';}" onclick="if(!this.resized) {return true;} else {window.open(\'%s\');}" onmousewheel="return imgzoom(this);">')",
- 在下面添加:
- CODE:[Copy to clipboard] "bbcodeurl('\\1', ' <img src="images/attachicons/flash.gif" align="absmiddle"> <a href="%s" target="_blank">在新窗口中打开</a><br><br><embed width="360" height="300" src="%s" type="application/x-shockwave-flash"></embed>')",
- "bbcodeurl('\\1', '<object align="middle" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" class="OBJECT" id="MediaPlayer" width="360" height="300" ><PARAM NAME="AutoStart" VALUE="0" ><param name="enableContextMenu" value="0"><param name="ShowStatusBar" value="-1"><param name="Filename" value="%s"><embed type="application/x-oleobject" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" flename="mp" src="%s" width="360" height="300"></embed></object>')",
- "bbcodeurl('\\1', '<object align="middle" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" class="OBJECT" id="MediaPlayer" width="480" height="68" ><PARAM NAME="AutoStart" VALUE="-1" ><param name="enableContextMenu" value="0"><param name="ShowStatusBar" value="-1"><param name="Filename" value="%s"><embed type="application/x-oleobject" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" flename="mp" src="%s" width="480" height="68"></embed></object>')",
- "bbcodeurl('\\1', '<object classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" id="Player" width="480" height="0" viewastext><param name="Autostart" value="-1"><param name="CONTROLS" value="ImageWindow"><param name="enableContextMenu" value="0"><param name="CONSOLE" value="_master"><param name="LOOP" value="-1"><param name="CENTER" value="0"></object><br><object classid=clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA height=64 id=Player width=480 VIEWASTEXT><param name="_ExtentX" value="18256"><param name="_ExtentY" value="794"><param name="Autostart" value="-1"><param name="LOOP" value="-1"><param name="CENTER" value="0"><param name="BACKGROUNDCOLOR" value="#000000"><param name="SRC" value="%s"></object>')",
- "bbcodeurl('\\1', '<object classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" id="rmplayer" width="360" height="300" viewastext><param name="Autostart" value="0"><param name="CONTROLS" value="ImageWindow"><param name="enableContextMenu" value="0"><param name="CONSOLE" value="_master"><param name="LOOP" value="-1"><param name="CENTER" value="0"></object><br><object classid=clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA height=64 id=Player width=360 VIEWASTEXT><param name="_ExtentX" value="18256"><param name="_ExtentY" value="794"><param name="Autostart" value="0"><param name="LOOP" value="0"><param name="CENTER" value="0"><param name="BACKGROUNDCOLOR" value="#000000"><param name="SRC" value="%s"></object>')",
- "bbcodeurl('\\4', '<object align="middle" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" class="OBJECT" id="MediaPlayer" width="\\1" height="\\2" ><PARAM NAME="AutoStart" VALUE="\\3" ><param name="ShowStatusBar" value="-1"><param name="enableContextMenu" value="0"><param name="Filename" value="%s"><embed type="application/x-oleobject" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" width="\\1" height="\\2"></embed></object>')",
- "bbcodeurl('\\4', '<object width="\\1" height="\\2" classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" id="rmplayer" viewastext><param name="Autostart" value="\\3"><param name="CONTROLS" value="ImageWindow"><param name="enableContextMenu" value="0"><param name="CONSOLE" value="_master"><param name="LOOP" value="-1"><param name="CENTER" value="0"></object><br><object classid=clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA height=64 id=Player width="\\1" VIEWASTEXT><param name="_ExtentX" value="18256"><param name="_ExtentY" value="794"><param name="Autostart" value="\\3"><param name="LOOP" value="-1"><param name="CENTER" value="0"><param name="SRC" value="%s"></object>')",
- include/discuzcode.func.php修改结束。
- 打开include/bbcode.js,在最后加上以下代码:
- CODE:[Copy to clipboard]function wmv() {
- if (helpmode){
- alert(wmv_help);
- } else if (getSelectedText()) {
- var range = document.selection.createRange();
- range.text = "[wmv=360,300,1]" + range.text + "[/wmv]";
- } else if (advmode) {
- AddTxt="[wmv=360,300,1]http://[/wmv]";
- AddText(AddTxt);
- } else {
- txt=prompt(wmv_normal,"http://");
- if (txt!=null){
- txt2=prompt(media_input1,"360");
- txt3=prompt(media_input2,"300");
- txt4=prompt(media_input3,"1");
- txt2=txt2==null?'360':txt2;
- txt3=txt3==null?'300':txt3;
- txt4=txt4==null?'0':txt4;
- if (txt2!="" && txt3!="" && txt4!=""){
- AddTxt="[wmv="+txt2+","+txt3+","+txt4+"]"+txt;
- AddText(AddTxt);
- AddText("[/wmv]");
- }else{
- AddTxt="[wmv=360,300,1]"+txt;
- AddText(AddTxt);
- AddText("[/wmv]");
- }
- }
- }
- }
- function rm() {
- if (helpmode){
- alert(rm_help);
- } else if (getSelectedText()) {
- var range = document.selection.createRange();
- range.text = "[rm=360,300,1]" + range.text + "[/rm]";
- } else if (advmode) {
- AddTxt="[rm=360,300,1]http://[/rm]";
- AddText(AddTxt);
- } else {
- txt=prompt(wmv_normal,"http://");
- if (txt!=null){
- txt2=prompt(media_input1,"360");
- txt3=prompt(media_input2,"300");
- txt4=prompt(media_input3,"1");
- txt2=txt2==null?'360':txt2;
- txt3=txt3==null?'300':txt3;
- txt4=txt4==null?'0':txt4;
- if (txt2!="" && txt3!="" && txt4!=""){
- AddTxt="[rm="+txt2+","+txt3+","+txt4+"]"+txt;
- AddText(AddTxt);
- AddText("[/rm]");
- }else{
- AddTxt="[rm=360,300,1]"+txt;
- AddText(AddTxt);
- AddText("[/rm]");
- }
- }
- }
- }
- include/bbcode.js修改结束。
- 打开templates\default\templates.lang.php,查找:
- CODE:[Copy to clipboard]'post_discuzcode_image_normal' => '请输入图像的 URL。',
- 在下面加上:
- CODE:[Copy to clipboard] 'post_discuzcode_wmv' => '插入 WMV 类型影像文件',
- 'post_discuzcode_wmv_comment' => '在文本中插入一个 WMV 类型影像文件。\n其类型包括:wmv,wma,mp3,mid,swf',
- 'post_discuzcode_rm' => '插入 RM 类型影像文件',
- 'post_discuzcode_rm_comment' => '在文本中插入一个 RM 类型影像文件。\n其类型包括:rm,rmvb,ra,ram',
- 'post_discuzcode_wmv_normal' => '请输入影像文件的 URL。',
- 'post_discuzcode_media_input1' => '插入影像文件的宽度,推荐360-480',
- 'post_discuzcode_media_input2' => '插入影像文件的高度,推荐300-360',
- 'post_discuzcode_media_input3' => '是否让插入的影像文件自动播放,1=自动播放、0=手动播放',
- templates\default\templates.lang.php修改结束。
- 打开templates\default\post_bbinsert.htm,查找:
- CODE:[Copy to clipboard]var image_normal = "{lang post_discuzcode_image_normal}";
- 在下面添加:
- CODE:[Copy to clipboard] var wmv_help = "{lang post_discuzcode_wmv}\n\n{lang post_discuzcode_wmv_comment}";
- var rm_help = "{lang post_discuzcode_rm}\n\n{lang post_discuzcode_rm_comment}";
- var mp3_help = "{lang post_discuzcode_mp3}";
- var ron_help = "{lang post_discuzcode_ron}";
- var wmv_normal = "{lang post_discuzcode_wmv_normal}";
- var media_input1 = "{lang post_discuzcode_media_input1}";
- var media_input2 = "{lang post_discuzcode_media_input2}";
- var media_input3 = "{lang post_discuzcode_media_input3}";
- 继续查找:
- CODE:[Copy to clipboard]<a href="javascript:flash()"><img src="{IMGDIR}/bb_flash.gif" border="0" alt="{lang post_discuzcode_flash}"></a>
- 在下面添加:
- CODE:[Copy to clipboard] <a href="javascript:wmv()"><img src="{IMGDIR}/bb_vod.gif" border="0" alt="{lang post_discuzcode_wmv}"></a>
- <a href="javascript:rm()"><img src="{IMGDIR}/bb_rm.gif" border="0" alt="{lang post_discuzcode_rm}"></a>
- templates\default\post_bbinsert.htm修改结束
- 附件内所有图片文件放到[IMAGES/模板名]目录中。
- 至此,插件全部结束。
复制代码 |
|