下面是 SupeSite 7 的修改方法,SupeSite 6 应该类似,参考修改吧:
在SS7中,显示论坛的帖子的时候,如果帖子中有用户插入的 flash 或者多媒体,会无法显示和播放。
下面是临时解决办法
打开 include/bbcode.inc.php 文件,搜到
$discuzcodes['searcharray']['bbcode_regexp'][] = "/\[media=(\w{1,4}),(\d{1,4}),(\d{1,4}),(\d)\]\s*([^\[\<\r\n]+?)\s*\[\/media\]/ies";
if($allowmediacode) {
$discuzcodes['replacearray']['bbcode_regexp'][] = "parsemedia('\\1', \\2, \\3, \\4, '\\5')";
} else {
$discuzcodes['replacearray']['bbcode_regexp'][] = "bbcodeurl('\\5', '<a href=\"%s\" target=\"_blank\">%s</a>')";
}
大概是112行到117行
将这些行修改为
$discuzcodes['searcharray']['bbcode_regexp'][] = "/\[media=([\w,]+)\]\s*([^\[\<\r\n]+?)\s*\[\/media\]/ies";
if($allowmediacode) {
$discuzcodes['replacearray']['bbcode_regexp'][] = "parsemedia('\\1', '\\2')" ;
} else {
$discuzcodes['replacearray']['bbcode_regexp'][] = "bbcodeurl('\\2', '<a href=\"%s\" target=\"_blank\">%s</a>')";
}
$discuzcodes['searcharray']['flash'] = "/\[flash\]\s*([^\[\<\r\n]+?)\s*\[\/flash\]/ies";
$discuzcodes['replacearray']['flash'] = "bbcodeurl('\\1', '<a href=\"%s\" target=\"_blank\">Flash: %s</a> ')";
$message = preg_replace($discuzcodes['searcharray']['flash'], $discuzcodes['replacearray']['flash'], $message);
然后在该文件继续搜
function parsemedia($type, $width, $height, $autostart, $url) {
这个函数,将这个函数替换成
- function parsemedia($params, $url) {
- $params = explode(',', $params);
- if(in_array(count($params), array(3, 4))) {
- $type = $params[0];
- $width = intval($params[1]) > 800 ? 800 : intval($params[1]);
- $height = intval($params[2]) > 600 ? 600 : intval($params[2]);
- $autostart = isset($params[3])&&$params[3]>0 ? 1 : 0;
- $url = str_replace(array('<', '>'), '', str_replace('\"', '"', $url));
- $mediaid = 'media_'.random(3);
- switch($type) {
- case 'ra' : return '<object classid="clsid:CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA" width="'.$width.'" height="32"><param name="autostart" value="'.$autostart.'" /><param name="src" value="'.$url.'" /><param name="controls" value="controlpanel" /><param name="console" value="'.$mediaid.'_" /><embed src="'.$url.'" type="audio/x-pn-realaudio-plugin" controls="ControlPanel" '.($autostart ? 'autostart="true"' : '').' console="'.$mediaid.'_" width="'.$width.'" height="32"></embed></object>';break;
- case 'rm' : return '<object classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="'.$width.'" height="'.$height.'"><param name="autostart" value="'.$autostart.'" /><param name="src" value="'.$url.'" /><param name="controls" value="imagewindow" /><param name="console" value="'.$mediaid.'_" /><embed src="'.$url.'" type="audio/x-pn-realaudio-plugin" controls="IMAGEWINDOW" console="'.$mediaid.'_" width="'.$width.'" height="'.$height.'"></embed></object><br /><object classid="clsid:CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA" width="'.$width.'" height="32"><param name="src" value="'.$url.'" /><param name="controls" value="controlpanel" /><param name="console" value="'.$mediaid.'_" /><embed src="'.$url.'" type="audio/x-pn-realaudio-plugin" controls="ControlPanel" '.($autostart ? 'autostart="true"' : '').' console="'.$mediaid.'_" width="'.$width.'" height="32"></embed></object>';break;
- case 'wma' : return '<object classid="clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6" width="'.$width.'" height="64"><param name="autostart" value="'.$autostart.'" /><param name="url" value="'.$url.'" /><embed src="'.$url.'" autostart="'.$autostart.'" type="audio/x-ms-wma" width="'.$width.'" height="64"></embed></object>';break;
- case 'wmv' : return '<object classid="clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6" width="'.$width.'" height="'.$height.'"><param name="autostart" value="'.$autostart.'" /><param name="url" value="'.$url.'" /><embed src="'.$url.'" autostart="'.$autostart.'" type="video/x-ms-wmv" width="'.$width.'" height="'.$height.'"></embed></object>';break;
- case 'mp3' : return '<object classid="clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6" width="'.$width.'" height="64"><param name="autostart" value="'.$autostart.'" /><param name="url" value="'.$url.'" /><embed src="'.$url.'" autostart="'.$autostart.'" type="application/x-mplayer2" width="'.$width.'" height="64"></embed></object>';break;
- case 'mov' : return '<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" width="'.$width.'" height="'.$height.'"><param name="autostart" value="'.($autostart ? 'true' : 'false').'" /><param name="src" value="'.$url.'" /><embed controller="true" width="'.$width.'" height="'.$height.'" src="'.$url.'" autostart="'.($autostart ? 'true' : 'false').'"></embed></object>';break;
- default : return;
- }
- }
- return;
- }
复制代码 |