[問題]Attach Mod 多媒體檔名問題!

phpBB 2 MOD Support
無論是官方或非官方認證之外掛,安裝與使用問題討論。
(發表文章請按照公告格式發表,違者砍文)

版主: 版主管理群

主題已鎖定
ckjboy2003
星球公民
星球公民
文章: 70
註冊時間: 2003-12-25 19:35
來自: Taiwan

[問題]Attach Mod 多媒體檔名問題!

文章 ckjboy2003 »

請問一下前輩,Attach Mod提供很多不同的副檔名做多媒體的資源!
如用wmv時可以線上播放,不知道rm是否也可以做到\r
我試過將rm檔加入,但好像沒辦法線上播放!
有人試過嗎???
謝謝~請指教
頭像
dicks
星球公民
星球公民
文章: 40
註冊時間: 2004-08-15 19:04
聯繫:

文章 dicks »

代碼: 選擇全部

此為 media player

<OBJECT ID="WMPlay" WIDTH=320 HEIGHT=240
CLASSID="CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95"
CODEBASE="http://activex.microsoft.com/activex/controls/mplayer/en/
nsmp2inf.cab#Version=6,4,5,715"
STANDBY="Loading Microsoft? Windows Media? Player components..."
TYPE="application/x-oleobject">

<PARAM NAME="FileName" VALUE="****.mpg">
<PARAM NAME="ShowControls" VALUE="False">
<PARAM NAME="AutoRewind" VALUE="True">
<PARAM NAME="AutoStart" VALUE="True">

</OBJECT>
<br>
<br>

此為 realplayer
<OBJECT ID=RAOCX CLASSID=clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA WIDTH=320 HEIGHT=240 align="middle"> 
<PARAM NAME=controls VALUE=imagewindow> 
<PARAM NAME=console VALUE=Clip1> 
<PARAM NAME=autostart VALUE=True> 
<PARAM NAME=controls VALUE=playbutton> 
<PARAM NAME=controls VALUE=PositionSlider> 
<PARAM NAME=src VALUE=****.rm> 
<EMBED HEIGHT=144 WIDTH=176 src=*.rm CONTROLS=imagewindow AUTOSTART=false console=Clip1 plugpage=http://www.real.com></embed> 
</OBJECT> 
上段code 中的 * 改為你要的檔名就可以了!
其實這些網上都找的到,多找多看,你會學得更快!^^
ckjboy2003
星球公民
星球公民
文章: 70
註冊時間: 2003-12-25 19:35
來自: Taiwan

文章 ckjboy2003 »

^^ dicks,Thanks a lot!
但你知道的,透過Mod丟上去的檔名都是亂碼!
我怎麼去setting檔名呢??
頭像
dicks
星球公民
星球公民
文章: 40
註冊時間: 2004-08-15 19:04
聯繫:

文章 dicks »

你這算是有點"大工程喔" 要動點小手腳^^
首先找到:
在 attach_mod/displaying.php 內\r
找尋 if ($stream) 會找到二個
較前面的那個是 preview用的 後面 那個是 viewtopic時用的!
所以二個都要改 改這裡的用意是如果 attach的顯示方式為 串流(播放)的話\r
會run這裡! 所以我們可以在這裡動個手腳~~:)

代碼: 選擇全部

在\r
if ($stream)
{
找到 $template->assign_block_vars('postrow.attach.cat_stream', array(
在之前加上:

if(strrchr ($filename,".")=='.rm')    // 判斷是否副檔名為 rm
{
$template->assign_block_vars('postrow.attach.realplayer', array(
'U_DOWNLOAD_LINK' => $filename,
'S_UPLOAD_IMAGE' => $upload_image,
'U_DOWNLOAD_LINK' => append_sid('download.' . $phpEx . '?id=' . $attachments['_' . $post_id][$i]['attach_id']),
'DOWNLOAD_NAME' => $display_name,
'FILESIZE' => $filesize,
'SIZE_VAR' => $size_lang,
'COMMENT' => $comment,
'L_DOWNLOADED_VIEWED' => $lang['Viewed'],
'L_DOWNLOAD_COUNT' => sprintf($lang['Download_number'], $attachments['_' . $post_id][$i]['download_count']))
);					
}
else
{
				
找到\r
 'L_DOWNLOAD_COUNT' => sprintf($lang['Download_number'],$attachments['_' . $post_id][$i]['download_count']))
);
在 ; 之後加上 }

意思是判斷副檔名 若是 rm 就是 realplayer 若不是 就用mediaplayer來放!

二個 if ($stream) 的地方都要改…。

接著打開
templates/../viewtopic_attach_body.tpl

代碼: 選擇全部

找到 <!-- END cat_stream -->
在之後加上

	<!-- BEGIN realplayer -->
	
	<div align="center"><hr width="95%" /></div>
	<table width="95%" border="1" cellpadding="2" cellspacing="0" class="attachtable" align="center">
	<tr>
		<td width="100%" colspan="2" class="attachheader" align="center"><b><span class="gen">{postrow.attach.realplayer.DOWNLOAD_NAME}</span></b></td>
	</tr>
	<tr>
		<td width="15%" class="attachrow"><span class="genmed"> {L_DESCRIPTION}:</span></td>
		<td width="75%" class="attachrow">
			<table width="100%" border="0" cellpadding="0" cellspacing="4" align="center">
			<tr>
				<td class="attachrow"><span class="genmed">{postrow.attach.realplayer.COMMENT}</span></td>
			</tr>
			</table>
		</td>
	</tr>
	<tr>
		<td width="15%" class="attachrow"><span class="genmed"> {L_FILESIZE}:</span></td>
		<td width="75%" class="attachrow"><span class="genmed"> {postrow.attach.realplayer.FILESIZE} {postrow.attach.realplayer.SIZE_VAR}</td>
	</tr>
	<tr>
		<td width="15%" class="attachrow"><span class="genmed"> {postrow.attach.realplayer.L_DOWNLOADED_VIEWED}:</span></td>
		<td width="75%" class="attachrow"><span class="genmed"> {postrow.attach.realplayer.L_DOWNLOAD_COUNT}</span></td>
	</tr>
	<tr>
		<td colspan="2" align="center"><br />
		
		
</OBJECT>
<br>
<br>
<OBJECT ID=RAOCX CLASSID=clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA WIDTH=320 HEIGHT=240 align="middle"> 
<PARAM NAME=controls VALUE=imagewindow> 
<PARAM NAME=console VALUE=Clip1> 
<PARAM NAME=autostart VALUE=True> 
<PARAM NAME=controls VALUE=playbutton> 
<PARAM NAME=controls VALUE=PositionSlider> 
<PARAM NAME=src VALUE={postrow.attach.realplayer.U_DOWNLOAD_LINK}> 
<EMBED HEIGHT=144 WIDTH=176 src={postrow.attach.realplayer.U_DOWNLOAD_LINK} CONTROLS=imagewindow AUTOSTART=false console=Clip1 plugpage=http://www.real.com></embed> 
</OBJECT> 		
		
 <br /><br />
		</td>
	</tr>
	</table>
	<div align="center"><hr width="95%" /></div>
	<!-- END realplayer -->	

意思是,這裡是播放realplayer的區塊…如此完成。 所以當 上傳為 rm的副檔名就是以realplayer來放了~~~
當然你也能自行在 if( 加上 .ram 等也是realplayer的格式囉!
如此大功告成了!
ckjboy2003
星球公民
星球公民
文章: 70
註冊時間: 2003-12-25 19:35
來自: Taiwan

文章 ckjboy2003 »

God!dicks,你真不愧是一個軟體工程師!真是服了你,也很感謝你的熱心!
我等等try try看!應該沒問題!
有任何問題在提出來討論!希望你不閒煩喔~^^
主題已鎖定

回到「外掛問題討論」