%
option explicit
%>
<%
dim strFileName,FileName
const MaxPerPage=20
dim totalPut,CurrentPage,TotalPages
dim i,j
dim keyword,strField
dim rsArticleList,sql,sqlPath,rsPath
dim ClassID
dim tClass,ClassName,RootID,ParentID,Depth,ParentPath,Child,ChildID,tID,tChild,ClassMaster
dim founderr
dim strPath,strPageTitle,PageTitle
ClassID=Trim(request("ClassID"))
ClassID=CLng(ClassID)
if ClassID>0 then
sql="select ClassName,RootID,ParentID,Depth,ParentPath,Child From ArticleClass where ClassID="& ClassID
set tClass=conn.execute(sql)
if tClass.bof and tClass.eof then
FoundErr=True
ErrMsg=ErrMsg & "
找不到指定的栏目
"
end if
end if
if FoundErr=True then
Call WriteErrMsg()
response.end
end if
'=================================================
'过程名:ShowBigClassArticle
'作 用:显示大类别最新文章,文章标题前面带【类别名称】
'参 数:ArticleNum ----最多显示多少篇文章
' TitleLen ----标题最多字符数,一个汉字=两个英文字符
' ClassID -----大类的ID
'ArticleNum,ClassID都已固定
'=================================================
sub ShowBigClassArticle(ArticleNum,TitleLen,ClassID)
dim sql,rsBCA
ClassID=80 '学校介绍 - 公立学校类
set tClass=conn.execute("select ClassName,RootID,ParentID,Depth,ParentPath,Child,ClassMaster From ArticleClass where ClassID=" & ClassID)
if tClass.bof and tClass.eof then
founderr=True
ErrMsg=ErrMsg & "
找不到指定的栏目
"
Call WriteErrMsg()
response.end
else
Child=tClass("Child")
sql="select A.ArticleID,A.ClassID,C.ClassName,A.Title,A.Keywords,A.Author,A.CopyFrom,year(A.updateTime) as UpdateYear,month(A.UpdateTime) as UpdateMonth,day(A.UpdateTime) as UpdateDay,A.UpdateTime,A.Editor,"
sql=sql & "A.Hits,A.OnTop,A.Hot,A.Elite,A.Passed,A.IncludePic from Article A"
sql=sql & " inner join ArticleClass C on A.ClassID=C.ClassID where A.Deleted=0 and A.Passed=1"
if ClassID>0 then
if Child>0 then
ChildID=""
set tClass=conn.execute("select ClassID from ArticleClass where ParentID=" & ClassID & " or ParentPath like '" & ParentPath & "," & ClassID & ",%'")
do while not tClass.eof
if ChildID="" then
ChildID=tClass(0)
else
ChildID=ChildID & "," & tClass(0)
end if
tClass.movenext
loop
sql=sql & " and A.ClassID in (" & ChildID & ")"
else
sql=sql & " and A.ClassID=" & ClassID
end if
end if
end if
sql=sql& "order by A.ArticleID desc"
' sql=sql&"order by A.UpdateTime desc"
Set rsBCA= Server.CreateObject("ADODB.Recordset")
rsBCA.open sql,conn,1,1
' if TitleLen<0 or TitleLen>255 then TitleLen=50
TitleLen=256
if rsBCA.bof and rsBCA.eof then
response.write "
无该类别文章
"
else
dim v_count,v_result '单元格计数
v_count=1
do while not rsBCA.eof
dim Tdate,Sdate
Tdate=rsBCA("UpdateYear")&"-"
Tdate=Tdate& rsBCA("UpdateMonth")&"-"
Tdate=Tdate& rsBCA("UpdateDay")
If CDate(Tdate)=date() Then
Sdate=""& Tdate&""
else
Sdate=Tdate
end if
v_result = v_count mod 3 '一行三个单元格
select case v_result
case 1
response.Write("