3.打开include/javascript/editor.js
在最下面加上
- /*------------------DISCUZ社区专用UBB播放器---------代码开始------------------*/
- function DISCUZ_UBB(mod) {
- if(wysiwyg) {
- alert('请在代码模式下使用');
- return false;
- }
- var selection = getSel();
- if(selection === false) {
- selection = '';
- } else {
- selection += '';
- }
- var text = showModalDialog("./wuyouw_webplayer.php?mod="+mod, selection, "dialogWidth:28em; dialogHeight:21em; status:yes; help:no; scroll:no");
- if (text === undefined) {
- return false;
- }
- addSnapshot(getEditorContents());
- checkFocus();
- insertText(text, mb_strlen(text), 0);
- addSnapshot(getEditorContents());
- checkFocus();
- return false;
- }
- /*---------------DISCUZ社区专用UBB播放器----代码结束---------------------------*/
复制代码
4.打开include/discuzcode.func.php(注意:重要文件请注意备份!! )
DZ5.0找到
- $message = preg_replace($discuzcodes['searcharray']['imgcode'], $discuzcodes['replacearray']['imgcode'], $message);
- }
复制代码
DZ5.5找到
- if(!$bbcodeoff) {
- $message = preg_replace(array(
- ($parsetype != 1 ? "/\[swf\]\s*([^\[\<\r\n]+?)\s*\[\/swf\]/ies" : "//"),
- "/\[img\]\s*([^\[\<\r\n]+?)\s*\[\/img\]/ies",
- "/\[img=(\d{1,4})[x|\,](\d{1,4})\]\s*([^\[\<\r\n]+?)\s*\[\/img\]/ies"
- ), $allowimgcode ? array(
- ($parsetype != 1 ? "bbcodeurl('\\1', ' <img src="images/attachicons/flash.gif" align="absmiddle" alt="" /> <a href="%s" target="_blank">Flash: %s</a> ')" : ""),
- "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);" alt="" />')",
- "bbcodeurl('\\3', '<img width="\\1" height="\\2" src="%s" border="0" alt="" />')"
- ) : array(
- ($parsetype != 1 ? "bbcodeurl('\\1', ' <img src="images/attachicons/flash.gif" align="absmiddle" alt="" /> <a href="%s" target="_blank">Flash: %s</a> ')" : ""),
- "bbcodeurl('\\1', '<a href="%s" target="_blank">%s</a>')",
- "bbcodeurl('\\3', '<a href="%s" target="_blank">%s</a>')"
- ), $message);
- }
复制代码
在下面加
- /*------------------DISCUZ社区专用UBB播放器---------代码开始------------------*/
- $allowplayercode = $allowsmilies;
- if(!$bbcodeoff && $allowplayercode && $GLOBALS['player_ubb_on']) {
- if(empty($discuzcodes['searcharray']['playercode'])) {
- $discuzcodes['searcharray']['playercode'] = array(
- "/\[mp\](.+?)\[\/mp\]/eis",
- "/\[mp=(\d)\](.+?)\[\/mp\]/eis",
- "/\[wmv\](.+?)\[\/wmv\]/eis",
- "/\[wmv=(\d{1,3})\,(\d{1,3})\,(\d)\](.+?)\[\/wmv\]/eis",
- "/\[rm\](.+?)\[\/rm\]/eis",
- "/\[rm=(\d{1,3})\,(\d{1,3})\,(\d)\](.+?)\[\/rm\]/eis"
- );
- $discuzcodes['replacearray']['playercode'] = array(
- "media_player('mp', '\\1')",
- "media_player('mp', '\\2', '\\1')",
- "media_player('wmv', '\\1')",
- "media_player('wmv', '\\4', '\\3', '\\1', '\\2')",
- "media_player('rm' , '\\1')",
- "media_player('rm' , '\\4', '\\3', '\\1', '\\2')"
- );
- }
- $message = preg_replace($discuzcodes['searcharray']['playercode'], $discuzcodes['replacearray']['playercode'], $message);
- }
- /*---------------DISCUZ社区专用UBB播放器----代码结束---------------------------*/
复制代码
找
在前面加上
- /*------------------DISCUZ社区专用UBB播放器---------代码开始------------------*/
- $player_ubb_on = true; //是否开启
- $player_num = 0;
- $player_pre = mt_rand();
- function media_player($type, $url, $auto = 0, $width = 450, $height = 340) {//需默认自动开始播放,请将$auto = 0改为$auto = 1
- global $player_pre, $player_num;
- $pid = $player_pre.'_'.$player_num;
- if($type == 'rm') {
- $player = <<<html
- <object classid="CLSID:CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA" width="$width" height="$height" id="player_{$pid}">
- <param name="Console" value="Console_{$pid}">
- <param name="Controls" value="ImageWindow">
- <param name="AutoStart" value="0">
- <param name="Src" value="http://www.wuyouw.com/">
- </object><br />
- <object classid="CLSID:CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA" width="$width" height="32">
- <param name="Console" value="Console_{$pid}">
- <param name="Controls" value="ControlPanel">
- </object>
- html;
- } else {
- if ($type == 'mp') {
- $width = 400; $height = 69;
- }else {
- $height += 69;
- }
- $player = <<<html
- <object classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" width="$width" height="$height" id="player_{$pid}" style="FILTER: xray()">
- <param name="AutoStart" value="0">
- <param name="ShowStatusBar" value="1">
- <param name="EnableContextMenu" value="0">
- <param name="FileName" value="http://www.wuyouw.com/">
- </object>
- html;
- }
- $url = explode("\r\n", trim($url));
- $select = "播放> <select id="select_{$pid}" onchange="player_change('$pid', '$type')">";
- foreach ($url as $key => $value) {
- $value = preg_replace("/<a href="(.[^"']+)"(.+?)<\/a>/i","\\1", str_replace('"','"',$value));
- $one = explode('|', $value);
- $one[0] = str_replace('"', '"', trim($one[0]));
- if(!$one[0]) continue;
- ++$count;
- $select .= "<option value="{$one[0]}"> $count ".cutstr(trim($one[1]), 20)." </option>";
- }
- $select .= '</select>';
- if($type != 'mp') {
- $full = "<a href="###" onclick="javascript:player_fullscreen('$pid', '$type')">全屏播放</a> ";
- } else { $full = ''; }
- $prev_next = "<a href="###" onclick="player_prev('$pid', '$type');">上一集</a> ";
- $prev_next .= "<a href="###" onclick="player_next('$pid', '$type');">下一集</a> ";
- $cp = '© <a href="http://www.wuyouw.com" >wuyouw</a>';
- if($count == 1) {
- $select = "<div style="display:none">$select</div>";
- $select .= $cp;
- $prev_next = '';
- }
- $player = <<<html
- <table class="msgborder" style="width:auto;">
- <tr class="msgheader"><td style="padding:5px;">
- 〖DISCUZ社区专用播放器〗 ( 此专辑共<FONT color=red>$count</font>集 )
- </td><td align="right">
- <a href="###" id="expand_{$pid}" onclick="player_expand('$pid', '$type')">展开</a>
- </td></tr>
- <tbody id="tbody_$pid" style="display:none;">
- <tr><td colspan="2">
- $player
- </td></tr>
- </tbody>
- <tr><td colspan="2">
- <span id="cp_$pid" style="float:right">$cp</span>
- <span id="buttons_$pid" style="display:none;">
- <div style="float:right;">$select</div>{$full}{$prev_next}
- </span>
- <a href="###" id="download_$pid" onclick="player_showurl('$pid');"></a>
- </td></tr>
- <tr><td colspan="2" id="url_$pid" style="display:none;">
- </td></tr>
- </table>
- html;
- if ($auto) {
- $player .= "<script type="text/javascript">player_change('$pid', '$type');</script>";
- }
- $player_num ++;
- //$player = str_replace(array("\t","\r","\n"), '', $player);
- $player = preg_replace("/\s+/s", ' ', $player);
- return $player;
- }
- /*---------------DISCUZ社区专用UBB播放器----代码结束---------------------------*/
复制代码
注意:如果想默认为自动播放,请修改上面代码里的
function media_player($type, $url, $auto = 0, $width = 450, $height = 340) {//需默认自动开始播放,请将$auto = 0改为$auto = 1
[ 本帖最后由 998w 于 2007-4-12 16:44 编辑 ] |