wapblogrcd.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. Set rs=conn.execute("select Count(*) from blog where passcheck<>'false' and isbest='true'")
  34. If not(rs.bof and rs.eof) then
  35. Num=rs(0)
  36. End if
  37. Rs.close:Set rs=Nothing
  38. PageSize=20
  39. PageCount=Cint((Num)/PageSize+0.5)
  40. Pageto=Cint(Num)
  41. if Page < 1 or IsNull(Page) Then    Page = 1
  42. if Page > PageCount Then  Page = PageCount
  43. %>
  44. <card id="wapblog" title="<%=converttowide("推荐日志")%>">
  45. <p>
  46. <%
  47. sql="SELECT top "&cstr(PageSize*(Page))&" username,topic,id,classid,subjectid,addtime,iis,commentnum from blog where classid<>444 "&board&" and passcheck<>'false' and ishide<>'true' and isbest='true' ORDER BY id desc"
  48. Set rs=conn.execute(SQL)
  49. If not(rs.bof and rs.eof) then
  50. rs.Move PageSize*(Page-1)
  51. While not rs.eof
  52. Topic=rs(1)
  53. fulltopic=Topic
  54. Topic=left(topic,25)
  55. dim username,xid
  56. username=rs(0)
  57. xid=rs(2)
  58. dim msql,rsmain,userid
  59. msql="select userid,username from [user] where username='"&username&"' and lockuser='false'"
  60. Set rsmain=Server.CreateObject("Adodb.RecordSet")
  61. rsmain.Open msql,Conn,1,1
  62. userid=rsmain(0)
  63. Response.Write "<a href=""wapview.asp?ID="&xid&""">"&(converttowide(Topic))&"</a><br/>"
  64. Response.Write "<a href=""wapuser.asp?id="&userid&""">"&(converttowide("作者:"))&(converttowide(username))&"</a><br/><br/>"
  65. rsmain.Close
  66. set rsmain=Nothing
  67. rs.MoveNext
  68. wend
  69. End if
  70. Rs.close:Set rs=Nothing
  71. Response.Write (converttowide("主题"))&Pageto&(converttowide("篇,每页"))&PageSize&(converttowide("篇,共分"))&PageCount&(converttowide("页。"))&"<br/>"
  72. if Page="" or Page=1 then
  73. Response.Write "<a href=""wapblogrcd.asp?Page="&Page+1&""">"&(converttowide("下一页"))&"</a><br/>"
  74. elseif Page=PageCount then
  75. Response.Write"<a href=""wapblogrcd.asp?Page="&Page-1&""">"&(converttowide("上一页"))&"</a><br/>"
  76. else
  77. Response.Write"<a href=""wapblogrcd.asp?Page="&Page-1&""">"&(converttowide("上一页"))&"</a><br/>"
  78. Response.Write"<a href=""wapblogrcd.asp?Page="&Page+1&""">"&(converttowide("下一页"))&"</a><br/>"
  79. end if
  80. Response.Write "<a href=""wapblog.asp"">"&(converttowide("返还最新日志"))&"</a><br/>"
  81. Response.Write "<a href=""wapuserlist.asp"">"&(converttowide("返还博客排行"))&"</a><br/>"
  82. Response.Write"<a href=""wap.asp"">"&(converttowide("返还博客首页"))&"</a>"
  83. %>
  84. </p>
  85. </card>
  86. </wml>