注册 |登录

西谷社区论坛综合下载 › 查看主题
ARP欺骗和防护技术2010年淘宝减肥产品排行榜中文网址之家|www.3721.cc电脑故障速查方法集萃[精华]
微软盗版用户xp黑屏集中解决方法500元/月;5000元/年--招租!IT人士如何保养?站长零风险创业,月赚1万

4750

查看

13

回复
返回列表

Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20

go

超酷播放器UBB标签 FOR Discuz! 6.0正式版本发布

1#
发表于 2007-9-5 12:51 | 只看该作者 | 倒序看帖 | 打印
标题:超酷播放器UBB标签 FOR Discuz! 6.0正式版
=========================
插件名称:超酷播放器UBB标签
适合版本:Discuz! 6.0正式版
发布日期:2007-9-5
发  布 人: 2046
演     示:http://club.cimgoo.com/thread-230779-1-1.html
技术支持:Discuz!官方论坛
=========================

A、手动修改方法见下面的详细步骤,强烈推荐;你也可以直接下载我们做好的相应版本完整插件包直接上传覆盖你的原来文件,但记得一定要备份原始文件以防意外;如果你装过其他播放器插件,建议先删除(与DZ系统内置的所有播放标签都没有冲突,而且可以同时使用!)。
B、大家在安装过程中有什么问题直接到我站发贴提问  http://club.cimgoo.com/forum-60-1.html  ,我会第一时间答疑帮助,有什么建议和BUG希望大家提出,我会努力改进。
C、插件在“西谷IT社区”正式应用,而且永久和官方版本同步更新,关注本插件最新版本直接到
http://club.cimgoo.com/thread-230778-1-1.html免费下载。
D、此次版本较以前版本在安全机制上改动较大,对JavaScript嵌入攻击、钓鱼做过很好的防御,强烈建议更新。
E、插入要在Discuz!代码模式下进行。

一、需要添加的文件:

复制下面附件的 ubb_dialog.php 文件到根目录
ubb_dialog.php
复制下面附件的 bb_player.gif 图片到 ./images/common/目录下
bb_player.gif


二、需要修改的代码:

1、打开./include/discuzcode.func.php文件,查找:


  1. for($i = 0; $i <= $discuzcodes['pcodecount']; $i++) {
复制代码
在他前面加如以下代码:

  1. /*--------------------------------------------- CIMGOO --------------------------------------->>>---*/
  2. $allowplayercode = $allowsmilies;
  3. if(!$bbcodeoff && $allowplayercode && $GLOBALS['player_ubb_on']) {
  4.   if(empty($discuzcodes['searcharray']['playercode'])) {
  5.    $discuzcodes['searcharray']['playercode'] = array(
  6.     "/\[mp\](.+?)\[\/mp\]/eis",
  7.     "/\[mp=(\d)\](.+?)\[\/mp\]/eis",
  8.     "/\[wmv\](.+?)\[\/wmv\]/eis",
  9.     "/\[wmv=(\d{1,3})\,(\d{1,3})\,(\d)\](.+?)\[\/wmv\]/eis",
  10.     "/\[rm\](.+?)\[\/rm\]/eis",
  11.     "/\[rm=(\d{1,3})\,(\d{1,3})\,(\d)\](.+?)\[\/rm\]/eis"
  12.    );
  13.    $discuzcodes['replacearray']['playercode'] = array(
  14.     "media_player('mp', '\\1')",
  15.     "media_player('mp', '\\2', '\\1')",
  16.     "media_player('wmv', '\\1')",
  17.     "media_player('wmv', '\\4', '\\3', '\\1', '\\2')",
  18.     "media_player('rm' , '\\1')",
  19.     "media_player('rm' , '\\4', '\\3', '\\1', '\\2')"
  20.    );
  21.   }
  22.   $message = preg_replace($discuzcodes['searcharray']['playercode'], $discuzcodes['replacearray']['playercode'], $message);
  23. }
  24. /*--------------------------------------------- CIMGOO ---------------------------------------<<<---*/
复制代码
在文件尾("?>"之前) 添加以下代码:

  1. /*--------------------------------------------- CIMGOO --------------------------------------->>>---*/
  2. $player_ubb_on = true;       //是否开启
  3. $player_num = 0;
  4. $player_pre = mt_rand();
  5. function media_player($type, $url, $auto = 0, $width = 450, $height = 340) {//需默认自动开始播放,请将$auto = 0改为$auto = 1
  6. global $player_pre, $player_num;
  7. $pid = $player_pre.'_'.$player_num;
  8. if($type == 'rm') {
  9.   $player = <<<html
  10. <object classid="CLSID:CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA" width="$width" height="$height" id="player_{$pid}">
  11. <param name="Console" value="Console_{$pid}">
  12. <param name="Controls" value="ImageWindow">
  13. <param name="AutoStart" value="0">
  14. <param name="Src" value="http://cnguy.com/">
  15. </object>

  16. <object classid="CLSID:CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA" width="$width" height="32">
  17. <param name="Console" value="Console_{$pid}">
  18. <param name="Controls" value="ControlPanel">
  19. </object>
  20. html;
  21. } else {
  22.   if ($type == 'mp') {
  23.    $width = 280; $height = 69;
  24.   }else {
  25.    $height += 69;
  26.   }
  27.   $player = <<<html
  28. <object classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" width="$width" height="$height" id="player_{$pid}">
  29. <param name="AutoStart" value="0">
  30. <param name="ShowStatusBar" value="1">
  31. <!--param name="EnableContextMenu" value="0"-->
  32. <param name="FileName" value="http://cnguy.com/">
  33. </object>
  34. html;
  35. }
  36. $url = explode("\r\n", trim($url));
  37. $select = "播放> <select id=\"select_{$pid}\" onchange=\"player_change('$pid', '$type')\">";
  38. foreach ($url as $key => $value) {
  39.   $value = preg_replace("/<a href=\"(.[^\"']+)\"(.+?)<\/a>/i","\\1", str_replace('\"','"',$value));
  40.   $one = explode('|', $value);
  41.   $one[0] = str_replace('"', '"', trim($one[0]));
  42.   if(!$one[0]) continue;
  43.   ++$count;
  44.   $select .= "<option value=\"{$one[0]}\"> $count ".cutstr(trim($one[1]), 20)." </option>";
  45. }
  46. $select .= '</select>';
  47. if($type != 'mp') {
  48.   $full = "<a href=\"###\" onclick=\"javascript:player_fullscreen('$pid', '$type')\">全屏播放</a> ";
  49. } else { $full = ''; }
  50. $prev_next = "<a href=\"###\" onclick=\"player_prev('$pid', '$type');\">上一集</a> ";
  51. $prev_next .= "<a href=\"###\" onclick=\"player_next('$pid', '$type');\">下一集</a> ";
  52. $cp = '&copy; CIMGOO.COM';
  53. if($count == 1) {
  54.   $select = "<div style=\"display:none\">$select</div>";
  55.   $select .= $cp;
  56.   $prev_next = '';
  57. }
  58. $player = <<<html
  59. <table class="msgborder" style="width:auto;">
  60. <tr class="msgheader"><td style="padding:5px;">
  61.   Web Media Player ( x$count )
  62. </td><td align="right">
  63.   <a href="###" id="expand_{$pid}" onclick="player_expand('$pid', '$type')">展开</a>
  64. </td></tr>
  65. <tbody id="tbody_$pid" style="display:none;">
  66. <tr><td colspan="2">
  67.   $player
  68. </td></tr>
  69. </tbody>
  70. <tr><td colspan="2">
  71.   <span id="cp_$pid" style="float:right">$cp</span>
  72.   <span id="buttons_$pid" style="display:none;">
  73.    <div style="float:right;">$select</div>{$full}{$prev_next}
  74.   </span>
  75.   <a href="###" id="download_$pid" onclick="player_showurl('$pid');">显示地址</a>
  76. </td></tr>
  77. <tr><td colspan="2" id="url_$pid" style="display:none;">
  78. </td></tr>
  79. </table>
  80. html;
  81. if ($auto) {
  82.   $player .= "<script type=\"text/javascript\">player_change('$pid', '$type');</script>";
  83. }
  84. $player_num ++;
  85. //$player = str_replace(array("\t","\r","\n"), '', $player);
  86. $player = preg_replace("/\s+/s", ' ', $player);
  87. return $player;
  88. }
  89. /*--------------------------------------------- CIMGOO ---------------------------------------<<<---*/
复制代码
2、打开./include/javascript/common.js文件。在末尾添加以下代码:

  1. /*--------------------------------------------- CIMGOO --------------------------------------->>>---*/
  2. function player_fullscreen(pid, t)
  3. {
  4. var p = $('player_' + pid);
  5. if(t == 'rm') {
  6.   if(!p.CanStop()) {
  7.    alert('影片未开始,无法全屏!');
  8.   } else {
  9.    alert('将进入全屏模式,按Esc键退出全屏!');
  10.    p.SetFullScreen();
  11.   }
  12. } else if(t == 'wmv' || t == 'mp') {
  13.   if(p.playstate != 2) {
  14.    alert('影片未开始,无法全屏!');
  15.   } else {
  16.    alert('将进入全屏模式,双击可退出全屏!');
  17.    p.DisplaySize = 3;
  18.   }
  19. }
  20. }
  21. function player_expand(pid, t)
  22. {
  23. var pl = $('player_' + pid);
  24. var tb = $('tbody_' + pid);
  25. var bt = $('buttons_' + pid);
  26. var ep = $('expand_' + pid);
  27. var cp = $('cp_' + pid);
  28. if(tb.style.display == 'none') {
  29.   tb.style.display = 'block';
  30.   bt.style.display = 'inline';
  31.   cp.style.display = 'none';
  32.   ep.innerHTML = '关闭';
  33.   if(t == 'rm') {
  34.    if(pl.GetSource() == 'http://cnguy.com/') {
  35.     player_change(pid, t);
  36.    }
  37.    pl.DoPlay();
  38.   } else if(t == 'wmv' || t == 'mp') {
  39.    pl.autostart = true;
  40.    if(pl.filename == 'http://cnguy.com/') {
  41.     player_change(pid, t);
  42.    }
  43.    pl.play();
  44.   }
  45. } else {
  46.   tb.style.display = 'none';
  47.   bt.style.display = 'none';
  48.   ep.innerHTML = '展开';
  49.   cp.style.display = 'inline';
  50.   if(t == 'rm') {
  51.    pl.DoPause();
  52.   } else if(t == 'wmv' || t == 'mp') {
  53.    pl.pause();
  54.   }
  55. }
  56. }
  57. function player_change(pid, t)
  58. {
  59. var p = $('player_'+pid);
  60. var s = $('select_'+pid);
  61. if($('tbody_'+pid).style.display == 'none') {
  62.   player_expand(pid, t);
  63. }
  64. if(t == 'rm') {
  65.   p.DoStop();
  66.   p.SetSource(s.options[s.selectedIndex].value);
  67.   p.DoPlay();
  68. } else if(t == 'wmv' || t == 'mp') {
  69.   p.stop();
  70.   p.filename = s.options[s.selectedIndex].value;
  71.   p.play();
  72. }
  73. self.focus();
  74. }
  75. function player_prev(pid, t)
  76. {
  77. var s = $('select_' + pid);
  78. if(s.selectedIndex == 0) {
  79.   alert('这已经是第一集了!'); return;
  80. }
  81. s.selectedIndex = s.selectedIndex - 1;
  82. player_change(pid, t);
  83. }
  84. function player_next(pid, t)
  85. {
  86. var s = $('select_' + pid);
  87. if(s.selectedIndex == s.options.length - 1) {
  88.   alert('这已经是最后一集了!'); return;
  89. }
  90. s.selectedIndex = s.selectedIndex + 1;
  91. player_change(pid, t);
  92. }
  93. function player_showurl(pid)
  94. {
  95. var u = $('url_' + pid);
  96. if(u.style.display == 'none')
  97. {
  98.   var s = $('select_' + pid);
  99.   var temp = '';
  100.   for(i=0; i<s.options.length ;i++)
  101.   {
  102.    temp += s.options.text + ' <a href="' + s.options.value + '" target="_blank">' + s.options.value + '</a>
  103. ';
  104.   }
  105.   u.innerHTML = temp;
  106.   u.style.display = 'block';
  107.   $('download_' + pid).innerHTML = '隐藏地址';
  108. } else {
  109.   u.innerHTML = '';
  110.   u.style.display = 'none';
  111.   $('download_' + pid).innerHTML = '显示地址'
  112. }
  113. }
  114. /*---------------------------------------------CIMGOO---------------------------------------<<<---*/
复制代码


3、打开./include/javascript/editor.js文件。在文件尾添加以下代码:

  1. /*--------------------------------------------- CIMGOO --------------------------------------->>>---*/
  2. function CNGUY_UBB(mod) {
  3. if(wysiwyg) {
  4.   alert('请在代码模式下使用');
  5.   return false;
  6. }
  7. var selection = getSel();
  8. if(selection === false) {
  9.   selection = '';
  10. } else {
  11.   selection += '';
  12. }
  13. var text = showModalDialog("./ubb_dialog.php?mod="+mod, selection, "dialogWidth:28em; dialogHeight:21em; status:yes; help:no; scroll:no");
  14. if (text === undefined) {
  15.   return false;
  16. }
  17. addSnapshot(getEditorContents());
  18. checkFocus();
  19. insertText(text, mb_strlen(text), 0);
  20. addSnapshot(getEditorContents());
  21. checkFocus();
  22. return false;
  23. }
  24. /*---------------------------------------------CIMGOO---------------------------------------<<<---*/
复制代码

4、打开./template/default/post_editor.htm文件(如果你改模板也改过该文件,就到相应位置改这个文件),查找以下:

  1. <!--{if $allowhidecode}--><td><a id="{$editorid}_cmd_hide"><img
  2. src="images/common/bb_hide.gif" title="{lang post_discuzcode_hide}" alt="Hide" /></a></td><!--{/if}-->
复制代码
在下面添加:

  1. <td><div class="editor_buttonnormal" id="{$editorid}_cmd_insertplayer" onclick="CNGUY_UBB('player')" onMouseOver="buttonContext(this, 'mouseover')" onMouseOut="buttonContext(this, 'mouseout')"><img src="images/common/bb_player.gif" width="21" height="20"  alt="插入UBB播放器" /></div></td>
复制代码
到此你的播放器就完成了,如果你想修改播放器样式,让他变的更酷更个性化,可以修改include\discuzcode.func.php下的相应代码实现(在上面加入的代码里面找)。关于播放器样式代码可以参考: http://club.cimgoo.com/thread-8389-1-1.html ,文章有详细解释。

下面是完整插件包(直接覆盖),做插件不容易啊(又是两个通宵,专门做个压力和攻击测试),希望大家支持下!>>

UBB.rar (24.58 KB)

武汉交友网 http://www.dwhquan.com

TOP

Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20

2#
发表于 2007-9-5 13:02 | 只看该作者

禁右键的方法

.include/discuzcode.func.php文件
查找:
  1. <!--param name="EnableContextMenu" value="0"-->
复制代码
修改为:
  1. <param name="EnableContextMenu" value="0">
复制代码
即可禁右键。
后面的value值,1为显示,0为隐藏
武汉交友网 http://www.dwhquan.com

TOP

Rank: 1

3#
发表于 2007-9-7 10:43 | 只看该作者
严重支持。  想问下 附件包   楼主 安装了官方9月4号的补丁了没?   呵呵  


管理员辛苦了。

TOP

Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20

4#
发表于 2007-9-7 11:52 | 只看该作者
加了4号的最新补丁
8-28和9-5的在./include/discuzcode.func.php有较大改动
如果你直接修改代码就适合8-28和9-5的任意版本
武汉交友网 http://www.dwhquan.com

TOP

Rank: 1

5#
发表于 2007-9-7 15:44 | 只看该作者
格式好象会乱。没有上个版本的漂亮了。

TOP

Rank: 1

6#
发表于 2007-9-7 19:05 | 只看该作者
视频 关闭功能不起作用

TOP

Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20

7#
发表于 2007-9-7 20:07 | 只看该作者

回复 5# 的帖子

格式没有做过美化 5.0和5.5时我用的黑色风格 专门美化过播放器
现在6.0的用得默认模板 所以未做格式处理 你可以自己修改适合自己站的播放风格啊
武汉交友网 http://www.dwhquan.com

TOP

Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20

8#
发表于 2007-9-7 20:08 | 只看该作者

回复 6# 的帖子

你是说WMV视频播放吗 是可以关闭和展开的
我看过你发的演示都可以
武汉交友网 http://www.dwhquan.com

TOP

Rank: 1

9#
发表于 2007-9-7 20:20 | 只看该作者
原帖由 2046 于 2007-9-7 20:07 发表
格式没有做过美化 5.0和5.5时我用的黑色风格 专门美化过播放器
现在6.0的用得默认模板 所以未做格式处理 你可以自己修改适合自己站的播放风格啊

我是说播放器表格可以像这样的效果吗?
12.jpg

TOP

Rank: 1

10#
发表于 2007-9-7 20:29 | 只看该作者
http://www.xmoc.net/thread-235-1-1.html

我自己改成这样子  但是表格太大了。  

TOP

西谷 ( 鄂ICP备06011914号)

GMT+8, 2010-9-4 03:26, Processed in 0.089364 second(s), 8 queries, Eaccelerator On.

Powered by Discuz! X1

© 2001-2010 Comsenz Inc.