AL8 Forum
   登錄註冊幫助


標題: [D6.0] [轉帖] 上傳音樂及視頻類的附件在線播放 For D6正式版 By Oytktk(靖颯)
  本主題被作者加入到個人文集中  
 Eric03
 0046130
Rank: 7Rank: 7Rank: 7Rank: 7Rank: 7Rank: 7Rank: 7

頭銜: Moderator

暱稱: 遲去換機 ...

帖子: 6902

精華: 0

積分: -78 點

現金: 100 元

存款: 0 元

閱讀權限: 100

註冊: 2006-6-4

狀態: 離線
 
發表於 2007-9-7 22:05  資料  個人空間  短消息  加為好友  添加 Eric03 為MSN好友 通過MSN和 Eric03 交談
[轉帖] 上傳音樂及視頻類的附件在線播放 For D6正式版 By Oytktk(靖颯)

原帖於http://www.discuz.net/thread-729388-1-1.html
插件名稱: 上傳音樂及視頻類的附件在線播放
適用版本: D6正式版
語言編碼: BIG5
插件作者: Oytktk(靖颯)
繁  化: Eric03 # al8
效果演示: http://bbs.bizhs.com/viewthread.php?tid=84
插件功能: 讓上傳上來的可以播放類型的附件直接播放, 並與論壇安全設置以及出售和閱讀權限掛勾.
          支持的類別有3類:   'avi', 'wmv', 'mpg', 'wav', 'wma', 'mp3', 'mid', 'rm', 'rmvb', 'flash'

[安裝方法]:

1.include\attachment.func.php

查找:

$attach['attachimg'] = $showimages && $attachimgpost && $attach['isimage'] && (!$attach['readperm'] || $readaccess >= $attach['readperm']) ? 1 : 0;

下面加

//=========Start  上傳音樂及視頻類的附件在線播放 For D6正式版 By Oytktk(靖颯)
   $attach['attachwmv'] = $attachimgpost && in_array($extension, array('avi', 'wmv', 'mpg', 'wav', 'wma', 'mp3', 'mid')) && (!$attach['readperm'] || $readaccess >= $attach['readperm']) ? 1 : 0;
   $attach['attachrmv'] = $attachimgpost && in_array($extension, array('rm', 'rmvb')) && (!$attach['readperm'] || $readaccess >= $attach['readperm']) ? 1 : 0;
   $attach['attachswf'] = $attachimgpost && $extension == 'swf' && (!$attach['readperm'] || $readaccess >= $attach['readperm']) ? 1 : 0;
//=========End  上傳音樂及視頻類的附件在線播放 For D6正式版 By Oytktk(靖颯)

2. templates\default\discuzcode.htm

查找:

function attachlist($attach) {

改為:

//=========Start  上傳音樂及視頻類的附件在線播放 For D6正式版 By Oytktk(靖颯)
function attachlist($attach) {

再找:

function attachinpost($attach) {

改為:

//=========End  上傳音樂及視頻類的附件在線播放 For D6正式版 By Oytktk(靖颯)

function attachinpost($attach) {

把兩個//======之間的內容改為:

function attachlist($attach) {
global $attachrefcheck, $extcredits, $creditstrans, $ftp, $thumbstatus;
}-->
<!--{block return}-->
        <dl class="t_attachlist">
        <!--{if $attach['attachimg']}-->
                <dt>
                        $attach[attachicon]
                        <a href="attachment.php?aid=$attach[aid]&nothumb=yes" class="bold" target="_blank">$attach[filename]</a>
                        <em>($attach[attachsize])</em>
                </dt>
                <dd>
                        <p>
                                $attach[dateline]
                                <!--{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}-->
                        <!--{if !$attach['price'] || $attach['payed']}-->
                                <p>
                                <!--{if $thumbstatus && $attach['thumb']}-->
                                        <!--{if ($attachrefcheck || $attach['remote']) && !($attach['remote'] && substr($ftp['attachurl'], 0, 3) != 'ftp' && !$ftp['hideurl'])}-->
                                                <a href="#zoom"><img onclick="zoom(this, 'attachment.php?aid=$attach[aid]&noupdate=yes&nothumb=yes')" src="attachment.php?aid=$attach[aid]" alt="$attach[filename]" /></a>
                                        <!--{else}-->
                                                <a href="#zoom"><img onclick="zoom(this, '$attach[url]/$attach[attachment]')" src="$attach[url]/$attach[attachment].thumb.jpg" alt="$attach[filename]" /></a>
                                        <!--{/if}-->
                                <!--{else}-->
                                        <!--{if ($attachrefcheck || $attach['remote']) && !($attach['remote'] && substr($ftp['attachurl'], 0, 3) != 'ftp' && !$ftp['hideurl'])}-->
                                                <img src="attachment.php?aid=$attach[aid]&noupdate=yes" border="0" onload="attachimg(this, 'load')" onmouseover="attachimg(this, 'mouseover')" onclick="zoom(this, 'attachment.php?aid=$attach[aid]')" alt="$attach[filename]" />
                                        <!--{else}-->
                                                <img src="$attach[url]/$attach[attachment]" onload="attachimg(this, 'load')" onmouseover="attachimg(this, 'mouseover')" onclick="zoom(this, '$attach[url]/$attach[attachment]')" alt="$attach[filename]" />
                                        <!--{/if}-->
                                <!--{/if}-->
                                </p>
                        <!--{/if}-->
                </dd>
        <!--{elseif $attach['attachwmv'] }-->
                <dt>
                        $attach[attachicon]
                        <a href="attachment.php?aid=$attach[aid]&nothumb=yes" class="bold" target="_blank">$attach[filename]</a>
                        <em>($attach[attachsize])</em>
                </dt>
                <dd>
                        <p>
                                $attach[dateline]
                                <!--{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}-->
                        <!--{if !$attach['price'] || $attach['payed']}-->
                                <p>
                        <!--{if ($attachrefcheck || $attach['remote']) && !($attach['remote'] && substr($ftp['attachurl'], 0, 3) != 'ftp' && !$ftp['hideurl'])}-->
                                <br><object align="middle" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" class="OBJECT" width="460" height="350" ><PARAM NAME="AUTOSTART" VALUE="0" ><param name="ShowStatusBar" value="-1"><param name="Filename" value="attachment.php?aid=$attach[aid]&noupdate=yes"><embed type="application/x-oleobject" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" flename="mp" src="attachment.php?aid=$attach[aid]&noupdate=yes" width="460" height="350"></embed></object>
                        <!--{else}-->
                                <br><object align="middle" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" class="OBJECT" width="460" height="350" ><PARAM NAME="AUTOSTART" VALUE="0" ><param name="ShowStatusBar" value="-1"><param name="Filename" value="attachment.php?aid=$attach[aid]&noupdate=yes"><embed type="application/x-oleobject" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" flename="mp" src="$attach[url]/$attach[attachment]" width="460" height="350"></embed></object>
                        <!--{/if}-->
                                </p>
                        <!--{/if}-->
                </dd>
        <!--{elseif $attach['attachrmv'] }-->
                <dt>
                        $attach[attachicon]
                        <a href="attachment.php?aid=$attach[aid]&nothumb=yes" class="bold" target="_blank">$attach[filename]</a>
                        <em>($attach[attachsize])</em>
                </dt>
                <dd>
                        <p>
                                $attach[dateline]
                                <!--{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}-->
                        <!--{if !$attach['price'] || $attach['payed']}-->
                                <p>
                        <br><object classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="460" height="300" viewastext><param name="Autostart" value="0"><param name="CONTROLS" value="ImageWindow"><param name="enableContextMenu" value="0"><param name="CONSOLE" value="_master"><param name="LOOP" value="-1"><param name="CENTER" value="0"></object><br><object classid=clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA height="64" width="460" VIEWASTEXT><param name="_ExtentX" value="18256"><param name="_ExtentY" value="794"><param name="Autostart" value="0"><param name="loop" value="-1"><param name="center" value="0"><param name="Backgroundcolor" value="#000000"><param name="src" value="$attach[url]/$attach[attachment]"></object>
                                </p>
                        <!--{/if}-->
                </dd>
        <!--{elseif $attach['attachswf'] }-->
                <dt>
                        $attach[attachicon]
                        <a href="attachment.php?aid=$attach[aid]&nothumb=yes" class="bold" target="_blank">$attach[filename]</a>
                        <em>($attach[attachsize])</em>
                </dt>
                <dd>
                        <p>
                                $attach[dateline]
                                <!--{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}-->
                        <!--{if !$attach['price'] || $attach['payed']}-->
                                <p>
                        <!--{if ($attachrefcheck || $attach['remote']) && !($attach['remote'] && substr($ftp['attachurl'], 0, 3) != 'ftp' && !$ftp['hideurl'])}-->
                                <br><embed width="460" height="350" src="attachment.php?aid=$attach[aid]&noupdate=yes" type="application/x-shockwave-flash"></embed>
                        <!--{else}-->
                                <br><embed width="460" height="350" src="$attach[url]/$attach[attachment]" type="application/x-shockwave-flash"></embed>
                        <!--{/if}-->
                                </p>
                        <!--{/if}-->
                </dd>
        <!--{else}-->
                <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}-->
        </dl>
<!--{/block}-->
<!--{eval return $return;}-->
<!--{eval
}

補充:
如果想讓上傳的附件使用[attach]???[/attach]形式的也可以在線播放的話,
按以下方法修改.

打開  templates\default\discuzcode.htm

查找:

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

下面加:

                <!--{elseif $attach['attachwmv'] }-->
                        <br><dt>
                        $attach[attachicon]
                        <a href="attachment.php?aid=$attach[aid]&nothumb=yes" class="bold" target="_blank">$attach[filename]</a>
                        <em>($attach[attachsize])</em>
                        </dt>
                        <br><object align="middle" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" class="OBJECT" width="460" height="350" ><PARAM NAME="AUTOSTART" VALUE="0" ><param name="ShowStatusBar" value="-1"><param name="Filename" value="attachment.php?aid=$attach[aid]&noupdate=yes"><embed type="application/x-oleobject" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" flename="mp" src="attachment.php?aid=$attach[aid]&noupdate=yes" width="460" height="350"></embed></object>
                <!--{elseif $attach['attachrmv'] }-->
                        <br><dt>
                        $attach[attachicon]
                        <a href="attachment.php?aid=$attach[aid]&nothumb=yes" class="bold" target="_blank">$attach[filename]</a>
                        <em>($attach[attachsize])</em>
                        </dt>
                        <br><object classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="460" height="300" viewastext><param name="Autostart" value="0"><param name="CONTROLS" value="ImageWindow"><param name="enableContextMenu" value="0"><param name="CONSOLE" value="_master"><param name="LOOP" value="-1"><param name="CENTER" value="0"></object><br><object classid=clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA height="64" width="460" VIEWASTEXT><param name="_ExtentX" value="18256"><param name="_ExtentY" value="794"><param name="Autostart" value="0"><param name="loop" value="-1"><param name="center" value="0"><param name="Backgroundcolor" value="#000000"><param name="src" value="$attach[url]/$attach[attachment]"></object>
                <!--{elseif $attach['attachswf'] }-->
                        <br><dt>
                        $attach[attachicon]
                        <a href="attachment.php?aid=$attach[aid]&nothumb=yes" class="bold" target="_blank">$attach[filename]</a>
                        <em>($attach[attachsize])</em>
                        </dt>
                        <br><embed width="460" height="350" src="attachment.php?aid=$attach[aid]&noupdate=yes" type="application/x-shockwave-flash"></embed>

~完成~





以上言論只是個人意見, 如有雷同, 實屬巧合, 不喜勿插
 AL8 Forum © All rights reserved.
頂部
 csc726
 0040159
Rank: 3Rank: 3Rank: 3

頭銜: Conqueror

帖子: 166

精華: 0

積分: 2430 點

現金: 10 元

存款: 0 元

閱讀權限: 20

註冊: 2006-2-16

狀態: 離線
 
發表於 2007-9-7 22:11  資料  個人空間  短消息  加為好友 
第一個支持




 AL8 Forum © All rights reserved.
頂部
 corngrain
 0051511
Rank: 2Rank: 2

頭銜: Member

帖子: 99

精華: 0

積分: 1330 點

現金: 95 元

存款: 0 元

閱讀權限: 15

註冊: 2006-9-2

狀態: 離線
 
發表於 2007-9-7 23:09  資料  個人空間  短消息  加為好友 
5.5 可用嗎~~~~~~~~




 AL8 Forum © All rights reserved.
頂部
 nelsonck
 0067621
Rank: 3Rank: 3Rank: 3

頭銜: Conqueror

帖子: 149

精華: 0

積分: 1480 點

現金: 100 元

存款: 0 元

閱讀權限: 20

註冊: 2007-2-17

狀態: 離線
 
發表於 2007-9-8 11:40  資料  個人空間  短消息  加為好友 
Thanks a lot !




 AL8 Forum © All rights reserved.
頂部
 samspson
 0043778
Rank: 4Rank: 4Rank: 4Rank: 4
點擊查看 samspson 的詳細資料

頭銜: Lord

帖子: 369

精華: 0

積分: 3490 點

現金: 49 元

存款: 0 元

閱讀權限: 25

註冊: 2006-4-20

狀態: 離線
 
發表於 2007-9-8 22:48  資料  個人空間  短消息  加為好友 
有人成功安裝嗎?
我裝了後左下方會顯示有bug




 AL8 Forum © All rights reserved.
頂部
 Cutthroat
 0045173
Rank: 6Rank: 6Rank: 6Rank: 6Rank: 6Rank: 6

頭銜: Forum Legend

暱稱: 無知的人

自述: 我不懂 php

帖子: 1763

精華: 0

積分: 6830 點

現金: 642 元

存款: 17270 元

閱讀權限: 70

註冊: 2006-5-17

來自: Taiwan

狀態: 離線
 
發表於 2007-11-6 17:44  資料  個人空間  主頁 短消息  加為好友  添加 Cutthroat 為MSN好友 通過MSN和 Cutthroat 交談 Yahoo!
回覆 #5 samspson 的帖子

Bug到是沒有 , 應該是你修改中出錯 ! 但有一點可否再請高手修正 !

QUOTE:
[轉帖] 上傳音樂及視頻類的附件在線播放 For D6正式版 By Oytktk(靖颯)

在線播放 ? 可否讓此插件能夠 " 自動播放 " ?

該如何進行修改 ?




 AL8 Forum © All rights reserved.
頂部
 vincent19
 0045037
Rank: 5Rank: 5Rank: 5Rank: 5Rank: 5

頭銜: King

帖子: 746

精華: 0

積分: 8933 點

現金: 77 元

存款: 0 元

閱讀權限: 30

註冊: 2006-5-14

狀態: 離線
 
發表於 2007-11-6 17:53  資料  個人空間  短消息  加為好友 
純支持 ,多謝曬你牙 ^^




 AL8 Forum © All rights reserved.
頂部
 raynold
 0086165
Rank: 3Rank: 3Rank: 3
點擊查看 raynold 的詳細資料

頭銜: Conqueror

帖子: 113

精華: 0

積分: 1390 點

現金: 80 元

存款: 0 元

閱讀權限: 20

註冊: 2007-9-4

狀態: 離線
 
發表於 2007-11-9 12:10  資料  個人空間  短消息  加為好友 
謝謝你,,,好大幫助




 AL8 Forum © All rights reserved.
頂部
 loveyou1121
 0054484
Rank: 5Rank: 5Rank: 5Rank: 5Rank: 5

頭銜: King

帖子: 800

精華: 0

積分: 1550 點

現金: 121 元

存款: 8095 元

閱讀權限: 30

註冊: 2006-10-6

來自: ~澳門MACAU~

狀態: 離線
 
發表於 2007-11-17 17:40  資料  個人空間  短消息  加為好友 
唔安住 支持先~ 遲d裝




 AL8 Forum © All rights reserved.
頂部
 鬼鬼
 0024034
Rank: 3Rank: 3Rank: 3
點擊查看 鬼鬼 的詳細資料

頭銜: Conqueror

帖子: 229

精華: 0

積分: 2610 點

現金: 35 元

存款: 0 元

閱讀權限: 20

註冊: 2005-6-18

來自: les-pub.com

狀態: 離線
 
發表於 2007-12-3 16:16  資料  個人空間  主頁 短消息  加為好友 
錯誤............

Parse error: syntax error, unexpected $end in /home/lespubcomc/domains/les-pub.com/public_html/forumdata/templates/1_discuzcode.tpl.php on line 657

點搞




 AL8 Forum © All rights reserved.
頂部
 小蜜*
 0091075
Rank: 1

頭銜: Newbie

帖子: 6

精華: 0

積分: 80 點

現金: 100 元

存款: 0 元

閱讀權限: 10

註冊: 2007-11-12

來自: 屯門碼頭=]

狀態: 離線
 
發表於 2008-1-13 18:13  資料  個人空間  主頁 短消息  加為好友  添加 小蜜* 為MSN好友 通過MSN和 小蜜* 交談
成功喇@@謝謝




 AL8 Forum © All rights reserved.
頂部
 OPzero
 0047695
Rank: 3Rank: 3Rank: 3
點擊查看 OPzero 的詳細資料

頭銜: Conqueror

帖子: 127

精華: 0

積分: 720 點

現金: 0 元

存款: 73 元

閱讀權限: 20

註冊: 2006-7-7

狀態: 離線
 
發表於 2008-1-13 18:27  資料  個人空間  短消息  加為好友 
好食bw..................




 AL8 Forum © All rights reserved.
頂部
 wantgo
 0038167
Rank: 3Rank: 3Rank: 3

頭銜: Conqueror

帖子: 214

精華: 0

積分: 2030 點

現金: 95 元

存款: 0 元

閱讀權限: 20

註冊: 2006-1-7

來自: Taipei

狀態: 離線
 
發表於 2008-1-18 17:27  資料  個人空間  主頁 短消息  加為好友 
太棒了~
感謝樓主分享!




全球網路購物平台中心~
wantgomall.com
wantgo.com.cn
 AL8 Forum © All rights reserved.
頂部
 880904
 0087617
Rank: 1

頭銜: Newbie

帖子: 5

精華: 0

積分: 50 點

現金: 100 元

存款: 0 元

閱讀權限: 10

註冊: 2007-9-24

狀態: 離線
 
發表於 2008-7-4 22:21  資料  個人空間  短消息  加為好友 
Thanks a lot!!!I got you!!Yeah baby~




 AL8 Forum © All rights reserved.
頂部
 小草小薰女
 0032878
Rank: 3Rank: 3Rank: 3
點擊查看 小草小薰女 的詳細資料

頭銜: Conqueror

帖子: 155

精華: 0

積分: 1470 點

現金: 37 元

存款: 145 元

閱讀權限: 20

註冊: 2005-10-16

狀態: 離線
 
發表於 2008-7-6 19:13  資料  個人空間  主頁 短消息  加為好友 
我看到一些大陸網站有試聽幾十秒之後才購買的
如果可以做到這樣我一定超級支持~~先謝謝你




 AL8 Forum &cop