?? mxgbookpage.asp
字號:
<!--#include file="../MxGbook_conn.asp"-->
<%
function changeStr(Str)
if len(Str)>0 then
'Str=Replace(Str,"&","&")
Str=Replace(Str,"<","<")
Str=Replace(Str,">",">")
Str=Replace(Str,"""",""")
Str=Replace(Str,"'","'")
Str=Replace(Str,"'","'")
end if
changeStr=Str
end function
Response.Charset = "gb2312"
Response.ContentType="text/xml"
Response.Write "<?xml version=""1.0"" encoding=""GB2312""?>"
dim idcount
dim pages
dim pagec
dim page
dim pagenc
dim pagenb
dim datafrom
dim taxis
taxis="order by pxid desc,id desc"
pages=15
datafrom="st_gbook"
pagenb=7
pagenc=(pagenb-1)/2
dim pagenmax
dim pagenmin
page=clng(request("page"))
dim sqlid
dim tiaojian
tiaojian=" where shenhe=1 "
sql="select count(id) as idcount from ["& datafrom &"] " & tiaojian
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,0,1
idcount=rs("idcount")
dim i
if(idcount>0) then
if(idcount mod pages=0)then
pagec=int(idcount/pages)
else
pagec=int(idcount/pages)+1
end if
sql="select id from ["& datafrom &"] " & tiaojian & taxis
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
rs.pagesize = pages
if page < 1 then page = 1
if page > pagec then page = pagec
if pagec > 0 then rs.absolutepage = page
for i=1 to rs.pagesize
if rs.eof then exit for
if(i=1)then
sqlid=rs("id")
else
sqlid=sqlid &","&rs("id")
end if
rs.movenext
next
end if
if(idcount>0 and sqlid<>"") then
dim outputB
outputB=""
dim outputS
dim mycontent,mygmcontent
sql="select * from ["& datafrom &"] where id in("& sqlid &")"&taxis
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,0,1
while(not rs.eof)
outputS="<info"
outputS=outputS&" MxGid="""&changeStr(rs("id"))&""""
outputS=outputS&" MxGname="""&changeStr(rs("name"))&""""
outputS=outputS&" MxGtitle="""&changeStr(rs("title"))&""""
mycontent=rs("content")
mycontent=changeStr(mycontent)
outputS=outputS&" MxGcontent="""&mycontent&""""
outputS=outputS&" MxGaddDate="""&changeStr(rs("addDate"))&""""
outputS=outputS&" MxGsex="""&changeStr(rs("sex"))&""""
outputS=outputS&" MxGqq="""&changeStr(rs("qq"))&""""
outputS=outputS&" MxGemail="""&changeStr(rs("email"))&""""
outputS=outputS&" MxGhomepage="""&changeStr(rs("homepage"))&""""
mygmcontent=rs("gmcontent")
mygmcontent=changeStr(mygmcontent)
outputS=outputS&" MxGgmcontent="""&mygmcontent&""""
outputS=outputS&" MxGgmaddDate="""&changeStr(rs("gmaddDate"))&""""
outputS=outputS&" />"
outputB=outputB&outputS
rs.movenext
wend
Response.Write "<MxGbook total="""&idcount&""" MxGbookCode="""&MxGbookCode&""" maxpage="""&pagec&""" page="""&page&""">"&outputB&"</MxGbook>"
else
Response.Write "<MxGbook total="""&idcount&""" MxGbookCode="""&MxGbookCode&"""></MxGbook>"
end if
rs.close
set rs=nothing
Response.End()
%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -