JACKY SUN

Good Good Study, Day Day Up.

HiForums(Asp.Net Forums)开发指南(三):在论坛中直接显示FLASH附件

来源:原创 发表时间:2006-07-19 22:41:19 查看:1044 评论:0

今天这一部分比较简单,主要是一些细节的修改,过几天会推出一个新的模块,用户上传附件的管理:

下面先来说说今天要说的内容:
1、附件部分:如果附件为Flash,那么直接显示:
  修改AspNetForums.Controls.PostDisplay.TextPost:
        增加一方法:

private string ShowFlash(string FlashFileUrl)
        
{
            
string temp = ""
                
+ "">"
                
+ ""
                
+ "" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash">"
                
+ "";

            
return temp;

        }


        
private string ShowFlash(string FlashFileUrl, int Width)
        
{
            
string temp = " + Width.ToString() + "">"
                
+ "">"
                
+ ""
                
+ "" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="" + Width.ToString() + "">"
                
+ "";

            
return temp;

        }


        
private string ShowFlash(string FlashFileUrl, int Width, int Height)
        
{
            
string temp = "+ Width.ToString() + "" height="" + Height.ToString() + "">"
                
+ "">"
                
+ ""
                
+ "" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="" + Width.ToString() + "" height="" + Height.ToString() + "">"
                
+ "";

            
return temp;
        }

在原来的第二篇文章的修改的基础上,在判断是否为图片后,增加如下判断:

//判断是否为Flash,如果为Flash,那么直接显示
                
//added by jacky 2004-9-4
                if (contentType == "application/x-shockwave-flash")
                
{
                    body.Text 
+= Globals.HtmlNewLine + ShowFlash(Globals.GetSiteUrls().PostAttachment(post.PostID) + "&guid=" + attachment.CheckGuid,600,450);
                }

    补充:别忘了在后台设置中增加swf文件的上传设置;
    注意代码可能会缺少\,代码着色的时候被自动过滤掉了

</object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http:></object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http:></object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http:>
</object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http:></object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http:></object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http:>



姓名:  
邮件: 不在页面显示,作者回复后将通过邮件通知您
网站:
验证码:  
内容: