南瓜园

 找回密码
 注册
查看: 1626|回复: 0

超酷全功能播放器UBB标签 FOR pw5.3

[复制链接]
发表于 2009-1-3 19:40:12 | 显示全部楼层 |阅读模式
修改方法见下面的详细步骤(推荐)
你也可以直接下载本插件包直接上传覆盖你的原来文件(请记得备份原始文件以防意外)

一、需要添加的文件:
上传文件到相应目录
images/flv.swf
images/player.js
images/post/editor/bb_image.gif
require/player.php
template/wind/ubb_dialog.htm


二、需要修改的文件:
require/bbscode.php
template/wind/wysiwyg_editor.htm
template/wind/simple_read.htm
template/wind/editor.htm
data/wind_c_editor.js
data/wind_editor.js
images/global.js
template/wind/read.htm
read.php


=========================
整个插件只需要修改3处就可以实现插件所叙播放效果~
1,上传增加的文件到相应目录
images/flv.swf
images/player.js
images/post/editor/bb_image.gif
require/player.php
template/wind/ubb_dialog.htm

2,修改
require/bbscode.php(两处)
查找:



Copy code
!function_exists('readover') && exit('Forbidden');

在下面添加


Copy code
require_once('player.php');


查找:
      
Copy code
if($allow['mpeg']){
            $message = preg_replace(
                array(
                    "/\[wmv=(0|1)\](.+?)\[\/wmv\]/eis",
                    "/\[wmv(=([0-9]{1,3})\,([0-9]{1,3})\,(0|1))?\](.+?)\[\/wmv\]/eis",
                    "/\[rm(=([0-9]{1,3})\,([0-9]{1,3})\,(0|1))?\](.+?)\[\/rm\]/eis"
                ),
                array(
                    "wmvplayer('\\2','314','53','\\1')",
                    "wmvplayer('\\5','\\2','\\3','\\4')",
                    "rmplayer('\\5','\\2','\\3','\\4')"
                ),$message,$db_cvtimes


替换成

        
Copy code
if($allow['mpeg']){
            $message = preg_replace(
                array(
                    "/\[(wmv|rm|mp)\](.+?)\[\/(wmv|rm|mp)\]/eis",
                    "/\[(wmv|rm|mp)=(\d)\](.+?)\[\/(wmv|rm|mp)\]/eis",
                    "/\[(wmv|rm|mp)\](.+?)\[\/(wmv|rm|mp)\]/eis",
                    "/\[(wmv|rm|mp)=(\d{1,3})\,(\d{1,3})\,(\d)\](.+?)\[\/(wmv|rm|mp)\]/eis",
                    "/(\[wmv|rm|mp=)([0-9]{1,3})(\,)([0-9]{1,3})(\,)([0-1]{1,1})(\])(.+?)(\[\/wmv|rm|mp\])/eis"
                ),
                array(
                    "media_player('spl', '\\2')",
                    "media_player('spl', '\\3', '\\2')",
                    "media_player('spl', '\\2')",
                    "media_player('spl', '\\5', '\\4', '\\2', '\\3')",
                    "media_player('spl', '\\9','\\7','\\3','\\5')"
                ),$message,$db_cvtimes


3,修改
images/global.js
只需要在文件的最后增加一处就OK了

Copy code
document.write("<script src=你的论坛地址/images/player.js><\/script>");



到此你的超酷播放器已经能正常播放了
=========================
发贴功能修改
打开./template/wind/wysiwyg_editor.htm文件,
查找:

        
Copy code
media: [ true, rming, true ],

在下面增加:


      
Copy code
insertmedi : [true, chcmedia, false],

查找:


Copy code
<img style="width: 20px; height: 20px" src="$imgpath/post/c_editor/table.gif" /></span>

在下面增加:


Copy code
<span class="button" id="wy_insertmedi" title="插入播放器">
<img style="width: 20px; height: 20px" src="$imgpath/post/editor/bb_image.gif" /></span>

打开./template/wind/editor.htm文件,
查找:


Copy code
<img onClick="saletable('$s_url')" alt="发表交易帖" src="$imgpath/post/editor/sale.gif" />

在下面增加:



Copy code
<img onClick="CNGUY_UBB()" alt="插入播放器" src="$imgpath/post/editor/bb_image.gif" />


打开./data/wind_c_editor.js文件,
查找:


Copy code
value="314"


替换:


Copy code
value="450"


查找:


Copy code
value="256"


查找:


Copy code
value="340"


查找:


Copy code
function insertmedia(){

在上面添加:


Copy code
function chcmedia() {
var text = showModalDialog("./template/wind/ubb_dialog.htm", document.styleSheets[0], "status:false;dialogWidth:42em; dialogHeight:25em; help:no; scroll:no;status: No");
if(text!=null){
editor.focusEditor();
if(editor._editMode=='textmode'){
    AddText(text,'');
} else{
    editor.insertHTML(codetohtml(text));
}
}
}


=========================
无图版
打开./template/wind/simple_read.htm文件,
查找:


Copy code
</script>


在下面添加


Copy code
document.write("<script src=你的论坛地址/p_w_picpath/player.js><\/script>");


=========================
自动解析
打开./read.php文件,
查找

            
Copy code
foreach($attachs as $at){
                if($at['type']=='img' && $at['needrvrc']==0 && (!$GLOBALS['downloadimg'] || !$GLOBALS['downloadmoney'] || $gp_allowdownload==2)){
                    $a_url=geturl($at['attachurl'],'show');
                    if($a_url=='imgurl'){
                        $read['picurl'][$at['aid']]['0']=$p_w_uploads[$at['aid']]="<a href=\"job.php?action=showimg&tid={$tid}&pid={$read[pid]}&fid={$fid}&aid={$at[aid]}&verify=".md5("showimg{$tid}{$pid}{$fid}{$at[aid]}{$GLOBALS[db_hash]}")."\" target=\"_blank\">$at[name]</a>";
                        $read['picurl'][$at['aid']]['1']=$dfadmin;
                    } else{
                        $dfurl='<br>'.cvpic($a_url[0],1,$db_windpost['picwidth'],$db_windpost['picheight']);
                        $read['pic'][$at['aid']]=array($at['aid'],$dfurl,$dfadmin,$at['desc']);
                        $p_w_uploads[$at['aid']]="<b>$at[desc]</b>$dfurl";
                    }



替换成:

            
Copy code
$mediatype = array('rm','rmvb','wma','wmv','mpg','mpeg','avi','mp3','swf','asf','flv');
            foreach($attachs as $at){
                $name_ext = strtolower(substr(strrchr($at['name'],'.'),1));
                if($at['type']=='img' && $at['needrvrc']==0 && (!$GLOBALS['downloadimg'] || !$GLOBALS['downloadmoney'] || $gp_allowdownload==2)){
                    $a_url=geturl($at['attachurl'],'show');
                    if($a_url=='imgurl'){
                        $read['picurl'][$at['aid']]['0']=$p_w_uploads[$at['aid']]="<a href=\"job.php?action=showimg&tid={$tid}&pid={$read[pid]}&fid={$fid}&aid={$at[aid]}&verify=".md5("showimg{$tid}{$pid}{$fid}{$at[aid]}{$GLOBALS[db_hash]}")."\" target=\"_blank\">$at[name]</a>";
                        $read['picurl'][$at['aid']]['1']=$dfadmin;
                    } else{
                        $dfurl='<br>'.cvpic($a_url[0],1,$db_windpost['picwidth'],$db_windpost['picheight']);
                        $read['pic'][$at['aid']]=array($at['aid'],$dfurl,$dfadmin,$at['desc']);
                        $p_w_uploads[$at['aid']]="<b>$at[desc]</b>$dfurl";
                    }
                }elseif(@in_array($name_ext,$mediatype) && $at['needrvrc']==0){
                    $read['downattach'][$at['aid']] = array($at['aid'], $at['name'], $at['size'], $at['hits'], $at['needrvrc'], $at['type'], $dfadmin, $at['desc']);
                    $p_w_uploads[$at['aid']] = auto_player($at,$name_ext);
                    $at['desc'] && $p_w_uploads[$at['aid']] = "<b>$at[desc]</b><br>".$p_w_uploads[$at['aid']];


完毕!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

请大家牢记南瓜园网址 www.nan2008.com

QQ|小黑屋|手机版|Archiver|南瓜园

GMT+8, 2024-9-20 05:30 , Processed in 0.093258 second(s), 19 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

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