插件功能: 讓上傳上來的可以播放類型的附件直接播放, 並與論壇安全設置以及出售和閱讀權限掛勾.
支持的類別有3類: 'avi', 'wmv', 'mpg', 'wav', 'wma', 'mp3', 'mid', 'rm', 'rmvb', 'flash'
$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]¬humb=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¬humb=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]¬humb=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]¬humb=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]¬humb=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
}
<!--{if $attach[description]}-->$attach[description]<br /><!--{/if}-->
<!--{elseif $attach['attachwmv'] }-->
<br><dt>
$attach[attachicon]
<a href="attachment.php?aid=$attach[aid]¬humb=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]¬humb=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]¬humb=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>