g_index.asp
上传用户:comthink
上传日期:2021-05-06
资源大小:1280k
文件大小:6k
源码类别:

WEB源码(ASP,PHP,...)

开发平台:

HTML/CSS

  1. <!--#include file="conn.asp"-->
  2. <!-- #include file="inc/const.asp" -->
  3. <!-- #include file="inc/ubbcode.asp" -->
  4. <%
  5. stats="查看留言"
  6. dim postid,titleimg,title,content,addtime,istop
  7. dim currentPage,totalrec,Pcount,page_count,endpage
  8. dim abgcolor
  9. if Cint(GroupSetting(5))=1 then
  10. Errmsg=Errmsg+"<br>"+"<li>您没有浏览班级留言的权限,请<a href=login.asp>登陆</a>或者同管理员联系。"
  11. founderr=true
  12. end if
  13. if founderr then
  14. call head()
  15. call head_var("错误信息",Request.ServerVariables("HTTP_REFERER"))
  16. call txl_error()
  17. else
  18. call head()
  19. call head_var("班级留言","g_index.asp")
  20. if founderr then
  21. call txl_error()
  22. else
  23. call main()
  24. if founderr then call txl_error()
  25. end if
  26. end if
  27. call foot()
  28. sub main()
  29. abgcolor="tablebody2"
  30. '---------------star------
  31. response.write "<table width="""&txl_body(0)&""" cellpadding=0 cellspacing=0 align=center style=""border:1px "&txl_body(9)&" solid; border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 1px;"">"  
  32. response.write "<tr> <td width=""20%"" bgcolor="&txl_body(10)&" align=center valign=top><br>"&_
  33. "<a href=g_post.asp><img src="&txl_info(6)&txl_skinpic(3)&"  height=25 border=0></a> <br><br>"&_
  34. "<a href=g_my.asp><img src="&txl_info(6)&txl_skinpic(4)&"  height=25 border=0></a> <br><br>"&_
  35. "<a href=g_down.asp><img src="&txl_info(6)&txl_skinpic(5)&"  height=25 border=0></a>"&_
  36. "</td><td width=""80%"" bgcolor="&txl_body(10)&"  valign=top><br>"
  37. '======================show========================
  38. currentPage=request("page")
  39. if currentpage="" or not isInteger(currentpage) then
  40. currentpage=1
  41. else
  42. currentpage=clng(currentpage)
  43. if err then
  44. currentpage=1
  45. err.clear
  46. end if
  47. end if
  48. set rs=server.createobject("adodb.recordset")
  49. sql="select g.postid,g.postuser,g.postuserid,g.titleimg,g.title,g.content,g.addtime,g.istop,"
  50.   sql=sql &" u.userid,u.oicq,u.email,u.userface,u.realname"
  51. sql=sql &" from gbook g inner join [user] U on U.UserID=g.postUserID and u.realname=g.postuser where g.rootid=0 order by g.istop desc,g.postid desc"
  52. rs.open sql,conn,1
  53. if rs.eof and rs.bof then
  54. response.write "<table width=""100%""><tr><td height=100 align=center class=tablebody1>  还没有同学留言,你来留言先。</font></td></tr></table>"
  55. else
  56. totalrec=rs.recordcount
  57.    if totalrec mod txl_Set(11)=0 then
  58.       Pcount= totalrec  txl_Set(11)
  59.    else
  60.       Pcount= totalrec  txl_Set(11)+1
  61.    end if
  62. RS.MoveFirst
  63. if currentpage > Pcount then currentpage = Pcount
  64.     if currentpage<1 then currentpage=1
  65. RS.Move (currentpage-1) * txl_Set(11)
  66. page_count=0
  67. do while not rs.eof and page_count < Clng(txl_Set(11))
  68. 'end
  69. response.write "<table width=""95%"" cellpadding=0 cellspacing=0 style=""border: 1px "&txl_body(9)&" dashed;"">"&_
  70. "<tr><td height=25 colspan=2 class=tablebody2>"&_
  71. "<table width=""100%"" cellpadding=0 cellspacing=0 border=0>"&_
  72. "<tr><td height=25 width=""50%"">"
  73. if rs("istop")=1 then
  74. response.write "&nbsp;<img border=0 src="""&txl_info(7)&"folder_top.gif"" align=absmiddle alt=固顶>" 
  75. else
  76. response.write "&nbsp;<img align=absmiddle src="""&txl_info(7)&"plus.gif"">"
  77. end if
  78. response.write "<img src="&txl_info(8)&rs("titleimg")&"> "&rs("title")&"</td>"&_
  79. "<td height=25 align=right width=""50%""><a href=g_reply.asp><img src="&txl_info(7)&"reply.gif border=0></a>&nbsp;<a href=""#top""><img src="&txl_info(7)&"gotop.gif border=0></a>&nbsp;</td>"&_
  80. "</tr></table></td> </tr>"&_
  81. "<tr><td width=100 height=100 class=tablebody1>"&_
  82. "<table align=left cellpadding=0 width=""100%"" style=""word-break:break-all;"">"&_
  83. "<tr><td align=center style=""line-height:200%""><a href=userinfo.asp?id="&rs(2)&"><img src="&rs(11)&" border=0><br><font color="&txl_body(20)&"><b>"&rs(1)&"</b></font></a></td>"&_
  84. "<td width=1 bgcolor="&txl_body(9)&"></td></tr>"&_
  85. "</table></td>"&_
  86.   "<td width=* class=tablebody1>"&_
  87. "<table width=""100%"" cellpaddin=0 cellspacing=0 border=0>"&_
  88. "<tr><td height=80 colspan=2><blockquote> "&ubbcode(rs(5))&" </blockquote></td>"&_
  89. "</tr><tr><td width=150>"
  90. %>
  91. <%
  92. dim canadmin
  93. canadmin=false
  94. if membername=rs(1) then
  95. canadmin=true
  96. elseif master=true then
  97. canadmin=true
  98. elseif supermaster=true then
  99. canadmin=true
  100. end if
  101. if canadmin=true then
  102. response.write "<a href=g_edit.asp?id="&rs(0)&"><img src="&txl_info(7)&"edit.gif border=0></a>&nbsp;<a href=g_admin.asp?action=del&id="&rs(0)&" onclick=""{if(confirm('确定执行选择的操作吗?')){return true;}return false;}""><img src="&txl_info(7)&"del.gif border=0></a>"
  103. end if
  104. if master or supermaster then
  105. if rs("istop")=0 then
  106. response.write "<a href=g_admin.asp?action=istop&id="&rs(0)&"><img src="&txl_info(7)&"istop.gif border=0></a>"
  107. else
  108. response.write "<a href=g_admin.asp?action=notop&id="&rs(0)&"><img src="&txl_info(7)&"notop.gif border=0></a>"
  109. end if
  110. end if
  111. response.write "</td><td align=right>发表时间: "&rs(6)&"&nbsp;</td></tr>"&_
  112. "</table></td></tr></table><br>"
  113. page_count=page_count+1
  114. rs.movenext
  115. loop
  116. end if
  117. '========================end===================
  118. %>
  119. <table border=0 cellpadding=0 cellspacing=0 width="95%">
  120. <tr><td valign=middle nowrap>
  121. 页次:<b><%=currentpage%></b>/<b><%=Pcount%></b>页
  122. &nbsp;
  123. 每页<b><%=txl_Set(11)%></b>条  总<b><%=totalrec%></b>条留言</td>
  124. <td valign=middle nowrap><div align=right><p>分页: 
  125. <%
  126. if currentpage > 4 then
  127. response.write "<a href=""?page=1"">[1]</a> ..."
  128. end if
  129. if Pcount>currentpage+3 then
  130. endpage=currentpage+3
  131. else
  132. endpage=Pcount
  133. end if
  134. for i=currentpage-3 to endpage
  135. if not i<1 then
  136. if i = clng(currentpage) then
  137. response.write " <font color="&txl_body(20)&">["&i&"]</font>"
  138. else
  139. response.write " <a href=""?page="&i&""">["&i&"]</a>"
  140. end if
  141. end if
  142. next
  143. if currentpage+3 < Pcount then
  144. response.write "... <a href=""?page="&Pcount&""">["&Pcount&"]</a>"
  145. end if
  146. %>
  147. </p></div></td></tr></table>
  148. <%
  149. rs.close
  150. set rs=nothing
  151. response.write "<br></td></tr></table>"
  152. end sub
  153. %>