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

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[插件] 上传的音乐附件(MP3/WMV/RM/FLASH)在线播放 For 4.0 by oytktk

[复制链接]
青春E族 发表于 2005-12-24 18:41:24 | 显示全部楼层
嗯,改好了,而且把表格也给去掉啦,嘿嘿..

对了,oytktk兄,如果swf格式的附件使用网页打开怎么改啊,用windows media player有时候显示的动画太小!
这个可能会不安全,不过我在内网用,oytktk兄告诉一下修改方法吧~谢了.永远支持你!!!
回复

使用道具 举报

 楼主| oytktk 发表于 2005-12-24 18:46:02 | 显示全部楼层
原帖由 青春E族 于 2005-12-24 18:41 发表
嗯,改好了,而且把表格也给去掉啦,嘿嘿..

对了,oytktk兄,如果swf格式的附件使用网页打开怎么改啊,用windows media player有时候显示的动画太小!
这个可能会不安全,不过我在内网用,oytktk兄告诉一下修改方法吧~ ...


用网页可能会导致不安全....
回复

使用道具 举报

linsie 发表于 2005-12-24 19:38:20 | 显示全部楼层
好东西要支持
回复

使用道具 举报

青春E族 发表于 2005-12-24 19:49:46 | 显示全部楼层
原帖由 oytktk 于 2005-12-24 18:46 发表


用网页可能会导致不安全....


我是在内网用的,没事,用mediaplayer有时flash会很小..
回复

使用道具 举报

青春E族 发表于 2005-12-24 20:00:42 | 显示全部楼层
oytktk兄,没事了,自己解决了,哈哈,我还蛮聪明的,改了一下,viewthread.php里加了一段代码,找了一个网页flash的代码,一切OK!!
回复

使用道具 举报

sdywd 发表于 2005-12-25 07:17:24 | 显示全部楼层
不知是不是我改的错,好像没有附件大小哦
还有就是为啥有些flash的附件可以放有些不可以,但是下载都可以看
不好意思,又来麻烦你了     

[ 本帖最后由 sdywd 于 2005-12-25 07:24 编辑 ]
回复

使用道具 举报

青春E族 发表于 2005-12-25 08:20:27 | 显示全部楼层
1、此插件版权for oytktk
2、仅去除了表格显示,附件显示方式同D4
3、增加了网页显示flash
4、增加asf显示(使用media player播放)
5、这个修改稍微懂点html的都会,只是叫大家省点事而已,感谢oytktk老大的无私帮忙,做为你的粉丝,希望多出一些好的hack!
6、此修改手工过于粗糙,期待大虾完善。

安装方法:

VIEWTHREAD.PHP

查找:

  1. $attach['attachimg'] = $attachimgpost && in_array($extension, array('jpg', 'jpeg', 'jpe', 'gif', 'png', 'bmp')) ? 1 : 0;
复制代码


下面加

第一种,swf使用windows media player播放,加入asf格式在线显示。


  1.                                 $attach['attachmp3'] = $attachimgpost && in_array($extension, array('wav', 'wma', 'mp3', 'mid')) ? 1 : 0;
  2.                                 $attach['attachwmv'] = $attachimgpost && in_array($extension, array('avi', 'wmv', 'mpg',‘swf’, 'asf')) ? 1 : 0;
  3.                                 $attach['attachrm'] = $attachimgpost && in_array($extension, array('rm', 'rmvb')) ? 1 : 0;
复制代码


第二种,swf使用网页播放,加入asf格式在线显示。


  1.                                 $attach['attachmp3'] = $attachimgpost && in_array($extension, array('wav', 'wma', 'mp3', 'mid')) ? 1 : 0;
  2.                                 $attach['attachwmv'] = $attachimgpost && in_array($extension, array('avi', 'wmv', 'mpg','asf')) ? 1 : 0;
  3.                                 $attach['attachswf'] = $attachimgpost && in_array($extension, array('swf')) ? 1 : 0;
  4.                                 $attach['attachrm'] = $attachimgpost && in_array($extension, array('rm', 'rmvb')) ? 1 : 0;
复制代码


模板: VIEWTHREAD.HTM

查找:


  1. <!--{loop $post['attachments'] $attach}-->
  2.                                 <br><br>$attach[attachicon]
  3.                                 <!--{if $attach['attachimg']}-->
  4.                                         <a href="member.php?action=credits&view=getattach" title="{lang credits_policy_view}" target="_blank">{lang attach_img}</a>:
  5.                                         <!--{if $attach['readperm']}-->, {lang readperm} $attach[readperm]<!--{/if}-->
  6.                                         <!--{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><br>
  7.                                         <!--{if $attachrefcheck}-->
  8.                                                 <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);">
  9.                                         <!--{else}-->
  10.                                                 <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);">
  11.                                         <!--{/if}-->
  12.                                 <!--{else}-->
  13.                                         <a href="member.php?action=credits&view=getattach" title="{lang credits_policy_view}" target="_blank">{lang attachment}</a>:
  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.                                         <span class="smalltxt">{lang attach_download_count} $attach[downloads]
  16.                                         <!--{if $attach['readperm']}-->, {lang readperm} $attach[readperm]<!--{/if}--></span><br>
  17.                                 <!--{/if}-->
  18.                         <!--{/loop}-->

复制代码


替换为

第一种,使用windows media player播放swf附件,D4附件方式。


  1.                                                 <!--{loop $post['attachments'] $attach}-->
  2.                                 <br><br>
  3.                                 <!--{if $attach['attachimg']}-->
  4.                                         $attach[attachicon] <a href="member.php?action=credits&view=getattach" title="{lang credits_policy_view}" target="_blank">{lang attach_img}</a>: <!--{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.                                         <span class="smalltxt">{lang attach_download_count} $attach[downloads] <!--{if $attach['readperm'] > $readaccess && !$adminid}--><blockquote style="margin-left:20px;  margin-right:20px; border:#DDE3EC  dashed  1px; padding:5px;background-color: white ;">对不起, 您的阅读权限(<font color="#FF0000"><b>$credits</b></font>), 没有达到附件浏览所需的阅读权限(<b><font color="#FF0000">$attach['readperm']</font></b>)的要求, 所以不能查看附件资源!</blockquote><!--{else}--><br><br><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 true;} else {window.open('$attachurl/$attach[attachment]');}" onmousewheel="return imgzoom(this);"><!--{/if}-->
  6.                                 <!--{elseif $attach['attachmp3']}-->
  7.                                         $attach[attachicon] <a href="member.php?action=credits&view=getattach" title="{lang credits_policy_view}" target="_blank">{lang attachment}</a>: <!--{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>{lang attach_download_count} $attach[downloads]<!--{if $attach['description']}--><!--{/if}--><!--{if $attach['readperm'] > $readaccess && !$adminid}--><blockquote style="margin-left:20px;  margin-right:20px; border:#DDE3EC  dashed  1px; padding:5px;background-color: white ;">对不起, 您的阅读权限(<font color="#FF0000"><b>$readaccess</b></font>), 没有达到附件浏览所需的阅读权限(<b><font color="#FF0000">$attach['readperm']</font></b>)的要求, 所以不能查看附件资源!</blockquote><!--{else}--><br><br><object align="middle" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" class="OBJECT" id="MediaPlayer" width="380" height="69" ><PARAM NAME="AUTOSTART" VALUE="true" ><param name="ShowStatusBar" value="-1"><param name="Filename" value="$attachurl/$attach[attachment]">
  8.                                          <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="380" height="69"></embed></object><!--{/if}-->
  9.                                 <!--{elseif $attach['attachwmv']}-->
  10.                                         $attach[attachicon] <a href="member.php?action=credits&view=getattach" title="{lang credits_policy_view}" target="_blank">{lang attachment}</a>: <!--{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>{lang attach_download_count} $attach[downloads]<!--{if $attach['readperm'] > $readaccess && !$adminid}--><blockquote style="margin-left:20px;  margin-right:20px; border:#DDE3EC  dashed  1px; padding:5px;background-color: white ;">对不起, 您的阅读权限(<font color="#FF0000"><b>$readaccess</b></font>), 没有达到附件浏览所需的阅读权限(<b><font color="#FF0000">$attach['readperm']</font></b>)的要求, 所以不能查看附件资源!</blockquote><!--{else}--><br><br><object align="middle" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" class="OBJECT" id="MediaPlayer" width="380" height="300" ><PARAM NAME="AUTOSTART" VALUE="true" ><param name="ShowStatusBar" value="-1"><param name="Filename" value="$attachurl/$attach[attachment]">
  11.                                          <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="380" height="300"></embed></object><!--{/if}-->
  12.                                 <!--{elseif $attach['attachrm']}-->
  13.                                         $attach[attachicon] <a href="member.php?action=credits&view=getattach" title="{lang credits_policy_view}" target="_blank">{lang attachment}</a>: <!--{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>{lang attach_download_count} $attach[downloads]<!--{if $attach['readperm'] > $readaccess && !$adminid}--><blockquote style="margin-left:20px;  margin-right:20px; border:#DDE3EC  dashed  1px; padding:5px;background-color: white ;">对不起, 您的阅读权限(<font color="#FF0000"><b>$readaccess</b></font>), 没有达到附件浏览所需的阅读权限(<b><font color="#FF0000">$attach['readperm']</font></b>)的要求, 所以不能查看附件资源!</blockquote><!--{else}--><br><br><embed name="rplayer" type="audio/x-pn-realaudio-plugin" src="$attachurl/$attach[attachment]" controls="ControlPanel,StatusBar" width=380 height=68 border=0 autostart=true loop=true></embed><!--{/if}-->
  14.                                 <!--{else}-->
  15.                                       $attach[attachicon] <a href="member.php?action=credits&view=getattach" title="{lang credits_policy_view}" target="_blank">{lang attachment}</a>:
  16.                                         <!--{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>
  17.                                         <span class="smalltxt">{lang attach_download_count} $attach[downloads]
  18.                                         <!--{if $attach['readperm']}-->, {lang readperm} $attach[readperm]<!--{/if}--></span><br>
  19.                                 <!--{/if}-->
  20.                         <!--{/loop}-->

复制代码


第二种,使用网页方式播放swf,D4附件方式。


  1.                                                 <!--{loop $post['attachments'] $attach}-->
  2.                                 <br><br>
  3.                                 <!--{if $attach['attachimg']}-->
  4.                                         $attach[attachicon] <a href="member.php?action=credits&view=getattach" title="{lang credits_policy_view}" target="_blank">{lang attach_img}</a>: <!--{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.                                         <span class="smalltxt">{lang attach_download_count} $attach[downloads] <!--{if $attach['readperm'] > $readaccess && !$adminid}--><blockquote style="margin-left:20px;  margin-right:20px; border:#DDE3EC  dashed  1px; padding:5px;background-color: white ;">对不起, 您的阅读权限(<font color="#FF0000"><b>$credits</b></font>), 没有达到附件浏览所需的阅读权限(<b><font color="#FF0000">$attach['readperm']</font></b>)的要求, 所以不能查看附件资源!</blockquote><!--{else}--><br><br><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 true;} else {window.open('$attachurl/$attach[attachment]');}" onmousewheel="return imgzoom(this);"><!--{/if}-->
  6.                                 <!--{elseif $attach['attachmp3']}-->
  7.                                         $attach[attachicon] <a href="member.php?action=credits&view=getattach" title="{lang credits_policy_view}" target="_blank">{lang attachment}</a>: <!--{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>{lang attach_download_count} $attach[downloads]<!--{if $attach['description']}--><!--{/if}--><!--{if $attach['readperm'] > $readaccess && !$adminid}--><blockquote style="margin-left:20px;  margin-right:20px; border:#DDE3EC  dashed  1px; padding:5px;background-color: white ;">对不起, 您的阅读权限(<font color="#FF0000"><b>$readaccess</b></font>), 没有达到附件浏览所需的阅读权限(<b><font color="#FF0000">$attach['readperm']</font></b>)的要求, 所以不能查看附件资源!</blockquote><!--{else}--><br><br><object align="middle" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" class="OBJECT" id="MediaPlayer" width="380" height="69" ><PARAM NAME="AUTOSTART" VALUE="true" ><param name="ShowStatusBar" value="-1"><param name="Filename" value="$attachurl/$attach[attachment]">
  8.                                          <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="380" height="69"></embed></object><!--{/if}-->
  9.                                 <!--{elseif $attach['attachwmv']}-->
  10.                                         $attach[attachicon] <a href="member.php?action=credits&view=getattach" title="{lang credits_policy_view}" target="_blank">{lang attachment}</a>: <!--{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>{lang attach_download_count} $attach[downloads]<!--{if $attach['readperm'] > $readaccess && !$adminid}--><blockquote style="margin-left:20px;  margin-right:20px; border:#DDE3EC  dashed  1px; padding:5px;background-color: white ;">对不起, 您的阅读权限(<font color="#FF0000"><b>$readaccess</b></font>), 没有达到附件浏览所需的阅读权限(<b><font color="#FF0000">$attach['readperm']</font></b>)的要求, 所以不能查看附件资源!</blockquote><!--{else}--><br><br><object align="middle" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" class="OBJECT" id="MediaPlayer" width="380" height="300" ><PARAM NAME="AUTOSTART" VALUE="true" ><param name="ShowStatusBar" value="-1"><param name="Filename" value="$attachurl/$attach[attachment]">
  11.                                          <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="380" height="300"></embed></object><!--{/if}-->
  12. <!--{elseif $attach['attachswf']}-->
  13.                                         $attach[attachicon] <a href="member.php?action=credits&view=getattach" title="{lang credits_policy_view}" target="_blank">{lang attachment}</a>: <!--{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>{lang attach_download_count} $attach[downloads]<!--{if $attach['readperm'] > $readaccess && !$adminid}--><blockquote style="margin-left:20px;  margin-right:20px; border:#DDE3EC  dashed  1px; padding:5px;background-color: white ;">对不起, 您的阅读权限(<font color="#FF0000"><b>$readaccess</b></font>), 没有达到附件浏览所需的阅读权限(<b><font color="#FF0000">$attach['readperm']</font></b>)的要求, 所以不能查看附件资源!</blockquote><!--{else}--><br><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" width="544" height="404"><param name="movie" value="$attachurl/$attach[attachment]"><param name="quality" value="high"><param name="menu" value="false"><embed src="$attachurl/$attach[attachment]" width="544" height="404" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent"></embed></object><!--{/if}-->
  14.                                 <!--{elseif $attach['attachrm']}-->
  15.                                         $attach[attachicon] <a href="member.php?action=credits&view=getattach" title="{lang credits_policy_view}" target="_blank">{lang attachment}</a>: <!--{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>{lang attach_download_count} $attach[downloads]<!--{if $attach['readperm'] > $readaccess && !$adminid}--><blockquote style="margin-left:20px;  margin-right:20px; border:#DDE3EC  dashed  1px; padding:5px;background-color: white ;">对不起, 您的阅读权限(<font color="#FF0000"><b>$readaccess</b></font>), 没有达到附件浏览所需的阅读权限(<b><font color="#FF0000">$attach['readperm']</font></b>)的要求, 所以不能查看附件资源!</blockquote><!--{else}--><br><br><embed name="rplayer" type="audio/x-pn-realaudio-plugin" src="$attachurl/$attach[attachment]" controls="ControlPanel,StatusBar" width=380 height=68 border=0 autostart=true loop=true></embed><!--{/if}-->
  16.                                 <!--{else}-->
  17.                                       $attach[attachicon] <a href="member.php?action=credits&view=getattach" title="{lang credits_policy_view}" target="_blank">{lang attachment}</a>:
  18.                                         <!--{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>
  19.                                         <span class="smalltxt">{lang attach_download_count} $attach[downloads]
  20.                                         <!--{if $attach['readperm']}-->, {lang readperm} $attach[readperm]<!--{/if}--></span><br>
  21.                                 <!--{/if}-->
  22.                         <!--{/loop}-->

复制代码


完成!

演示图片(含限制及正常演示)

[ 本帖最后由 青春E族 于 2005-12-26 23:27 编辑 ]

本帖子中包含更多资源

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

x
回复

使用道具 举报

青春E族 发表于 2005-12-25 08:42:38 | 显示全部楼层
演示图:

本帖子中包含更多资源

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

x
回复

使用道具 举报

yjflq2002 发表于 2005-12-25 10:18:19 | 显示全部楼层
厉害厉害。
回复

使用道具 举报

heima9121 发表于 2005-12-25 12:24:18 | 显示全部楼层
我还是比较中意楼主以前发的贴内支持多媒体在线播放{自定义大小/是否自播}{添加专用按扭}
请问这样的效果在D4中怎么修改?
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-9-28 00:06 , Processed in 0.219589 second(s), 15 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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