
<%  
'最新文章
function newtitle(num,relid,le,he)
if le="" or Isnumeric(le)=False then le=13
if num="" or Isnumeric(num)=False then num=0
if relid="" or Isnumeric(relid)=False then relid=0

If saytk=100 Then response.write"<ul class=""ulhot"">"
  dim a,rs1,gettest
votet=split(relid,"|")
If ubound(votet)>0 then
For iii=1 to ubound(votet)
         If votet(iii) <> "" Then
         vote_1=vote_1 & " or classid=" & votet(iii) &""
         End If
Next
         votett="where classid="&votet(0)&""&vote_1
Else
votett="where classid="&relid
If relid=0 Or relid="" Then votett=""
End if
               set rs1 = server.createobject("adodb.recordset")
rs1.open"select id,test,title,classid,hit from sms "&votett&" order by id desc",conn,1,1
          If rs1.eof Then 
            response.write("还没有文章！<br/>")
                  else
            rs1.Move(0)

                  a=1
            do while ((not rs1.EOF) and a <=num)
			If saytk=100 Then response.write"<LI>"
			If CLng(he)=1 Then response.write ubbimg(ubblese8)
			response.write"<a href='article.asp?id="&rs1("ID")&"&amp;class="&rs1("classid")&"&amp;sid="&sid&"&amp;saytk="&saytk&"'>"&left(UBB(rs1("title")),CLng(le))&"</a><br/>"
            If saytk=100 Then response.write"</LI>"


                  rs1.MoveNext
                      a=a+1
                            loop
end If
If saytk=100 Then response.write"</ul>"
rs1.close
set rs1=Nothing

end function
'最热文章
function hottitle(num,relid,le,he)
if le="" or Isnumeric(le)=False then le=13
if num="" or Isnumeric(num)=False then num=0
if relid="" or Isnumeric(relid)=False then relid=0
If saytk=100 Then response.write"<ul class=""alst"">"
        dim rs2,b
votet=split(relid,"|")
If ubound(votet)>0 then
For iii=1 to ubound(votet)
         If votet(iii) <> "" Then
         vote_1=vote_1 & " or classid=" & votet(iii) &""
         End If
Next
         votett="where classid="&votet(0)&""&vote_1
Else
votett="where classid="&relid
If relid=0 Or relid="" Then votett=""
End if
        set rs2 = server.createobject("adodb.recordset")
         rs2.open"select id,test,title,hit,classid from sms "&votett&" order by hit desc",conn,1,1
          If rs2.eof Then 
            response.write("还没有文章！<br/>")
                  else
            rs2.Move(0)
                 b=1
            do while ((not rs2.EOF) and b <=num)
               If saytk=100 Then response.write"<li>"
			   If CLng(he)=1 Then response.write ubbimg(ubblese17)
			   response.write"<a href='article.asp?id="&rs2("ID")&"&amp;class="&rs2("classid")&"&amp;saytk="&saytk&"&amp;sid="&sid&"'>"&left(UBB(rs2("title")),CLng(le))&"</a><br/>"
			   If saytk=100 Then response.write"</li>"
                  rs2.MoveNext
                      b=b+1
                            loop
                   end If
                   If saytk=100 Then response.write"</ul>"
                rs2.close
        set rs2=nothing
end function

'随机文章
function wendtitle(num,relid,le,he)
if le="" or Isnumeric(le)=False then le=13
if num="" or Isnumeric(num)=False then num=0
if relid="" or Isnumeric(relid)=False then relid=0
If saytk=100 Then response.write"<ul class=""alst"">"
votet=split(relid,"|")
If ubound(votet)>0 then
For iii=1 to ubound(votet)
         If votet(iii) <> "" Then
         vote_1=vote_1 & " or classid=" & votet(iii) &""
         End If
Next
         votett="where classid="&votet(0)&""&vote_1
Else
votett="where classid="&relid
If relid=0 Or relid="" Then votett=""
End if


sjwz=num 
a=1
Do While a<=sjwz
set rs3 = server.createobject("adodb.recordset")
        sql6="select id,classid,title from sms "&votett&" order by id desc"
        rs3.open sql6,conn,1,1
if rs3.recordcount <= 0 then
'       response.write("还没有文章！<br/>")
       else        
 randomize
sjj=int(rnd()*rs3.recordcount)+1
rs3.absoluteposition=sjj
If saytk=100 Then response.write"<li>"
If CLng(he)=1 Then response.write ubbimg(ubblese7)
response.write"<a href='/article.asp?id="&rs3("ID")&"&amp;class="&rs3("classid")&"&amp;sid="&sid&"&amp;saytk="&saytk&"'>"&UBB(left(rs3("title"),CLng(le)))&"</a><br/>"
If saytk=100 Then response.write"</li>"
end if
rs3.close
set rs3=nothing
a=a+1
Loop
If saytk=100 Then response.write"</ul>"
end function


       '最新图片
function newpic(num,relid)
  dim e,rs7
if relid<>0 then
gettest="where typeID=1 and lid="&relid
else
gettest="where typeID=1 "
end if

        set rs7 = server.createobject("adodb.recordset")
          rs7.open"select id,lid,name,idd from wjfile "&gettest&" order by id desc",conn,1,1
          If rs7.eof Then 
            response.write("还没有文件！<br/>")
                  else
            rs7.Move(0)

                  e=1
            do while ((not rs7.EOF) and e <=num)
               response.write"<a href='/picview.asp?id="&rs7("id")&"&amp;class="&rs7("lid")&"&amp;cid="&rs7("idd")&"&amp;saytk="&saytk&"&amp;sid="&sid&"'>"&Left(UBB(rs7("name")),14)&"</a><br/>"
                  rs7.MoveNext
                      e=e+1
                            loop
                   end if
                rs7.close
        set rs7=nothing
end function
       '最热图片
function hotpic(num,relid)
  dim f,rs8
if relid<>0 then
gettest="where typeID=1 and lid="&relid
else
gettest="where typeID=1 "
end if
        set rs8 = server.createobject("adodb.recordset")
          rs8.open"select id,lid,name,idd from wjfile "&gettest&" order by hit desc",conn,1,1
          If rs8.eof Then 
            response.write("还没有文件！<br/>")
                  else
            rs8.Move(0)

                  f=1
            do while ((not rs8.EOF) and f <=num)
               response.write"<a href='/picview.asp?id="&rs8("id")&"&amp;class="&rs8("lid")&"&amp;cid="&rs8("idd")&"&amp;saytk="&saytk&"&amp;sid="&sid&"'>"&left(UBB(rs8("name")),12)&"</a><br/>"
                  rs8.MoveNext
                      f=f+1
                            loop
                   end if
                rs8.close
        set rs8=nothing
end function
'随机图片
function wendpic(num,relid)

       dim rs9
sjwz=num 
a=1
Do While a<=sjwz

set rs9 = server.createobject("adodb.recordset")
        sql7="select id,lid,name from wjfile"
        rs9.open sql7,conn,1,1
if rs9.recordcount <= 0 then
'       response.write("还没有图片！<br/>")
       else        
 randomize
sjj=int(rnd()*rs9.recordcount)+1
rs9.absoluteposition=sjj
response.write"<a href='/picview.asp?id="&rs9("ID")&"&amp;class="&rs9("lid")&"&amp;saytk="&saytk&"&amp;sid="&sid&"'>"&left(UBB(rs9("name")),14)&"</a><br/>"

end If

rs9.close
set rs3=nothing
a=a+1
Loop

set rs9=nothing
end function

%>