帮助中心
帮助类:
域名类
虚拟主机类
邮箱类
数据库类
IDC类
网站建设类
付款类
VPS类
其他类
<%'/style/info/listnews.asp?typeid=分类号&pagesize=条数
'listnewjs.asp一样支持这种方式
'/style/info/listnewsjs.asp?typeid=分类号&pagesize=条数
Set conn=Server.CreateObject("ADODB.Connection")
conn.Open Application("FreeHostDBlink")
Set dsnews = Server.CreateObject("ADODB.Recordset")
username=Application("superuser")
if session("agentname")<>"n" then username=session("agentname")
Sql="Select * from FreeHost.FreeHost_News where username='"&username&"' and (type1=1) order by id desc"
if Request.QueryString ("typeid")<>"" and IsNumeric(Request.QueryString("typeid")) then Sql="Select * from FreeHost.FreeHost_News where username='"&username&"' and typeid='"&Request.QueryString("typeid")&"' and (type1=0 or type1=1) order by id desc"
if Request.QueryString ("type1")<>"" And (Request.QueryString ("type1")="0" Or Request.QueryString ("type1")="1") and IsNumeric(Request.QueryString("type1")) then Sql="Select * from FreeHost.FreeHost_News where username='"&username&"' and type1='"&Request.QueryString("type1")&"' and (type1=0 or type1=1) order by id desc"
if Request.QueryString ("type2")<>"" and IsNumeric(Request.QueryString("type2")) then Sql="Select * from FreeHost.FreeHost_News where username='"&username&"' and type1=1 and type2='"&Request.QueryString("type2")&"' and (type1=0 or type1=1) order by id desc"
dsnews.PageSize = 30
if Request.QueryString ("pagesize")<>"" and IsNumeric(Request.QueryString("pagesize")) then dsnews.PageSize = Request.QueryString("pagesize")
dsnews.Open Sql,conn,1,1
%>
<%
if dsnews.Eof then
%>
数据库中不存在相关的记录。
<%
else
if Request.ServerVariables("QUERY_STRING")<>"" then
ask=Split(Request.ServerVariables("QUERY_STRING"), chr(38)&"pn")
else
ask=Split("freehost=1", "")
ask(0)="freehost=lsoft"
end if
pn=1
if Request.QueryString ("pn")<>"" then pn=Request.QueryString ("pn")
If dsnews.RecordCount <> 0 Then dsnews.AbsolutePage = CLng(pn)
if clng(pn)<=10 then
begini=1
if dsnews.PageCount<=10 then
endini=dsnews.PageCount
else
endini=10
end if
end if
%>
<%if clng(pn)<=10 then%>最新 <%for i=begini to endini
if clng(pn)=i then%>
[<%=i%>]<%else%>
[<%=i%>]<%end if%> <%next%>
<%else%>
最新[1]--[10] 现在是第
[<%=pn%>]页
共<%=dsnews.PageCount%>页 <%end if%><%If Clng(pn)>1 Then%>
上一页
<%End If%>|<%If Clng(pn)
下一页
<%End If%>
| 编号 |
标题 |
时间 |
<%
For N=1 To dsnews.PageSize
If dsnews.RecordCount=0 Then Exit For
%>
| <%=dsnews("id")%> |
|
<%=dsnews("posttime")%> |
<%
If clng(pn)=dsnews.PageCount Then
I = dsnews.RecordCount - (dsnews.PageCount-1) * dsnews.PageSize
If N=I Then Exit For
End If
dsnews.movenext
Next%>
<%
dsnews.close
set dsnews=nothing%>
<%end if%>