补充内容:需要后台设置支持上传sb sb2 文件
板块要允许多媒体代码
修改文件 根目录/source/function/目录下的文件
scratch_play.zip
(17.33 KB, 下载次数: 62)
function_attachment.php- } elseif(preg_match("/image|^(jpg|gif|png|bmp) /", $type)) {
- $typeid = 11;
- } elseif(preg_match("/flash|^(swf|fla|flv|swi|sb|sb2) /", $type)) {
- $typeid = 10;
- } elseif(preg_match("/audio|video|^(wav|mid|mp3|m3u|wma|asf|asx|vqf|mpg|mpeg|avi|wmv) /", $type)) {
- $typeid = 9;
[color=rgb(51, 102, 153) !important]复制代码
function_post.php
代码:- function parseattachmedia($attach) {
- $attachurl = 'attach://'.$attach['aid'].'.'.$attach['ext'];
- switch(strtolower($attach['ext'])) {
- case 'mp3':
- case 'wma':
- case 'ra':
- case 'ram':
- case 'wav':
- case 'mid':
- return 'http://\'.$attachurl.\'';
- case 'wmv':
- case 'rm':
- case 'rmvb':
- case 'avi':
- case 'asf':
- case 'mpg':
- case 'mpeg':
- case 'mov':
- case 'flv':
- case 'swf':
- case 'sb':
- return '[media='.$attach['ext'].',400,300]'.$attachurl.'[/media]';
- case 'sb2':
- return '[media='.$attach['ext'].',400,300]'.$attachurl.'[/media]';
- default:
- return;
- }
- }
[color=rgb(51, 102, 153) !important]复制代码
function_discuzcode.php需要注意点sb和sb2的flash播放器文件是不一样的,(截图有点错误,具体看代码)
- case 'mpg':
- case 'sb':
- $newurl = str_replace(":","%3A",$url);
- $newurl = str_replace("?","%3F",$newurl);
- $newurl = str_replace("=","%3D",$newurl);
- $newurl = str_replace("&","%26",$newurl);
- $newurl = str_replace("amp;","",$newurl);
- return '
- ';
- case 'sb2':
- $newurl = str_replace(":","%3A",$url);
- $newurl = str_replace("?","%3F",$newurl);
- $newurl = str_replace("=","%3D",$newurl);
- $newurl = str_replace("&","%26",$newurl);
- $newurl = str_replace("amp;","",$newurl);
- return '
- ';
[color=rgb(51, 102, 153) !important]复制代码
|