QQ登录

只需一步,快速开始

创客帮-青少年创客创意社区

快捷导航
开启左侧

让DiscuzX3支持sb,sb2类型的附件,并能在页面播放的方法

[复制链接]
教育百科 发表于 2015-4-9 16:02:59 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

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

x
本帖最后由 教育百科 于 2015-4-9 16:10 编辑

100803e99mv22727g74hex.png
补充内容:需要后台设置支持上传sb sb2 文件

100806spsb1s0xsrrc08rs.png


100808egq8z85g77gzi7gg.png
板块要允许多媒体代码
QQ图片20150409160935.png


修改文件 根目录/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
110907pe1xsutxi44aaiza.jpg

代码:
  • 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播放器文件是不一样的,(截图有点错误,具体看代码)
111010k2u2sndzfpuxdmdm.jpg
  •                         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]复制代码




原文见 logo.png
http://teenstone.com/forum.php?m ... =903&extra=page%3D1

zip.gif
该会员没有填写今日想说内容.
您需要登录后才可以回帖 登录 | 注册

本版积分规则

客服热线
400-1234-888 周一至周日:09:00 - 21:00
公司地址:襄阳市樊城区长虹路现代城5号楼188

创客帮MAKER.BAND青少年创客创意社区是一个融教育、科技、体育资讯为一体的综合服务平台,专注于教育创新、专注于科技体育、专注于教育资讯。

Powered by Discuz! X3.4 © 2001-2013 Comsenz Inc.

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