wapblog.asp
上传用户:dragonczj
上传日期:2013-07-05
资源大小:56k
文件大小:3k
源码类别:

手机WAP编程

开发平台:

Java

  1. <!--#include file="wapconn.asp"-->
  2. <!--#include file="wapstr.asp"-->
  3. <%
  4. response.ContentType="text/vnd.wap.wml;charset=utf-8"
  5. Response.Expires = -1
  6. Response.AddHeader "Pragma", "no-cache"
  7. Response.AddHeader "Cache-Control", "no-cache, must-revalidate"
  8. %><?xml version="1.0" encoding="UTF-8"?>
  9. <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
  10. "http://www.wapforum.org/DTD/wml_1.1.xml">
  11. <wml>
  12. <%
  13. Dim Page
  14. Dim rs
  15. Dim Num
  16. Dim PageSize
  17. Dim PageCount
  18. Dim Pageto
  19. Dim i
  20. Dim SQL
  21. Dim Topic,fulltopic,boardname,ars,tempaimg,istop,LastPost
  22. Dim boardIDx
  23. dim lockboardid,board
  24. lockboardid=""
  25. If lockboardid<>"" then
  26. board=" and classid not in ("&lockboardid&") "
  27. else
  28. board=classid
  29. End If
  30. Page=1
  31. boardIDx=0
  32. if Request("Page")<>"" then Page = CLng(Request("Page"))
  33. if Request("classid")<>"" then boardIDx = CLng(Request("classid"))
  34. if boardIDx>0 then
  35. Set rs=conn.execute("select Count(*) from blog where classid=" & boardIDx)
  36. else
  37. Set rs=conn.execute("select Count(*) from blog where  classid<>444 "&board&"")
  38. end if
  39. If not(rs.bof and rs.eof) then
  40. Num=rs(0)
  41. End if
  42. Rs.close:Set rs=Nothing
  43. PageSize=20
  44. PageCount=Cint((Num)/PageSize+0.5)
  45. Pageto=Cint(Num)
  46. if Page < 1 or IsNull(Page) Then    Page = 1
  47. if Page > PageCount Then  Page = PageCount
  48. %>
  49. <card id="wapblog" title="<%=converttowide("日志标题")%>">
  50. <p>
  51. <%
  52. if boardIDx>0 then
  53. 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"
  54. else
  55. 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"
  56. end if
  57. Set rs=conn.execute(SQL)
  58. If not(rs.bof and rs.eof) then
  59. rs.Move PageSize*(Page-1)
  60. While not rs.eof
  61. Topic=rs(1)
  62. fulltopic=Topic
  63. Topic=left(topic,25)
  64. dim username,xid
  65. username=rs(0)
  66. xid=rs(2)
  67. dim msql,rsmain,userid
  68. msql="select userid,username from [user] where username='"&username&"' and lockuser='false'"
  69. Set rsmain=Server.CreateObject("Adodb.RecordSet")
  70. rsmain.Open msql,Conn,1,1
  71. userid=rsmain(0)
  72. Response.Write "<a href=""wapview.asp?ID="&xid&""">"&(converttowide(Topic))&"</a><br/>"
  73. Response.Write "<a href=""wapuser.asp?id="&userid&""">"&(converttowide("作者:"))&(converttowide(username))&"</a><br/><br/>"
  74. rsmain.Close
  75. set rsmain=Nothing
  76. rs.MoveNext
  77. wend
  78. End if
  79. Rs.close:Set rs=Nothing
  80. Response.Write (converttowide("主题"))&Pageto&(converttowide("篇,每页"))&PageSize&(converttowide("篇,共分"))&PageCount&(converttowide("页。"))&"<br/>"
  81. if Page="" or Page=1 then
  82. Response.Write "<a href=""wapblog.asp?Page="&Page+1&"&amp;classid="&boardIDx&""">"&(converttowide("下一页"))&"</a><br/>"
  83. elseif Page=PageCount then
  84. Response.Write"<a href=""wapblog.asp?Page="&Page-1&"&amp;classid="&boardIDx&""">"&(converttowide("上一页"))&"</a><br/>"
  85. else
  86. Response.Write"<a href=""wapblog.asp?Page="&Page-1&"&amp;classid="&boardIDx&""">"&(converttowide("上一页"))&"</a><br/>"
  87. Response.Write"<a href=""wapblog.asp?Page="&Page+1&"&amp;classid="&boardIDx&""">"&(converttowide("下一页"))&"</a><br/>"
  88. end if
  89. Response.Write "<a href=""wapblog.asp"">"&(converttowide("返还最新日志"))&"</a><br/>"
  90. Response.Write "<a href=""wapuserlist.asp"">"&(converttowide("返还博客排行"))&"</a><br/>"
  91. Response.Write"<a href=""wap.asp"">"&(converttowide("返还博客首页"))&"</a>"
  92. %>
  93. </p>
  94. </card>
  95. </wml>