wapblog.asp
资源名称:WAPblaog.zip [点击查看]
上传用户:dragonczj
上传日期:2013-07-05
资源大小:56k
文件大小:3k
源码类别:
手机WAP编程
开发平台:
Java
- <!--#include file="wapconn.asp"-->
- <!--#include file="wapstr.asp"-->
- <%
- response.ContentType="text/vnd.wap.wml;charset=utf-8"
- Response.Expires = -1
- Response.AddHeader "Pragma", "no-cache"
- Response.AddHeader "Cache-Control", "no-cache, must-revalidate"
- %><?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
- "http://www.wapforum.org/DTD/wml_1.1.xml">
- <wml>
- <%
- Dim Page
- Dim rs
- Dim Num
- Dim PageSize
- Dim PageCount
- Dim Pageto
- Dim i
- Dim SQL
- Dim Topic,fulltopic,boardname,ars,tempaimg,istop,LastPost
- Dim boardIDx
- dim lockboardid,board
- lockboardid=""
- If lockboardid<>"" then
- board=" and classid not in ("&lockboardid&") "
- else
- board=classid
- End If
- Page=1
- boardIDx=0
- if Request("Page")<>"" then Page = CLng(Request("Page"))
- if Request("classid")<>"" then boardIDx = CLng(Request("classid"))
- if boardIDx>0 then
- Set rs=conn.execute("select Count(*) from blog where classid=" & boardIDx)
- else
- Set rs=conn.execute("select Count(*) from blog where classid<>444 "&board&"")
- end if
- If not(rs.bof and rs.eof) then
- Num=rs(0)
- End if
- Rs.close:Set rs=Nothing
- PageSize=20
- PageCount=Cint((Num)/PageSize+0.5)
- Pageto=Cint(Num)
- if Page < 1 or IsNull(Page) Then Page = 1
- if Page > PageCount Then Page = PageCount
- %>
- <card id="wapblog" title="<%=converttowide("日志标题")%>">
- <p>
- <%
- if boardIDx>0 then
- sql="SELECT top "&cstr(PageSize*(Page))&" username,topic,id,classid,subjectid,addtime,iis,commentnum from blog where classid="& boardIDx &" and ishide<>'true' ORDER BY id desc"
- else
- sql="SELECT top "&cstr(PageSize*(Page))&" username,topic,id,classid,subjectid,addtime,iis,commentnum from blog where classid<>444 "&board&" and ishide<>'true' ORDER BY id desc"
- end if
- Set rs=conn.execute(SQL)
- If not(rs.bof and rs.eof) then
- rs.Move PageSize*(Page-1)
- While not rs.eof
- Topic=rs(1)
- fulltopic=Topic
- Topic=left(topic,25)
- dim username,xid
- username=rs(0)
- xid=rs(2)
- dim msql,rsmain,userid
- msql="select userid,username from [user] where username='"&username&"' and lockuser='false'"
- Set rsmain=Server.CreateObject("Adodb.RecordSet")
- rsmain.Open msql,Conn,1,1
- userid=rsmain(0)
- Response.Write "<a href=""wapview.asp?ID="&xid&""">"&(converttowide(Topic))&"</a><br/>"
- Response.Write "<a href=""wapuser.asp?id="&userid&""">"&(converttowide("作者:"))&(converttowide(username))&"</a><br/><br/>"
- rsmain.Close
- set rsmain=Nothing
- rs.MoveNext
- wend
- End if
- Rs.close:Set rs=Nothing
- Response.Write (converttowide("主题"))&Pageto&(converttowide("篇,每页"))&PageSize&(converttowide("篇,共分"))&PageCount&(converttowide("页。"))&"<br/>"
- if Page="" or Page=1 then
- Response.Write "<a href=""wapblog.asp?Page="&Page+1&"&classid="&boardIDx&""">"&(converttowide("下一页"))&"</a><br/>"
- elseif Page=PageCount then
- Response.Write"<a href=""wapblog.asp?Page="&Page-1&"&classid="&boardIDx&""">"&(converttowide("上一页"))&"</a><br/>"
- else
- Response.Write"<a href=""wapblog.asp?Page="&Page-1&"&classid="&boardIDx&""">"&(converttowide("上一页"))&"</a><br/>"
- Response.Write"<a href=""wapblog.asp?Page="&Page+1&"&classid="&boardIDx&""">"&(converttowide("下一页"))&"</a><br/>"
- end if
- Response.Write "<a href=""wapblog.asp"">"&(converttowide("返还最新日志"))&"</a><br/>"
- Response.Write "<a href=""wapuserlist.asp"">"&(converttowide("返还博客排行"))&"</a><br/>"
- Response.Write"<a href=""wap.asp"">"&(converttowide("返还博客首页"))&"</a>"
- %>
- </p>
- </card>
- </wml>