易知乐学网
 当前位置:首页 > 风讯专区 > 使用技巧 > 正文  

新闻列表增加样式列表,调用更自由

作者:  日期:


   Set RsNewsListObj = Conn.Execute("FS_ReFunGetOneNewsList '"&NewsListStyleStr&"'")
   if Not RsNewsListObj.Eof then
    StyleContent = RsNewsListObj("Content")
    '标题
    if Not IsNull(RsNewsObj("Title")) then
     StyleContent = Replace(StyleContent,"{News_Title}",NaviPicStr & ClassCNName & "<a " & GetCSSStyleStr(CSSStyleStr) & " href=""" & GetOneNewsLinkURL(RsNewsObj("NewsID")) & """ " & OpenModeStr & ">" & RsNewsObj("Title") & "</a>")
    else
     StyleContent = Replace(StyleContent,"{News_Title}","")
    end if
    '副标题
    if Not IsNull(RsNewsObj("SubTitle")) then
     StyleContent = Replace(StyleContent,"{News_SubTitle}",RsNewsObj("SubTitle"))
    else
     StyleContent = Replace(StyleContent,"{News_SubTitle}","")
    end if
    '新闻点击率
    'StyleContent = Replace(StyleContent,"","<script src=" & AvailableDoMain & "/" & "Click.asp?NewsID="& RsNewsObj("NewsID") &"></script>")'打开列表就会使点击率增加
    if Not IsNull(RsNewsObj("ClickNum")) then
     StyleContent = Replace(StyleContent,"",RsNewsObj("ClickNum"))
    else
     StyleContent = Replace(StyleContent,"","")
    end if
    '来源
    if Not IsNull(RsNewsObj("TxtSource")) then
     StyleContent = Replace(StyleContent,"www.foosun.net",RsNewsObj("TxtSource"))
    else
     StyleContent = Replace(StyleContent,"www.foosun.net","")
    end if
    '作者
    if Not IsNull(RsNewsObj("Author")) then
     StyleContent = Replace(StyleContent,"{News_Author}",RsNewsObj("Author"))
    else
     StyleContent = Replace(StyleContent,"{News_Author}","")
    end if
    '责任编辑
    if Not IsNull(RsNewsObj("Editer")) then
     StyleContent = Replace(StyleContent,"{News_Editer}",RsNewsObj("Editer"))
    else
     StyleContent = Replace(StyleContent,"{News_Editer}","")
    end if
    '添加时间
    if Not IsNull(RsNewsObj("AddDate")) then
     StyleContent = Replace(StyleContent,"2006-2-19",DateFormat(RsNewsObj("AddDate"),DateRuleStr))
    else
     StyleContent = Replace(StyleContent,"2006-2-19","")
    end if
    '===========================================
    '控制新闻列表中的文章内容字数
    TempStr = LoseHtml(RsNewsObj("Content"))
    If len(TempStr)>ContentLimitStr then
     TempStr = left(TempStr,ContentLimitStr) & "......"
    End If
    '==========================================
    if Not IsNull(TempStr) then
     StyleContent = Replace(StyleContent,"{News_Content}",TempStr)
    else
     StyleContent = Replace(StyleContent,"{News_Content}","")
    end if
    '图片
    if Not IsNull(RsNewsObj("PicPath")) then
     StyleContent = Replace(StyleContent,"{News_Pic}","<img border=""0"" width="""&PicWidthStr&""" height="""&PicHeightStr&""" src=""" & RsNewsObj("PicPath") & """>")

本新闻共4页,当前在第2页  1  2  3  4  

文章来源:www.foosun.net
责任编辑:老冬瓜
 
Web EasyHot.com
推荐
·2007年国家电子政务总体框架
·2006年最伟大的IT人物10强
·软件需求的层次
·坦诚面对自己的弱点
·易用性就这三条原则
·IT治理的两个模型及其比较分析
·面向.NET开发人员的Ajax 技术平
·软件项目管理常见问题分析
·P2P的黑暗日:主力服务器(Razor
·企业信息化的出路在于标准化