|
信息分类
|
|
|
|
<%
set rst=server.CreateObject("adodb.recordset")
sqlt="Select * from newscata order by rootid"
rst.Open sqlt,conn,1,3
do while not rst.EOF
trootid = rst("rootid")
t_child_cataid=split(trootid,",")
t_num = ubound(t_child_cataid)
if t_num=0 then
tempcataStr=""
tempcataStr=tempcataStr&"| "
tempcataStr=tempcataStr&" | "
tempcataStr=tempcataStr&" "
tempcataStr=tempcataStr&""
tempcataStr=tempcataStr&""
tempcataStr=tempcataStr&" | "
tempcataStr=tempcataStr&" "
tempcataStr=tempcataStr&" | "
tempcataStr=tempcataStr&" "
Response.Write tempcataStr
end if
rst.MoveNext
loop
rst.Close()
set rst=nothing
%>
|
|
|
| 今天是:<%= year(date)%>年<%= month(date)%>月<%= day(date)%>日 星期
<% dim week
week=weekday(date)
dim w
select case week
case 1: w="日"
case 2: w="一"
case 3: w="二"
case 4: w="三"
case 5: w="四"
case 6: w="五"
case 7: w="六"
end select
response.write(w)
%>
|
供求信息-<%
response.write "当前类别:"
if s_cataid <>"" then
response.write "全部信息"
set rsk=server.CreateObject("adodb.recordset")
sqlk="Select * from newscata where id="&s_cataid
rsk.Open sqlk,conn,1,3
if not rsk.eof then
krootid = rsk("rootid")
ktitle =rsk("title")
end if
rsk.close
set rsk=nothing
child_cataid=split(krootid,",")
for i=0 to ubound(child_cataid)-1
childcataid =cint(child_cataid(i))
sqlh = "select * from newscata where id="&childcataid
set rsh=Server.CreateObject("ADODB.RecordSet")
rsh.Open sqlh,conn,1,3
if not rsh.EOF then
htitle=rsh("title")
end if
rsh.close
set rsh=nothing
response.write " >> " & htitle &""
next
response.write " >> "&ktitle&""
else
response.write "全部信息"
end if
allcataid = ""
if s_cataid <>"" and IsNumeric(s_cataid) then
set rsm=server.CreateObject("adodb.recordset")
sqlm="Select * from newscata"
rsm.Open sqlm,conn,1,3
do while not rsm.eof
mrootid = rsm("rootid")
gotoid = rsm("id")
if InStr(krootid,",") < 1 then
mmrootid = split(mrootid,",")
if mmrootid(0) = krootid then
allcataid = allcataid&" or cataid =" &gotoid
end if
else
if InStr(mrootid,krootid) > 0 then
allcataid = allcataid&" or cataid =" &gotoid
end if
end if
rsm.movenext
loop
rsm.close
set rsm = nothing
end if
allcataid = trim(Mid(allcataid,4))
%> |
| |
|
<%
rs.PageSize=18
if page=0 then page=1
pages=rs.pagecount
if page > pages then page=pages
rs.AbsolutePage=page
for j=1 to rs.PageSize
%>
<%
rs.movenext
if rs.eof then exit for
next
%>
<%
if s_cataid=0 then
if s_keyword<>"" then
sql ="select * from news where title like '%"&s_keyword&"%' order by sortid desc"
else
sql="select * from news order by sortid desc"
end if
else
if s_keyword<>"" then
sql ="select * from news where ("&allcataid&") and title like '%"&s_keyword&"%' order by sortid desc"
else
sql="select * from news where ("&allcataid&") order by sortid desc"
end if
end if
rs.open sql,conn,1,1
rcount=rs.recordcount
if pmcount="" or isempty(pmcount) or pmcount<1 then
pmcount=15
end if
rs.pagesize=pmcount '设置每页数
mpage=rs.pagecount '得到总页数
pageno=RtnReplaceInt(Request("pageno"),1)
if cint(pageno)<1 or cint(pageno)>mpage then
pageno=1
end if
if rs.bof and rs.eof then
response.write "没有新闻 | "
else
rs.absolutepage=pageno '将指针移至指定页的第一条记录
loopno=pmcount
do while not rs.eof and loopno>0
%>
 |
<%if session("userstate")="" then%>
<%else%><%end if%>
<%response.write rs("title")%>
<%
if trim(rs("firstImageName"))<>"" then
response.write " "
end if
%>
">[
<%=FormatDateTime(rs("addtime"),vbshortdate)%>
] |
<%
rs.movenext
loopno=loopno-1
loop
end if
rs.close
set rs=Nothing
endconnection
%>
| 共 <%=cstr(rcount)%> 条信息 当前第 <%=cstr(pageno)&"/"&cstr(mpage)%>
页 每页 <%=pmcount%> 条
<%
if cint(pageno)>1 then%>
[ 上一页
]
<%
end if
if cint(pageno)
[ 下一页
]
<%end if%>
|
|
|
|