创力网站管理系统-首页最新文章列表文字之间加分隔线效果!

来自站长百科
跳转至: 导航、​ 搜索

导航:返回上一页

创力网站管理系统-首页最新文章列表文字之间加分隔线效果!

修改INC目录下的Cl_Function_Article.asp文件中的

过程:ShowArticle


以下内容为程序代码:


'过程:ShowArticle(sChannelID,sClassID,sSpecialID,TopNum,TitleLen,ShowClassName,ShowProperty,

ShowPrefix,ShowAuthor,ShowDateType,ShowHits,ShowHot,IsElite,IsHot,UserName,CssStyle)

'参数:

' sChannelID ------ 频道ID

' sClassID ------ 栏目ID(0为全部,如果大于0,则调用指定栏目及其子栏目)

' sSpecialID ------ 专题ID(0为全部,如果大于0,刚调用指定专题)

' TopNum ------ 最多记录数,0为全部(用于分页显示)

' TitleLen ------ 标题最多字符数

' ShowClassName ------ 是否显示栏目名称(True为显示,False为不显示)

' ShowProperty ------ 是否显示文章属性(固顶/推荐/普通),(True为显示,False为不显示)

' ShowPrefix ------ 是否显示前缀如:[推荐][图文][注意]字样(True为显示,False为不显示)

' ShowAuthor ------ 是否显示文章作者,True为显示,False为不显示)

' ShowDateType ------ 显示更新日期的样式

' ---- 0(不显示)

' ---- 1(2004-10-01 23:45:45)

' ---- 2(年-月-日 时:分:秒)

' ---- 3(10-01 23:45)

' ---- 4(2004-10-01)

' ---- 5(2004年10月01日)

' ---- 6(10-01)

' ---- 7(20041001234545)

' ShowHits ------ 是否显示文章点击数(True为显示,False为不显示)

' ShowHot ------ 是否显示热门文章标志(True为显示,False为不显示)

' IsElite ------ 是否推荐(True为是,False为否)

' IsHot ------ 是否热门(True为是,False为否)

' UserName ------ 指定某用户(不指定请留空值或0)

' CssStyle ------ CSS样式

'====================================================================================================
Function ShowArticle(sChannelID,sClassID,sSpecialID,TopNum,TitleLen,ShowClassName,S

howProperty,ShowPrefix,ShowAuthor,ShowDateType,ShowHits,ShowHot,IsElite,

IsHot,UserName,CssStyle)

sChannelID  = Cl.ChkClng(sChannelID) : sClassID  = Cl.ChkClng(sClassID)

sSpecialID  = Cl.ChkClng(sSpecialID) : TopNum  = Cl.ChkClng(TopNum)

TitleLen  = Cl.ChkClng(TitleLen)  : ShowClassName = Cl.ChkCBool(ShowClassName)

ShowProperty = Cl.ChkCBool(ShowProperty) : ShowPrefix = Cl.ChkCBool(ShowPrefix)

ShowAuthor  = Cl.ChkCBool(ShowAuthor) : ShowDateType = Cl.ChkClng(ShowDateType)

ShowHits  = Cl.ChkCBool(ShowHits)  : ShowHot  = Cl.ChkCBool(ShowHot)

IsHot   = Cl.ChkCBool(IsHot)  : IsElite  = Cl.ChkCBool(IsElite)

UserName  = Trim(UserName)   : CssStyle  = Trim(CssStyle)

Cl.GetChannelSetting(sChannelID)

if TopNum=0 then

SqlInfo="Select "

else

SqlInfo="Select Top "&TopNum&" "

end if

SqlInfo = SqlInfo & "A.ArticleID,A.ClassID,C.ClassName,C.ParentPath,C.ClassDir,

C.ParentDir,A.Title,A.Author,A.CopyFrom,A.UpdateTime,A.Editor,

A.TitleFontColor,A.TitleFontType,A.Hits,A.OnTop,A.Hot,A.Elite,

A.Passed,A.Prefixion,A.Stars,A.PaginationType,A.ReadLevel,

A.ReadPoint,A.DefaultPicUrl,A.IsHtml,A.HtmlFileUrl,

Intro from Cl_Article A Inner Join Cl_Class C On 

A.ClassID=C.ClassID where A.Deleted="&FalseType&" and A.Passed="&TrueType&" and 

A.ChannelID="&sChannelID&" "

if sClassID>0 then

Dim tClass

Set tClass=Cl.Execute("select ClassID,Child,ParentPath,arrChildID from Cl_Class where 

ChannelID="&sChannelID&" and ClassID=" & sClassID)

if not(tClass.bof and tClass.eof) then

if tClass(1)>0 then

SqlInfo=SqlInfo & " and A.ClassID in (" & tClass(3) & ")"

else

SqlInfo=SqlInfo & " and A.ClassID=" & sClassID

end if

else

SqlInfo=SqlInfo & " and A.ClassID=" & sClassID

end if

Set tClass=Nothing

end if

if sSpecialID>0 then SqlInfo=SqlInfo & " and A.SpecialID=" & sSpecialID

if IsElite=True then SqlInfo=SqlInfo & " and A.Elite="&TrueType

if IsHot=True then SqlInfo=SqlInfo & " and A.Hits>=" & Clng(Cl.Web_Setting(14))

if UserName<>"" and UserName<>"0" then SqlInfo=SqlInfo &  " and A.Editor='" & UserName & "'"

SqlInfo=SqlInfo & " order by A.OnTop,A.UpdateTime desc,A.ArticleID desc"

Set rsInfo= Server.CreateObject("ADODB.Recordset")

OpenConn : rsInfo.open SqlInfo,Conn,1,1

if rsInfo.bof and  rsInfo.eof then

TotalPut=0

ShowArticle="<br><li>没有任何"&Cl.Channel_Setting(2)&"</li>"

rsInfo.close:set rsInfo=Nothing : Exit Function

End if

TotalPut=rsInfo.recordcount

if TopNum>0 then

SqlInfo=rsInfo.GetRows(-1)

else

if (TotalPut mod MaxPerPage)=0 then

TotalPages = TotalPut \ MaxPerPage

else

TotalPages = TotalPut \ MaxPerPage + 1

end if

if CurrentPage > TotalPages then CurrentPage=TotalPages

if CurrentPage < 1 then CurrentPage=1

rsInfo.move (CurrentPage-1)*MaxPerPage

SqlInfo=rsInfo.GetRows(MaxPerPage)

end if

rsInfo.close:set rsInfo=Nothing

dim strTemp,Linkurl,i

dim TitleStr,Author,AuthorName,AuthorEmail,sTitleLen

i=0:strTemp = "<table width=100% border=0 cellpadding=0 

cellspacing=0 class="""&CssStyle&""">"

For i=0 to Ubound(SqlInfo,2)

sTitleLen = TitleLen

strTemp = strTemp & "<tr><td align=""left""> "

if ShowProperty=True then

if SqlInfo(14,i)=True then

strTemp = strTemp & "<img src=""" & Cl.mainpic(13) & """ alt=""固顶""> "

elseif SqlInfo(16,i)=True then

strTemp = strTemp & "<img src=""" & Cl.mainpic(12) & """ alt=""推荐""> "

else

strTemp = strTemp & "<img src=""" & Cl.mainpic(11) & """ alt=""普通""> "

end if

end if

if ShowClassName=True and SqlInfo(1,i)<>ClassID then

strTemp=strTemp & "[<a href=""" & Cl.WebDir & Cl.GetClassUrl(Clng(Cl.Channel_Setting

(11)),Cl.HtmlDir,Cl.Channel_Setting(4),SqlInfo(3,i),SqlInfo(1,i),

SqlInfo(5,i),SqlInfo(4,i),Clng(Cl.Channel_Setting(10)),

Cl.Channel_Setting(13)) & """>" & SqlInfo(2,i) & "</a>] "

sTitleLen=sTitleLen-Len(SqlInfo(2,i))-1

end if

if ShowPrefix=True and SqlInfo(18,i)<>"" then

strTemp = strTemp & "<font color=blue>"&SqlInfo(18,i)&"</font>"

sTitleLen=sTitleLen-Len(SqlInfo(18,i))-2

end if

if Instr(SqlInfo(7,i),"|")>0 then

Author=Split(SqlInfo(7,i),"|")

AuthorName=Author(0)

AuthorEmail=Author(1)

else

AuthorName=SqlInfo(7,i)

AuthorEmail="Aspoo@126.com"

end if

if SqlInfo(24,i)=True and Clng(Cl.Channel_Setting(10))=1 then

LinkUrl=Cl.WebDir & SqlInfo(25,i)

else

LinkUrl=Cl.WebDir & Cl.Channel_Setting(4) & "/ArticleShow.asp?ArticleID="&SqlInfo(0,i)

end if

strTemp = strTemp & "<a href=""" & LinkUrl & """ 

title=""标题:" & SqlInfo(6,i) & vbcrlf & "作者:" 

& AuthorName & vbcrlf & "更新:" & SqlInfo(9,i) 

& vbcrlf & "点击:" & SqlInfo(13,i) & """ target=""_blank"">"

TitleStr=Cl.GotTopic(SqlInfo(6,i),sTitleLen)

TitleStr=Cl.GetTitleFont(TitleStr,SqlInfo(12,i))

TitleStr=Cl.FormatColor(TitleStr,SqlInfo(11,i))

strTemp=strTemp & TitleStr & "</a></td><td align=right>"

if ShowHot=True then

if CDate(SqlInfo(9,i))=date() then

strTemp= strTemp & "<img src=""" & Cl.mainpic(7) & """ alt=""最新"">"

elseif SqlInfo(13,i)>=Clng(Cl.Web_Setting(14)) then

strTemp= strTemp & "<img src=""" & Cl.mainpic(8) & """ alt=""热门"">"

end if

end if

if ShowAuthor=True or ShowHits=True or ShowDateType>0 then

strTemp = strTemp & "("

if ShowAuthor=True then

strTemp=strTemp & "<a href=""mailto:" & AuthorEmail & """>" & AuthorName & "</a>"

end if

if ShowHits=True then

if ShowAuthor=True then

strTemp=strTemp & ","

end if

strTemp=strTemp & Cl.FormatColor(SqlInfo(13,i),"#ff0033")

end if

if ShowDateType>0 then

if ShowHits=True or ShowAuthor=True then

strTemp=strTemp & ","

end if

if CDate(SqlInfo(9,i))=date() then

strTemp = strTemp & "<font color=red>"

else

strTemp = strTemp & "<font color=#999999>"

end if

strtemp = strtemp & Cl.Format_Time(SqlInfo(9,i),ShowDateType) & "</font>"

end if

strTemp = strTemp & ")</td></tr>"

end if

strTemp= strTemp & "<tr><td height=""1"" background=""/images/title_bottom_line.gif""></td><td 

height=""1"" background=""/images/title_bottom_line.gif""></td></tr>" 
Next

ShowArticle=strTemp & "</table>"

SqlInfo=""

end Function



参考来源[ ]