日期:2014-05-16 浏览次数:21012 次
<%call News(5,40,VipInfo,"求职信息")%>
'*************************************
'调用文章News(文章行数,标题长度,表名,栏目名)
'row(文章行数):整数型
'TitleLen(标题长度):整数型
'DataFrom(表名):
'DataType(栏目名):
'*************************************
Function News(row,TitleLen,DataFrom,DataType)
dim rs,sql,i
set rs = server.createobject("adodb.recordset")
sql="select top "&row&" * from "&DataFrom&" where type='"&DataType&"' and checkstate=1"
rs.open sql,conn,1,1
if not(rs.eof and rs.bof) then
for i=1 to row
NewsTitle=StrLeft(rs("title"),TitleLen)
response.Write"<div class=""list-item"">"&vbCrLf
response.Write"<h2>"&NewsTitle&"</h2>"&vbCrLf
response.Write"<p>"&rs("content")&"</p>"&vbCrLf
response.Write"<small>联系人:"&rs("linkman")&"</small><small>联系电话:"&rs("tel")&"</small><small>"&rs("sdate")&"</small>"&vbCrLf
response.Write"</div>"&vbCrLf
rs.movenext
if rs.eof then exit for
next
else
response.Write"暂无信息"
end if
rs.close
set rs=nothing
End Function
<%call News(5,40,"VipInfo","求职信息")%>