Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[插件] 播放器+FLASH+歌词秀+全按扭(HIDE) For 4.0.0 by oytktk

[复制链接]
秋舞叶 发表于 2005-12-12 11:09:46 | 显示全部楼层 |阅读模式
这个插件集成了以下功能:

1. WMV和RM两在类别的音乐及影像文件播放;
2. 自定义播放器的大小,以及是否自动播放, 以及默认方式播放;
3. 含全屏按扭;
4. 支持了FLASH播放,并可自定义播放器的大小;
5. 加了所有功能的按扭;
6. 加入音乐文件的动态显示歌词功能;
7. 动态歌词中支持暂停滚动,快速向上和向下滚动;
8. 加入HIDE按扭, 并根据后台设定的权限决定是否显示此按扭;
9. 各个函数得到了部分优化;
可参考附件图片演示.

include/discuzcode.func.php修改开始

查找:

  1.        if(!$bbcodeoff && $allowimgcode) {
  2.                 if(empty($discuzcodes['searcharray']['imgcode'])) {
  3.                         $discuzcodes['searcharray']['imgcode'] = array(
  4.                                 "/\[swf\]\s*([^\[]+?)\s*\[\/swf\]/ies",
  5.                                 "/\[img\]\s*([^\[]+?)\s*\[\/img\]/ies",
  6.                                 "/\[img=(\d{1,3})[x|\,](\d{1,3})\]\s*([^\[]+?)\s*\[\/img\]/ies"
  7.                         );
  8.                         $discuzcodes['replacearray']['imgcode'] = array(
  9.                                 "bbcodeurl('\\1', ' <img src="images/attachicons/flash.gif" align="absmiddle"> <a href="%s" target="_blank">Flash: %s</a> ')",
  10.                                 "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.resized) this.style.cursor=\'hand\';" onclick="if(!this.resized) {return true;} else {window.open(\'%s\');}" onmousewheel="return imgzoom(this);">')",
  11.                                 "bbcodeurl('\\3', '<img width="\\1" height="\\2" src="%s" border="0">')"
  12.                         );
  13.                 }
  14.                 $message = preg_replace($discuzcodes['searcharray']['imgcode'], $discuzcodes['replacearray']['imgcode'], $message);
  15.         }
复制代码

整段替换为:

  1.        if(!$bbcodeoff && $allowimgcode) {
  2.                 if(empty($discuzcodes['searcharray']['imgcode'])) {
  3.                         $discuzcodes['searcharray']['imgcode'] = array(
  4.                                 "/\[swf\]\s*([^\[]+?)\s*\[\/swf\]/ies",
  5.                                 "/\[img\]\s*([^\[]+?)\s*\[\/img\]/ies",
  6.                                 "/\[swf=(\d+?)[x|\,](\d+?)\]\s*(.+?)\s*\[\/swf\]/ies",
  7.                                 "/\[wmv\]\s*(.+?)\s*\[\/wmv\]/ies",
  8.                                 "/\[mp3\]\s*(.+?)\s*\[\/mp3\]/ies",
  9.                                 "/\[ron\]\s*(.+?)\s*\[\/ron\]/ies",
  10.                                 "/\[rm\]\s*(.+?)\s*\[\/rm\]/ies",
  11.                                 "/\[wmv=(\d+?)[x|\,](\d+?)[x|\,](\d+?)\]\s*(.+?)\s*\[\/wmv\]/ies",
  12.                                 "/\[rm=(\d+?)[x|\,](\d+?)[x|\,](\d+?)\]\s*(.+?)\s*\[\/rm\]/ies",
  13.                                 "/\[img=(\d{1,3})[x|\,](\d{1,3})\]\s*([^\[]+?)\s*\[\/img\]/ies"
  14.                         );
  15.                         $discuzcodes['replacearray']['imgcode'] = array(
  16.                                 "bbcodeurl('\\1', '<a href="%s" target="_blank"><u>※单击鼠标在新窗口中打开※</u></a><br><br><embed width="360" height="300" src="%s" type="application/x-shockwave-flash"></embed>')",
  17.                                 "bbcodeurl('\\1', '<br><img src="%s" border="0" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt=\'单击这里开新视窗查看\\n按住CTRL,并滚动鼠标滚轮缩放图片大小\';}" onmouseover="if(this.resized) this.style.cursor=\'hand\';" onclick="if(!this.resized) {return true;} else {window.open(\'%s\');}" onmousewheel="return imgzoom(this);">')",
  18.                                 "bbcodeurl('\\3', '<a href="%s" target="_blank"><u>※单击鼠标在新窗口中打开※</u></a><br><br><embed width="\\1" height="\\2" src="%s" type="application/x-shockwave-flash"></embed>')",
  19.                                 "bbcodeurl('\\1', '<br><input type="button" name="mplayer" onclick="document.MediaPlayer.DisplaySize=3" value="全屏播放"> [ 双击退出全屏播放状态 ] <br><br><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>')",
  20.                                 "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>')",
  21.                                 "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>')",
  22.                                 "bbcodeurl('\\1', '<br><input type="button" name="rmplayer" onclick="document.rmplayer.SetFullScreen()" value="全屏播放"> [ 按ESC退出全屏播放状态 ] <br><br><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>')",
  23.                                 "bbcodeurl('\\4', '<br><input type="button" name="mplayer" onclick="document.MediaPlayer.DisplaySize=3" value="全屏播放"> [ 双击退出全屏播放状态 ] <br><br><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>')",
  24.                                 "bbcodeurl('\\4', '<br><input type="button" name="rmplayer" onclick="document.rmplayer.SetFullScreen()" value="全屏播放"> [ 按ESC退出全屏播放状态 ] <br><br><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>')",
  25.                                 "bbcodeurl('\\3', '<img width="\\1" height="\\2" src="%s" border="0">')"
  26.                         );
  27.                 }
  28.                 $message = preg_replace($discuzcodes['searcharray']['imgcode'], $discuzcodes['replacearray']['imgcode'], $message);
  29.         }
复制代码

查找:

function karmaimg($rate, $ratetimes) {

上面加:

  1. function gcxdisp($code) {
  2.         global $discuzcodes;
  3.         $discuzcodes['pcodecount']++;
  4.         $code = htmlspecialchars(str_replace('\"', '"', preg_replace("/^[\n\r]*(.+?)[\n\r]*$/is", "\\1", $code)));
  5.         $discuzcodes['codehtml'][$discuzcodes['pcodecount']] = "<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="480" bgcolor="#000000"><tr><td rowspan="2"><marquee id="scrolltext" onmouseover=this.stop() onmouseout=this.start() TrueSpeed scrollamount=1 scrolldelay=200 width="455" height="280" direction="up"><font style="font-size: 14pt" color=#FFFFFF><center>$code</center></FONT></marquee></td><td width="30" onmouseover="list3()" onmouseout="list4()" style="Cursor:hand"><font color=#FFFFFF><center>↑</center></font></td></tr><tr><td width="30" onmouseover="list1()" onmouseout="list2()" style="Cursor:hand"><font color=#FFFFFF><center>↓</center></font></td></tr></table>";
  6.         $discuzcodes['codecount']++;
  7.         return "[\tDISCUZ_CODE_$discuzcodes[pcodecount]\t]";
  8. }
复制代码

查找:

  1. $message = preg_replace("/\s*\[code\](.+?)\[\/code\]\s*/ies", "codedisp('\\1')", $message);
复制代码


下面加:

  1.                 $message = preg_replace("/\s*\[gcx\](.+?)\[\/gcx\]\s*/ies", "gcxdisp('\\1')", $message);
复制代码


include/discuzcode.func.php修改结束

include/bbcode.js修改开始

文章最后加上:

ps.先查看这个文件内是否已有以下某函数,若有,请删除后再加.

  1. function wmv() {
  2.         if (helpmode){
  3.                 alert(wmv_help);
  4.         } else if (getSelectedText()) {
  5.                 var        range =        document.selection.createRange();
  6.                 range.text = "[wmv=360,300,1]" + range.text + "[/wmv]";
  7.         } else if (advmode)        {
  8.                 AddTxt="[wmv=360,300,1]http://[/wmv]";
  9.                 AddText(AddTxt);
  10.         } else {
  11.                 txt=prompt(wmv_normal,"http://");
  12.                 if (txt!=null){
  13.                                         txt2=prompt(media_input1,"360");
  14.                                 txt3=prompt(media_input2,"300");
  15.                                         txt4=prompt(media_input3,"1");
  16.                                         txt2=txt2==null?'360':txt2;
  17.                                         txt3=txt3==null?'300':txt3;
  18.                                         txt4=txt4==null?'0':txt4;
  19.                                         if (txt2!="" && txt3!="" && txt4!=""){
  20.                                                 AddTxt="[wmv="+txt2+","+txt3+","+txt4+"]"+txt;
  21.                                                 AddText(AddTxt);
  22.                                                 AddText("[/wmv]");                                       
  23.                                         }else{
  24.                                                 AddTxt="[wmv=360,300,1]"+txt;
  25.                                                 AddText(AddTxt);
  26.                                                  AddText("[/wmv]");
  27.                                         }               
  28.                         }
  29.                 }
  30.         }

  31. function rm() {
  32.         if (helpmode){
  33.                 alert(rm_help);
  34.         } else if (getSelectedText()) {
  35.                 var        range =        document.selection.createRange();
  36.                 range.text = "[rm=360,300,1]" + range.text + "[/rm]";
  37.         } else if (advmode)        {
  38.                 AddTxt="[rm=360,300,1]http://[/rm]";
  39.                 AddText(AddTxt);
  40.         } else {
  41.                 txt=prompt(wmv_normal,"http://");
  42.                 if (txt!=null){
  43.                                         txt2=prompt(media_input1,"360");
  44.                                 txt3=prompt(media_input2,"300");
  45.                                         txt4=prompt(media_input3,"1");
  46.                                         txt2=txt2==null?'360':txt2;
  47.                                         txt3=txt3==null?'300':txt3;
  48.                                         txt4=txt4==null?'0':txt4;
  49.                                                 if (txt2!="" && txt3!="" && txt4!=""){
  50.                                                         AddTxt="[rm="+txt2+","+txt3+","+txt4+"]"+txt;
  51.                                                         AddText(AddTxt);
  52.                                                         AddText("[/rm]");                                       
  53.                                                 }else{
  54.                                                         AddTxt="[rm=360,300,1]"+txt;
  55.                                                         AddText(AddTxt);
  56.                                                         AddText("[/rm]");
  57.                                         }               
  58.                         }
  59.         }
  60. }

  61. function gcx_mp3()        {
  62.         if (helpmode) {
  63.                 alert(gcx_help);
  64.         } else if (getSelectedText()) {
  65.                 var range = document.selection.createRange();
  66.                 range.text = "[gcx]" + range.text + "[/gcx][mp3]http://[/mp3]";
  67.         } else if (advmode)        {
  68.                 AddTxt="\r[gcx]"+gcx_help+"[/gcx][mp3]http://[/mp3]";
  69.                 AddText(AddTxt);
  70.         } else {   
  71.                 txt=prompt(wmv_normal,"http://");
  72.                 if (txt!=null) {                  
  73.                         AddTxt="\r[gcx]"+gcx_help;
  74.                         AddText(AddTxt);
  75.                         AddText("[/gcx][mp3]"+txt+"[/mp3]");
  76.                 }                           
  77.         }
  78. }

  79. function gcx_ron()        {
  80.         if (helpmode) {
  81.                 alert(gcx_help);
  82.         } else if (getSelectedText()) {
  83.                 var range = document.selection.createRange();
  84.                 range.text = "[gcx]" + range.text + "[/gcx][ron]http://[/ron]";
  85.         } else if (advmode)        {
  86.                 AddTxt="\r[gcx]"+gcx_help+"[/gcx][ron]http://[/ron]";
  87.                 AddText(AddTxt);
  88.         } else {   
  89.                 txt=prompt(wmv_normal,"http://");
  90.                 if (txt!=null) {                  
  91.                         AddTxt="\r[gcx]"+gcx_help;
  92.                         AddText(AddTxt);
  93.                         AddText("[/gcx][ron]"+txt+"[/ron]");
  94.                 }                           
  95.         }
  96. }

  97. function hide() {
  98.         if (helpmode) {
  99.                 alert(hide_help);
  100.         } else if (getSelectedText()) {
  101.                 var range = document.selection.createRange();
  102.                 range.text = "[hide]" + range.text + "[/hide]";
  103.         } else if (advmode) {
  104.                 AddTxt="[hide]"+hide_normal+"[/hide]";
  105.                 AddText(AddTxt);
  106.         } else {   
  107.                 txt1=prompt(hide_credit,0);
  108.                 txt=prompt(hide_help,hide_normal);
  109.                 txt1=txt1==0 || !txt1?'':"="+txt1;
  110.                 if (txt!=null) {         
  111.                         AddTxt="[hide"+txt1+"]"+txt;
  112.                         AddText(AddTxt);
  113.                         AddText("[/hide]");
  114.                 }              
  115.         }
  116. }
复制代码


include/bbcode.js修改结束

templates\default\templates.lang.php修改开始

查找:

  1. 'post_discuzcode_image_normal' => '请输入图像的 URL。',
复制代码


下面加:

  1.         'post_discuzcode_wmv' => '插入 WMV 类型影像文件',
  2.         'post_discuzcode_wmv_comment' => '在文本中插入一个 WMV 类型影像文件。\n其类型包括:wmv,wma,mp3,mid,mp,swf……',
  3.         'post_discuzcode_rm' => '插入 RM 类型影像文件',
  4.         'post_discuzcode_rm_comment' => '在文本中插入一个 RM 类型影像文件。\n其类型包括:rm,rmvb,ra,ram……',
  5.         'post_discuzcode_mp3' => '为一个 MP3 类型的音乐加入动态歌词功能',
  6.         'post_discuzcode_ron' => '为一个 RM 类型的音乐加入动态歌词功能',
  7.         'post_discuzcode_gcx' => '\r在这里插入滚动显示的歌词\r',
  8.         'post_discuzcode_hide' => '插入 HIDE 代码!',
  9.         'post_discuzcode_hide_credit' => '输入你要限制的积分值: (0=回复查看贴)',
  10.         'post_discuzcode_hide_normal' => '插入您要用 HIDE 代码隐藏的信息!',
  11.         'post_discuzcode_wmv_normal' => '请输入影像文件的 URL。',
  12.         'post_discuzcode_media_input1' => '插入影像文件的宽度,推荐360-480',
  13.         'post_discuzcode_media_input2' => '插入影像文件的高度,推荐300-360',
  14.         'post_discuzcode_media_input3' => '是否让插入的影像文件自动播放,1=自动播放、0=手动播放',
复制代码

templates\default\templates.lang.php修改结束

templates\default\post_bbinsert.htm修改开始

查找:

  1. var image_normal = "{lang post_discuzcode_image_normal}";
复制代码


下面加:

  1.         var wmv_help = "{lang post_discuzcode_wmv}\n\n{lang post_discuzcode_wmv_comment}";
  2.         var rm_help = "{lang post_discuzcode_rm}\n\n{lang post_discuzcode_rm_comment}";
  3.         var mp3_help = "{lang post_discuzcode_mp3}";
  4.         var ron_help = "{lang post_discuzcode_ron}";
  5.         var gcx_help = "{lang post_discuzcode_gcx}";
  6.         var hide_help = "{lang post_discuzcode_hide}";
  7.         var hide_normal = "{lang post_discuzcode_hide_normal}";
  8.         var hide_credit = "{lang post_discuzcode_hide_credit}";
  9.         var wmv_normal = "{lang post_discuzcode_wmv_normal}";
  10.         var media_input1 = "{lang post_discuzcode_media_input1}";
  11.         var media_input2 = "{lang post_discuzcode_media_input2}";
  12.         var media_input3 = "{lang post_discuzcode_media_input3}";
复制代码


查找:

  1. <a href="javascript:flash()"><img src="{IMGDIR}/bb_flash.gif" border="0" alt="{lang post_discuzcode_flash}"></a>
复制代码


下面加:

  1.        <a href="javascript:wmv()"><img src="{IMGDIR}/bb_vod.gif" border="0" alt="{lang post_discuzcode_wmv}"></a>
  2.         <a href="javascript:rm()"><img src="{IMGDIR}/bb_rm.gif" border="0" alt="{lang post_discuzcode_rm}"></a>
  3.         <a href="javascript:gcx_mp3()"><img src="{IMGDIR}/bb_mp3.gif" border="0" alt="{lang post_discuzcode_mp3}"></a>
  4.         <a href="javascript:gcx_ron()"><img src="{IMGDIR}/bb_ron.gif" border="0" alt="{lang post_discuzcode_ron}"></a>
  5.         <!--{if $allowhidecode}-->
  6.         <a href="javascript:hide()"><img src="{IMGDIR}/bb_hide.gif" border="0" alt="{lang post_discuzcode_hide}"></a>
  7.         <!--{/if}-->
复制代码

templates\default\post_bbinsert.htm修改结束

include/common.js修改开始

文章最后加入:

  1. function list1(){
  2. scrolltext.scrollDelay=50;
  3. scrolltext.scrollAmount=2;
  4. scrolltext.direction="up";
  5. }
  6. function list2(){
  7. scrolltext.scrollDelay=220;
  8. scrolltext.scrollAmount=1;
  9. scrolltext.direction="up";
  10. }

  11. function list3(){

  12. scrolltext.scrollDelay=50;
  13. scrolltext.scrollAmount=2;
  14. scrolltext.direction="down";

  15. }
  16. function list4(){
  17. scrolltext.scrollDelay=220;
  18. scrolltext.scrollAmount=1;
  19. scrolltext.direction="up";
  20. }
复制代码


include/common.js修改结束


附件内所有图片文件放到[IMAGES/模板名]目录中

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
hklcf 发表于 2005-12-12 11:12:30 | 显示全部楼层
搶了第一...呵呵呵
支持啊...
回复

使用道具 举报

紫云杉 发表于 2005-12-12 11:13:02 | 显示全部楼层
支持
回复

使用道具 举报

5025488.net 发表于 2005-12-12 11:20:49 | 显示全部楼层
支持
回复

使用道具 举报

killua_bo 发表于 2005-12-12 11:31:03 | 显示全部楼层
支持啊!!!速度真快
回复

使用道具 举报

kkookk99 发表于 2005-12-12 11:39:39 | 显示全部楼层
这个还是3.0那个吗?

在4.0没问题吗?

老o自己改的?
回复

使用道具 举报

yjflq2002 发表于 2005-12-12 11:40:55 | 显示全部楼层
这个插件最好还是对比一下4.0的代码修改。还是比较容易成功的,不习惯大段代码替换。
回复

使用道具 举报

 楼主| 秋舞叶 发表于 2005-12-12 11:42:33 | 显示全部楼层
原帖由 kkookk99 于 2005-12-12 11:39 发表
这个还是3.0那个吗?

在4.0没问题吗?

老o自己改的?

完全for D4的
回复

使用道具 举报

大浪淘沙1 发表于 2005-12-12 11:45:04 | 显示全部楼层
马上放上,谢谢楼主
回复

使用道具 举报

killua_bo 发表于 2005-12-12 11:51:30 | 显示全部楼层
为什么我装了在发帖的那里什么都没有变啊??
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-6-2 06:26 , Processed in 0.128183 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表