⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gbookmore.asp

📁 庐江二中
💻 ASP
字号:
<%PageName="gbook"%>
<!--#include file="conn.asp"-->
<!--#include file="const.asp"-->
<!--#include file=function.asp -->
<!--#include file="top1.asp"-->
<%
const MaxPerPage=10 '分页显示的纪录个数
const PageUrl="gbookmore.asp"
if not isempty(request("page")) then
currentPage=cint(request("page"))
thispage=currentpage
else
currentPage=1
thispage=currentpage
end if

dim SmallClassName,SmallClassType,SpecialName,NewsID,IfClass,thistitle
BigClassName=Request("BigClassName")
BigClassType=Request("BigClassType")
SmallClassName=Request("SmallClassName")
SmallClassType=Request("SmallClassType")
SpecialName=Request("SpecialName")
NewsID=Request("NewsID")
	
if BigClassName<>"" then
	IfClass="where BigClassName='"&BigClassName&"' "
	ifclassurl="BigClassName="&BigClassName&"&BigClassType="&BigClassType
	thistitle=BigClassName
end if
if SmallClassName<>"" then
	IfClass="where BigClassName='"&BigClassName&"' and SmallClassName='"&SmallClassName&"' "
	ifclassurl="BigClassName="&BigClassName&"&BigClassType="&BigClassType&"&SmallClassName="&SmallClassName&"&SmallClassType="&SmallClassType
	thistitle=SmallClassName
end if	
if SpecialName<>"" then
	IfClass="where SpecialName='"&SpecialName&"' "
	ifclassurl="SpecialName="&SpecialName
	thistitle=SpecialName
end if	
if NewsID<>"" then
	IfClass="where NewsID="&NewsID&" "
	ifclassurl="NewsID="&NewsID
	thistitle=NewsID&"号文章"
end if
%>

<table align=center border="0" width="<%=TableWidth%>" cellspacing="0" cellpadding="0" bgcolor="<%=MainBColor%>">
  <tr> 
  <%=OutTable("left")%> 
    <td height=20 align="center" bgcolor="<%=MainTColor%>"><%=thistitle%> 
      用户评论</td>
    <%=OutTable("right")%>
  </tr>
  <tr> 
    <%=OutTable("left")%>
    <td bgcolor="<%=CenterCColor%>"> <br>
      <%
sql="select * from gstbook "&IfClass&" order by id desc;"
rs.Open sql,conn,1,1
if rs.eof and rs.bof then
response.write "<p align='center'><b><br>暂 时 没 有 评 论<br><br></b></p>"
else
totalPut=rs.recordcount
if currentpage<1 then currentpage=1
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
if currentPage=1 then
showpage totalput,MaxPerPage,PageUrl
showContent
showpage totalput,MaxPerPage,PageUrl
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move  (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showpage totalput,MaxPerPage,PageUrl
showContent
showpage totalput,MaxPerPage,PageUrl
else
currentPage=1
showpage totalput,MaxPerPage,PageUrl
showContent
showpage totalput,MaxPerPage,PageUrl
end if
end if
end if
rs.close

Sub ShowContent%>
      <table border="1" width="98%" cellspacing="0" cellpadding="0" class=TableLine bordercolorlight="<%=MainBColor%>" bgcolor="<%=MainCColor%>" style="TABLE-LAYOUT: fixed" align="center">
        <tr> 
          <td width="10%" align="center" bgcolor="<%=MainTColor%>">发表人</td>
          <td width="50%" align="center" bgcolor="<%=MainTColor%>">评论内容</td>
          <td width="10%" align="center" bgcolor="<%=MainTColor%>">发表时间</td>
        </tr>
        <%
i=0
Do While Not rs.EOF
i=i+1
'-----------------------列表------------------------------
%>
        <tr> 
          <td width="10%" align="center"><%=rs("name")%></td>
          <td width="80%" style="WORD-WRAP: break-word">&nbsp;<%=rs("content")%><%=Refer%> 
            <div align="right"><br>
              [<a href="gbookread.asp?id=<%=rs("id")%>&more=1<%if ifclassurl<>"" then%>&<%end if%><%=ifclassurl%>">回复</a>] 
              <%if session("xpUser")<>"" and session("UserLevel")>=8 then%>
              [<a href="gbookdel.asp?id=<%=rs("id")%>&Page=<%=CurrentPage%>&more=1<%if ifclassurl<>"" then%>&<%end if%><%=ifclassurl%>">删除</a>] 
              <%end if%>
              &nbsp;&nbsp;</div>
          </td>
          <td width="10%" align="center"><%=DateValue(rs("datetime"))%></td>
        </tr>
        <%
if i>=MaxPerPage then exit do
rs.movenext
loop
%>
      </table>
      <br>
      <%End Sub

function showpage(totalnumber,MaxPerPage,filename)
if totalnumber mod MaxPerPage=0 then
n= totalnumber \ MaxPerPage
else
n= totalnumber \ MaxPerPage+1
end if
%>
      <table border="0" width="100%" cellspacing="0" cellpadding="0" bgcolor="<%=MainCColor%>">
        <tr> 
          <td> 
            <form method=Post action="<%=filename%>?PageName=<%=request("PageName")%>&add=<%=add%>&<%=request("gburl")%>" id=form1 name=form1>
              <center>
                共<font color="<%=AlertFColor%>"><b><%=totalnumber%></b></font>个评论 
                <%if CurrentPage<2 then%>
                &nbsp;首页 上一页&nbsp; 
                <%else%>
                &nbsp<a href="<%=filename%>?page=1<%if ifclassurl<>"" then%>&<%end if%><%=ifclassurl%>">首页</a>&nbsp; 
                <a href="<%=filename%>?page=<%=CurrentPage-1%><%if ifclassurl<>"" then%>&<%end if%><%=ifclassurl%>">上一页</a>&nbsp; 
                <%
end if
if n-currentpage<1 then
%>
                下一页 末页 
                <%else%>
                <a href="<%=filename%>?page=<%=CurrentPage+1%><%if ifclassurl<>"" then%>&<%end if%><%=ifclassurl%>">下一页</a>&nbsp; 
                <a href="<%=filename%>?page=<%=n%><%if ifclassurl<>"" then%>&<%end if%><%=ifclassurl%>">末页</a> 
                <%end if%>
                &nbsp;页次:<strong><font color="<%=AlertFColor%>"><%=CurrentPage%>/<%=n%></font></strong>页 
                转到: 
                <select name="page" size="1" onChange="javascript:submit()">
                  <%for i = 1 to n%>
                  <option value="<%=i%>" <%if cint(CurrentPage)=cint(i) then%> selected <%end if%>>第<%=i%>页</option>
                  <%next%>
                </select>
              </center>
            </form>
          </td>
        </tr>
      </table>
      <%
end function
%>
    </td>
    <%=OutTable("right")%> </tr>
</table>
<%set rs=nothing%>
<!--#include file="copyright.asp"-->

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -