<%
dim sqlRoot,rsRoot,trs,arrClassID,TitleStr,ClassCount,iClassID
sqlRoot="select C.ClassID,C.ClassName,C.RootID,L.LayoutFileName,L.LayoutID,C.Child,C.Readme From ArticleClass C inner join Layout L on C.LayoutID=L.LayoutID where C.ParentID=0 and IsElite=True and LinkUrl='' order by C.RootID"
Set rsRoot= Server.CreateObject("ADODB.Recordset")
rsRoot.open sqlRoot,conn,1,1
dim sqlClassAD,rsClassAD,ClassAD
sqlClassAD="select * from Advertisement where IsSelected=True"
sqlClassAD=sqlClassAD & " and (ChannelID=0 or ChannelID=" & ChannelID & ")"
sqlClassAD=sqlClassAD & " and ADType=2 order by ID Desc"
set rsClassAD=server.createobject("adodb.recordset")
rsClassAD.open sqlClassAD,conn,1,1
if rsRoot.bof and rsRoot.eof then
response.Write("还没有任何栏目,请首先添加栏目。")
else
ClassCount=rsRoot.recordcount
iClassID=0
do while not rsRoot.eof
%>
<%
arrClassID=rsRoot(0)
response.write "" & rsRoot(1) & ""
if rsRoot(5)>0 then
set trs=conn.execute("select ClassID from ArticleClass where RootID=" & rsRoot(2) & " and Child=0 and LinkUrl=''")
do while not trs.eof
arrClassID=arrClassID & "," & trs(0)
trs.movenext
loop
end if
%>
<%
sql="select top 8 A.ArticleID,A.ClassID,L.LayoutID,L.LayoutFileName,A.Title,A.Key,A.Author,A.CopyFrom,A.UpdateTime,A.Editor,A.TitleFontColor,A.TitleFontType,"
sql=sql & "A.Hits,A.OnTop,A.Hot,A.Elite,A.Passed,A.IncludePic,A.Stars,A.PaginationType,A.ReadLevel,A.ReadPoint,A.DefaultPicUrl from Article A"
sql=sql & " inner join Layout L on A.LayoutID=L.LayoutID where A.Deleted=False and A.Passed=True and A.ClassID in (" & arrClassID & ") order by A.OnTop,A.ArticleID desc"
rsArticle.open sql,conn,1,1
if rsArticle.bof and rsArticle.eof then
response.write "
没有任何文章
"
else
call ArticleContent(20,True,True,False,1,False,True)
end if
rsArticle.close
%>
<%
iClassID=iClassID+1
if iClassID mod 2=0 then
response.write "