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

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[求助] 谁能介绍一个自动播放附件的方法

[复制链接]
等灯点燃 发表于 2008-5-12 15:16:08 | 显示全部楼层 |阅读模式
RT
要可以用的啊
leooe 发表于 2008-5-12 15:17:10 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

 楼主| 等灯点燃 发表于 2008-5-12 15:20:08 | 显示全部楼层
我试了好几个都不行,其实我以前已经弄好了的,不知道为什么现在却不行了
回复

使用道具 举报

leooe 发表于 2008-5-12 15:32:42 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

 楼主| 等灯点燃 发表于 2008-5-12 15:44:54 | 显示全部楼层
顶起来…
回复

使用道具 举报

yifengxing 发表于 2008-5-24 18:05:16 | 显示全部楼层
:o :o :o
回复

使用道具 举报

适者生存 发表于 2008-5-24 18:17:11 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

xiaotaoxiaohan 发表于 2008-5-24 18:45:35 | 显示全部楼层
顶!!!!!!!!!!
很需要!!!!!!!


涛涛电影院  等待哦………………  任何你像看的电影都有哦………………
                               http://www.lovedaxue.cn/tv/
回复

使用道具 举报

axin2005 发表于 2009-7-22 14:15:01 | 显示全部楼层
.多媒体附件自动播放For DZ 6.0
代码地址:(OK)
<https://discuz.dismall.com/viewth ... %26amp%3Btypeid%3D2
实现多媒体附件自动播放For DZ 6.0 (0904更新,支持绝大多数媒体格式)
這是參考《中國3W網路聯盟論壇》原作者:admin for5.5版的原始碼。
1、打开default/discuzcode.htm文件,查找:global $attachrefcheck, $extcredits, $creditstrans, $ftp, $thumbstatus;
复制代码有两处这个代码,在第一个的下面添加:$media = array('', 'wma', 'mp3','wav', 'mid');

$rms = array('', 'rm', 'rmvb');

$video = array('', 'wmv', 'avi', 'mpg', 'asx', 'asf','WMV');

$divx = array('', 'divx');
复制代码上面的代码已经支持了绝大多数的媒体文件了。

2、查找:  </dd>

<!--{else}-->

  <dt>

   $attach[attachicon]

   <a href="attachment.php?aid=$attach[aid]" target="_blank">$attach[filename]</a>

   <em>($attach[attachsize])</em>

  </dt>
复制代码在上面添加:<!--/////////BEGIN------------->

<!--{elseif array_search(fileext($attach['filename']), $media)}-->

<dt>

                        $attach[attachicon]

                        <a href="attachment.php?aid=$attach[aid]" target="_blank">$attach[filename]</a>

                        <em>($attach[attachsize])</em>

                </dt>

                <dd>

                        <p>

                                $attach[dateline], {lang downloads}: $attach[downloads]

                                <!--{if $attach['readperm']}-->, {lang readperm}: <strong>$attach[readperm]</strong><!--{/if}-->

                                <!--{if $attach['price']}-->

                                        , {lang price}: <strong>{$extcredits[$creditstrans][title]} $attach[price] {$extcredits[$creditstrans][unit]}</strong>  [<a href="misc.php?action=viewattachpayments&aid=$attach[aid]" target="_blank">{lang pay_view}</a>]

                                        <!--{if !$attach['payed']}-->

                                                 [<a href="misc.php?action=attachpay&aid=$attach[aid]" target="_blank">{lang attachment_buy}</a>]

                                        <!--{/if}-->

                                <!--{/if}-->

                        </p>

                        <!--{if $attach['description']}--><p>{$attach[description]}</p><!--{/if}-->

                </dd>

  <!--{if !$attach['price'] || $attach['payed']}-->

  <EMBED src="attachment.php?aid=$attach[aid]&noupdate=yes" width=400 height=65 type=audio/mpeg ShowStatusBar="1" AutoStart="1" loop=10></EMBED>

<!--{/if}-->

<!--{elseif array_search(fileext($attach['filename']), $video)}-->

<dt>

                        $attach[attachicon]

                        <a href="attachment.php?aid=$attach[aid]" target="_blank">$attach[filename]</a>

                        <em>($attach[attachsize])</em>

                </dt>

                <dd>

                        <p>

                                $attach[dateline], {lang downloads}: $attach[downloads]

                                <!--{if $attach['readperm']}-->, {lang readperm}: <strong>$attach[readperm]</strong><!--{/if}-->

                                <!--{if $attach['price']}-->

                                        , {lang price}: <strong>{$extcredits[$creditstrans][title]} $attach[price] {$extcredits[$creditstrans][unit]}</strong>  [<a href="misc.php?action=viewattachpayments&aid=$attach[aid]" target="_blank">{lang pay_view}</a>]

                                        <!--{if !$attach['payed']}-->

                                                 [<a href="misc.php?action=attachpay&aid=$attach[aid]" target="_blank">{lang attachment_buy}</a>]

                                        <!--{/if}-->

                                <!--{/if}-->

                        </p>

                        <!--{if $attach['description']}--><p>{$attach[description]}</p><!--{/if}-->

                </dd>

  <!--{if !$attach['price'] || $attach['payed']}-->

  <EMBED src="attachment.php?aid=$attach[aid]&noupdate=yes" width=450 height=420 type=audio/mpeg ShowStatusBar="1" AutoStart="1"></EMBED>

<!--{/if}-->

<!--{elseif fileext($attach['filename'])=='swf'||fileext($attach['filename'])=='fla'}-->

       <dt>

                        $attach[attachicon]

                        <a href="attachment.php?aid=$attach[aid]" target="_blank">$attach[filename]</a>

                        <em>($attach[attachsize])</em>

                </dt>

                <dd>

                        <p>

                                $attach[dateline], {lang downloads}: $attach[downloads]

                                <!--{if $attach['readperm']}-->, {lang readperm}: <strong>$attach[readperm]</strong><!--{/if}-->

                                <!--{if $attach['price']}-->

                                        , {lang price}: <strong>{$extcredits[$creditstrans][title]} $attach[price] {$extcredits[$creditstrans][unit]}</strong>  [<a href="misc.php?action=viewattachpayments&aid=$attach[aid]" target="_blank">{lang pay_view}</a>]

                                        <!--{if !$attach['payed']}-->

                                                 [<a href="misc.php?action=attachpay&aid=$attach[aid]" target="_blank">{lang attachment_buy}</a>]

                                        <!--{/if}-->

                                <!--{/if}-->

                        </p>

                        <!--{if $attach['description']}--><p>{$attach[description]}</p><!--{/if}-->

                </dd>

  <!--{if !$attach['price'] || $attach['payed']}-->

  <embed id="player$attach[aid]" width="480" height="320" pluginspage="http://www.macromedia.com/go/getflashplayer" src="attachment.php?aid=$attach[aid]&nothumb=yes" type="application/x-shockwave-flash" menu="true" quality="high">

  </embed>

  <!--{/if}-->

<!--{elseif array_search(fileext($attach['filename']), $rms)}-->

       <dt>

                        $attach[attachicon]

                        <a href="attachment.php?aid=$attach[aid]" target="_blank">$attach[filename]</a>

                        <em>($attach[attachsize])</em>

                </dt>

                <dd>

                        <p>

                                $attach[dateline], {lang downloads}: $attach[downloads]

                                <!--{if $attach['readperm']}-->, {lang readperm}: <strong>$attach[readperm]</strong><!--{/if}-->

                                <!--{if $attach['price']}-->

                                        , {lang price}: <strong>{$extcredits[$creditstrans][title]} $attach[price] {$extcredits[$creditstrans][unit]}</strong>  [<a href="misc.php?action=viewattachpayments&aid=$attach[aid]" target="_blank">{lang pay_view}</a>]

                                        <!--{if !$attach['payed']}-->

                                                 [<a href="misc.php?action=attachpay&aid=$attach[aid]" target="_blank">{lang attachment_buy}</a>]

                                        <!--{/if}-->

                                <!--{/if}-->

                        </p>

                        <!--{if $attach['description']}--><p>{$attach[description]}</p><!--{/if}-->

                </dd>

  <!--{if !$attach['price'] || $attach['payed']}-->

<object width="420" height="280" classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" id="Player_name" viewastext>

  <param name="Autostart" value="0">

  <param name="CONTROLS" value="ImageWindow">

  <param name="CONSOLE" value="_master">

  <param name="LOOP" value="0">

  <param name="CENTER" value="0">

  <param name="_ExtentX" value="9525">

  <param name="_ExtentY" value="7938">

  <param name="SHUFFLE" value="0">                                

  <param name="PREFETCH" value="0">

  <param name="NOLABELS" value="0">

  <param name="NUMLOOP" value="0">

  <param name="MAINTAINASPECT" value="0">

  <param name="BACKGROUNDCOLOR" value="#000000">

  </object>

  <br>

  <object classid=clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA height=68 width="420" VIEWASTEXT>

  <param name="_ExtentX" value="9525">

  <param name="_ExtentY" value="1693">

  <param name="Autostart" value="0">

  <param name="LOOP" value="0">

  <param name="CENTER" value="0">

  <param name="SRC" value="$attach[url]/$attach[attachment]">

  <param name="SHUFFLE" value="0">

  <param name="PREFETCH" value="0">

  <param name="NOLABELS" value="0">

  <param name="NUMLOOP" value="0">

  <param name="MAINTAINASPECT" value="0">

  <param name="BACKGROUNDCOLOR" value="#000000">

  </object>

  <!--{/if}-->



<!--{elseif array_search(fileext($attach['filename']), $divx)}-->

       <dt>

                        $attach[attachicon]

                        <a href="attachment.php?aid=$attach[aid]" target="_blank">$attach[filename]</a>

                        <em>($attach[attachsize])</em>

                </dt>

                <dd>

                        <p>

                                $attach[dateline], {lang downloads}: $attach[downloads]

                                <!--{if $attach['readperm']}-->, {lang readperm}: <strong>$attach[readperm]</strong><!--{/if}-->

                                <!--{if $attach['price']}-->

                                        , {lang price}: <strong>{$extcredits[$creditstrans][title]} $attach[price] {$extcredits[$creditstrans][unit]}</strong>  [<a href="misc.php?action=viewattachpayments&aid=$attach[aid]" target="_blank">{lang pay_view}</a>]

                                        <!--{if !$attach['payed']}-->

                                                 [<a href="misc.php?action=attachpay&aid=$attach[aid]" target="_blank">{lang attachment_buy}</a>]

                                        <!--{/if}-->

                                <!--{/if}-->

                        </p>

                        <!--{if $attach['description']}--><p>{$attach[description]}</p><!--{/if}-->

                </dd>

  <!--{if !$attach['price'] || $attach['payed']}-->

<object

codebase="http://download.divx.com/player/DivXBrowserPlugin.cab" height="400" width="690" classid="clsid:67DABFBF-D0AB-41fa-9C46-CC0F21721616">

<param name="autoplay" value="false">

<param name="src" value="$attach[url]/$attach[attachment]" />

<param name="custommode" value="Stage6" />

<param name="showpostplaybackad" value="false" />

<embed type="video/divx" src="$attach[url]/$attach[attachment]" pluginspage="http://go.divx.com/plugin/download/" showpostplaybackad="false" custommode="Stage6" autoplay="false" height="400" width="720" />

</object>



  <!--{/if}-->

<!--/////////END------------->
复制代码最终效果见附件。

注意:因为rm、rmvb格式的播放器需要最终的地址, 系统默认rm、rmvb格式上传扩展名会修改为.attach。要实现rm格式的附件在线播放需要修改如下:
打开:include\post.func.php,查找:        static $safeext  = array('jpg', 'jpeg', 'gif', 'png', 'swf', 'bmp', 'txt', 'zip', 'rar', 'doc', 'mp3');
复制代码修改为:        static $safeext  = array('jpg', 'jpeg', 'gif', 'png', 'swf', 'bmp', 'txt', 'zip', 'rar', 'doc', 'mp3', 'rm', 'rmvb');
复制代码作用就是添加rm、rmvb为安全文件格式。保存!
回复

使用道具 举报

淄川婚庆网 发表于 2013-8-4 10:46:32 | 显示全部楼层
想要的是自己上传的MP3附件自动播放哦
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-9-22 11:39 , Processed in 0.142433 second(s), 16 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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