今天这一部分比较简单,主要是一些细节的修改,过几天会推出一个新的模块,用户上传附件的管理:
下面先来说说今天要说的内容:
1、附件部分:如果附件为Flash,那么直接显示:
修改AspNetForums.Controls.PostDisplay.TextPost:
增加一方法:
private string ShowFlash(string FlashFileUrl)
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
{
string temp = "<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0">"
+ "<param name="movie" value="" + FlashFileUrl + "">"
+ "<param name="quality" value="high">"
+ "<embed src="" + FlashFileUrl + "" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed>"
+ "</object>";
![](/Images/OutliningIndicators/InBlock.gif)
return temp;
![](/Images/OutliningIndicators/InBlock.gif)
}
![](/Images/OutliningIndicators/None.gif)
private string ShowFlash(string FlashFileUrl, int Width)
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
{
string temp = "<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="" + Width.ToString() + "">"
+ "<param name="movie" value="" + FlashFileUrl + "">"
+ "<param name="quality" value="high">"
+ "<embed src="" + FlashFileUrl + "" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="" + Width.ToString() + ""></embed>"
+ "</object>";
![](/Images/OutliningIndicators/InBlock.gif)
return temp;
![](/Images/OutliningIndicators/InBlock.gif)
}
![](/Images/OutliningIndicators/None.gif)
private string ShowFlash(string FlashFileUrl, int Width, int Height)
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
{
string temp = "<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="" + Width.ToString() + "" height="" + Height.ToString() + "">"
+ "<param name="movie" value="" + FlashFileUrl + "">"
+ "<param name="quality" value="high">"
+ "<embed src="" + FlashFileUrl + "" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="" + Width.ToString() + "" height="" + Height.ToString() + ""></embed>"
+ "</object>";
![](/Images/OutliningIndicators/InBlock.gif)
return temp;
}
在原来的第二篇文章的修改的基础上,在判断是否为图片后,增加如下判断:
//判断是否为Flash,如果为Flash,那么直接显示
//added by jacky 2004-9-4
if (contentType == "application/x-shockwave-flash")
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
{
body.Text += Globals.HtmlNewLine + ShowFlash(Globals.GetSiteUrls().PostAttachment(post.PostID) + "&guid=" + attachment.CheckGuid,600,450);
}
补充:别忘了在后台设置中增加swf文件的上传设置;
注意代码可能会缺少\,代码着色的时候被自动过滤掉了![](/Emoticons/sad_smile.gif)
![](/Emoticons/cry_smile.gif)