标题:各位大虾看看这有什么问题
只看楼主
cjrboy
Rank: 1
等 级:新手上路
帖 子:141
专家分:0
注 册:2004-11-30
 问题点数:0 回复次数:1 
各位大虾看看这有什么问题
function ShowNewArticle1(ArticleNum,TitleLen,ClassID,caname)
 dim sqlNew,rsNew,strrow,strcol,i,tmpdata
 dim sqlRoot,rsRoot,trs,arrClassID,TitleStr
 nt2003.Name=caname
    sqlRoot="select * From ArticleClass where ParentID=" & ClassID & ""
          Set rsRoot= Server.CreateObject("ADODB.RECORDSET")
    rsRoot.open sqlRoot,conn,1,1
          arrClassID=ClassID
          do while not rsRoot.eof
       arrClassID=arrClassID & "," & rsRoot(0)
       rsRoot.movenext
          loop
         rsRoot.close
          set rsRoot=nothing
    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"
       if instr(arrClassID,",")>0 then
        sqlNew=sqlNew &  " and A.ClassID in (" & arrClassID & ") order by A.articleid desc"
           else
        sqlNew=sqlNew &  " and A.ClassID=" & Clng(arrClassID) & " order by A.articleid desc"
           end if
  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
  
 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 width=100% ><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>"
   if datediff("d",strcol(3),date())<2 then  'By一枝梅
   tmpdata = tmpdata & "<font color=#FF0000> New</font>"
            end if 'By一枝梅
   tmpdata = tmpdata  & "</td></tr></table>"
                 end if
                next
 end if
 ShowNewArticle1=tmpdata
end function
2005-05-31 14:13
hxfly
Rank: 5Rank: 5
等 级:贵宾
威 望:17
帖 子:5807
专家分:108
注 册:2005-4-7
得分:0 
有错误吗?
错误信息帖出来

2005-05-31 16:10



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-19767-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.091288 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved