Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

上传多媒体文件直接播放(增加了FLASH部分)

[复制链接]
ramboo 发表于 2005-12-13 18:14:46 | 显示全部楼层 |阅读模式
上传多媒体文件直接播放(增加了FLASH部分)

你可以根据需要添加,此代码由于牵扯到在线播放代码,可能带来安全问题

第一步,打开viewthread.php
找到


  1. $attach['attachimg'] = $attachimgpost && in_array($extension, array('jpg', 'jpeg', 'jpe', 'gif', 'png', 'bmp')) && (!$attach['readperm'] || $readaccess >= $attach['readperm']) ? 1 : 0;
复制代码
在下面添加


  1. $attach['attachmusic'] = $attachimgpost && in_array($extension, array('wav', 'wma', 'mp3', 'mid')) && (!$attach['readperm'] || $readaccess >= $attach['readperm']) ? 1 : 0;
  2. $attach['attachvideo'] = $attachimgpost && in_array($extension, array('avi', 'wmv', 'mpg')) && (!$attach['readperm'] || $readaccess >= $attach['readperm']) ? 1 : 0;
  3. $attach['attachrm'] = $attachimgpost && in_array($extension, array('rm', 'rmvb')) && (!$attach['readperm'] || $readaccess >= $attach['readperm']) ? 1 : 0;
复制代码

如果需要增加上传flash直接显示,还要加上下面的代码(很可能有安全文件,建议不要加)


  1. $attach['attachswf'] = $attachimgpost && in_array($extension, array('swf')) && (!$attach['readperm'] || $readaccess >= $attach['readperm']) ? 1 : 0;
复制代码

第二步,打开模板目录下viewthread.htm

找到


  1. <!--{if $attachrefcheck}-->
  2. <img src="attachment.php?aid=$attach[aid]&noupdate=yes" border="0" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='{lang image_open_zoom}';}" onmouseover="if(this.resized) this.style.cursor='hand';" onclick="if(!this.resized) {return false;} else {window.open('attachment.php?aid=$attach[aid]');}" onmousewheel="return imgzoom(this);">
  3. <!--{else}-->
  4. <img src="$attachurl/$attach[attachment]" border="0" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='{lang image_open_zoom}';}" onmouseover="if(this.resized) this.style.cursor='hand';" onclick="if(!this.resized) {return false;} else {window.open('$attachurl/$attach[attachment]');}" onmousewheel="return imgzoom(this);">
  5. <!--{/if}-->
复制代码

在下面添加


  1. <!--{elseif $attach['attachmusic']}-->
  2. <a href="member.php?action=credits&view=getattach" title="{lang credits_policy_view}" target="_blank">{lang attachment}</a>:
  3. <!--{if $attach['readperm']}-->, {lang readperm} $attach[readperm]<!--{/if}-->
  4. <!--{if $attach['description']}-->[{$attach[description]}]<!--{/if}--> <a href="attachment.php?aid=$attach[aid]" target="_blank" class="bold">$attach[filename]</a> ($attach[dateline], $attach[attachsize])<br>
  5. <br><object classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" width="320" height="65"><param name="ShowStatusBar" value="-1"><param name="Filename" value="$attachurl/$attach[attachment]"><embed src="$attachurl/$attach[attachment]" width="320" height="65"></embed></object><br>
  6. <!--{elseif $attach['attachvideo']}-->
  7. <a href="member.php?action=credits&view=getattach" title="{lang credits_policy_view}" target="_blank">{lang attachment}</a>:
  8. <!--{if $attach['readperm']}-->, {lang readperm} $attach[readperm]<!--{/if}-->
  9. <!--{if $attach['description']}-->[{$attach[description]}]<!--{/if}--> <a href="attachment.php?aid=$attach[aid]" target="_blank" class="bold">$attach[filename]</a> ($attach[dateline], $attach[attachsize])<br>
  10. <br><object align="middle" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" class="OBJECT" id="MediaPlayer"><param name="ShowStatusBar" value="-1"><param name="Filename" value="$attachurl/$attach[attachment]"><embed type="application/x-oleobject" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" flename="mp" src="$attachurl/$attach[attachment]" width="480" height="360"></embed></object><br>
  11. <!--{elseif $attach['attachrm']}-->
  12. <a href="member.php?action=credits&view=getattach" title="{lang credits_policy_view}" target="_blank">{lang attachment}</a>:
  13. <!--{if $attach['readperm']}-->, {lang readperm} $attach[readperm]<!--{/if}-->
  14. <!--{if $attach['description']}-->[{$attach[description]}]<!--{/if}--> <a href="attachment.php?aid=$attach[aid]" target="_blank" class="bold">$attach[filename]</a> ($attach[dateline], $attach[attachsize])<br>
  15. <br><object classid="clsid:CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA" id="RealMoviePlayer" border="0"><param name="_ExtentX" value="13229"><param name="_ExtentY" value="10583"><param name="AUTOSTART" value="0"><param name="SHUFFLE" value="0"><param name="PREFETCH" value="0"><param name="NOLABELS" value="0"><param name="CONTROLS" value="ImageWindow"><param name="CONSOLE" value="_master"><param name="LOOP" value="0"><param name="NUMLOOP" value="0"><param name="CENTER" value="0"><param name="MAINTAINASPECT" value="0"><param name="BACKGROUNDCOLOR" value="#000000"><param name="SRC" value="$attachurl/$attach[attachment]"></object><br><object classid="clsid:CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA" width="500" height="40" id="RealMoviePlayer" border="0"><param name="_ExtentX" value="13229"><param name="_ExtentY" value="1058"><param name="AUTOSTART" value="0"><param name="SHUFFLE" value="0"><param name="PREFETCH" value="0"><param name="NOLABELS" value="0"><param name="CONTROLS" value="controlpanel"><param name="CONSOLE" value="_master"><param name="LOOP" value="0"><param name="NUMLOOP" value="0"><param name="CENTER" value="0"><param name="MAINTAINASPECT" value="0"><param name="BACKGROUNDCOLOR" value="#000000"><param name="SRC" value="$attachurl/$attach[attachment]"></object><br>
复制代码

如果需要增加上传flash直接显示,还要加上下面的代码(很可能有安全文件,建议不要加)


  1. <!--{elseif $attach['attachswf']}-->
  2. <a href="member.php?action=credits&view=getattach" title="{lang credits_policy_view}" target="_blank">{lang attachment}</a>:
  3. <!--{if $attach['readperm']}-->, {lang readperm} $attach[readperm]<!--{/if}-->
  4. <!--{if $attach['description']}-->[{$attach[description]}]<!--{/if}--> <a href="attachment.php?aid=$attach[aid]" target="_blank" class="bold">$attach[filename]</a> ($attach[dateline], $attach[attachsize])<br>
  5. <br><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" name="top10movie" width="640" height="480" id="top10movie"><param name="movie" value="$attachurl/$attach[attachment]"><param name="quality" value="high"><param name="menu" value="false"><embed src="$attachurl/$attach[attachment]" width="640" height="480" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" id="top10movie" name="top10movie" menu="false"></embed></object><br>
复制代码

完成

评分

1

查看全部评分

sonyboy 发表于 2005-12-13 18:46:43 | 显示全部楼层
超级大沙发,顶了再说·~~
回复

使用道具 举报

5025488.net 发表于 2005-12-13 18:47:16 | 显示全部楼层
for d4 ?
回复

使用道具 举报

lzquan 发表于 2005-12-13 18:47:24 | 显示全部楼层
地板。
回复

使用道具 举报

梦幻网络 发表于 2005-12-14 21:34:11 | 显示全部楼层
怎么偶的不好用啊
回复

使用道具 举报

msi 发表于 2005-12-14 21:49:50 | 显示全部楼层
支持
回复

使用道具 举报

alexandre 发表于 2005-12-15 13:49:16 | 显示全部楼层
支持,顶一下。
回复

使用道具 举报

linsie 发表于 2005-12-16 08:39:06 | 显示全部楼层
支持先
回复

使用道具 举报

梦古无尘 发表于 2005-12-18 08:21:51 | 显示全部楼层
好东西,支持~~~!
回复

使用道具 举报

迎客松 发表于 2005-12-18 09:10:46 | 显示全部楼层

!!!!!!看帖要回,不回木JJ

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-11-15 23:41 , Processed in 0.032816 second(s), 5 queries , Gzip On, Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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