| 在inc/syscode_Article.asp 这个文件中,找到如下函数名:
'================================================= '过程名:ShowNewArticle '作 用:显示最新文章 '参 数:ArticleNum ----最多显示多少篇文章 ' TitleLen ----标题最多字符数,一个汉字=两个英文字符 '================================================= function ShowNewArticle(ArticleNum,TitleLen) dim sqlNew,rsNew,strrow,strcol,i,tmpdata nt2003.Name="NewArticle" If nt2003.ObjIsEmpty() Then sqlNew="select top 20 A.ArticleID,A.Title,A.Author,A.UpdateTime,A.Hits,A.ReadLevel,L.LayoutFileName from article A inner join Layout L on L.LayoutID=A.LayoutID where A.Deleted=False and A.Passed=True order by A.articleid desc" Set rsNew = nt2003.execute(sqlNew) if rsNew.bof and rsNew.eof then nt2003.value="" else nt2003.value = rsNew.GetString(,,"|||","@@@","") end if rsNew.close set rsNew=nothing end if if TitleLen<0 or TitleLen>255 then TitleLen=50 if nt2003.value="" then tmpdata = "<font color=#ff9900>· </font>没有任何文章" else strrow=Split(nt2003.value,"@@@") dim loopnum if ArticleNum<UBound(strrow) then loopnum=ArticleNum-1 else loopnum=UBound(strrow)-1 end if for i = 0 to loopnum strcol=Split(strrow(i),"|||") if strcol(5)=>Userlevel then tmpdata = tmpdata & "<table width=100% border=0 cellpadding=0 cellspacing=0><tr><td><font color=#ff9900>· </font><a href='" & strcol(6) & "?ArticleID=" & strcol(0) &"' title='文章标题:" & strcol(1) & vbcrlf & "文章作者:" & strcol(2) & vbcrlf & "更新时间:" & strcol(3) & vbcrlf & "点击次数:" & strcol(4) & "' target='_blank'>" & gotTopic(strcol(1),TitleLen) & "</a></td><td width=50 align=right>" if datediff("d",strcol(3),date())<2 then 'By一枝梅 tmpdata = tmpdata & "<img src="/images/news.gif" border='0' attle='两天内更新文章'>" end if 'By一枝梅 if datediff("d",strcol(3),date())<2 then 'By一枝梅 tmpdata = tmpdata & "</td><td width=50 align=right>[<font color=red>" else tmpdata = tmpdata & "</td><td width=50 align=right>[<font color=#999999>" end if 'By一枝梅 if month(strcol(3))<10 then tmpdata = tmpdata & "0" end if tmpdata = tmpdata & month(strcol(3)) & "-" if day(strcol(3))<10 then tmpdata = tmpdata & "0" end if tmpdata = tmpdata & day(strcol(3)) & "</font>]</td></tr></table>" end if next end if ShowNewArticle=tmpdata end function
改成下面一段就可以了:
'================================================= '过程名:ShowNewArticle '作 用:显示最新文章 '参 数:ArticleNum ----最多显示多少篇文章 ' TitleLen ----标题最多字符数,一个汉字=两个英文字符 '================================================= function ShowNewArticle(ArticleNum,TitleLen) dim sqlNew,rsNew,strrow,strcol,i,tmpdata nt2003.Name="NewArticle" If nt2003.ObjIsEmpty() Then sqlNew="select top 20 A.ArticleID,A.Title,A.Author,A.UpdateTime,A.Hits,A.ReadLevel,L.LayoutFileName from article A inner join Layout L on L.LayoutID=A.LayoutID where A.Deleted=False and A.Passed=True order by A.articleid desc" Set rsNew = nt2003.execute(sqlNew) if rsNew.bof and rsNew.eof then nt2003.value="" else nt2003.value = rsNew.GetString(,,"|||","@@@","") end if rsNew.close set rsNew=nothing end if if TitleLen<0 or TitleLen>255 then TitleLen=50 if nt2003.value="" then tmpdata = "<font color=#ff9900>· </font>没有任何文章" else strrow=Split(nt2003.value,"@@@") dim loopnum if ArticleNum<UBound(strrow) then loopnum=ArticleNum-1 else loopnum=UBound(strrow)-1 end if for i = 0 to loopnum strcol=Split(strrow(i),"|||") tmpdata = tmpdata & "<table width=100% border=0 cellpadding=0 cellspacing=0><tr><td><font color=#ff9900>· </font><a href='" & strcol(6) & "?ArticleID=" & strcol(0) &"' title='文章标题:" & strcol(1) & vbcrlf & "文章作者:" & strcol(2) & vbcrlf & "更新时间:" & strcol(3) & vbcrlf & "点击次数:" & strcol(4) & "' target='_blank'>" & gotTopic(strcol(1),TitleLen) & "</a></td><td align=right></td></tr></table>" end if ShowNewArticle=tmpdata end function |