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

📄 g_index.asp

📁 java_blog是一个非常好的blog
💻 ASP
字号:
<%@LANGUAGE="VBScript" codepage="936"%>
<!--#include file="conn.asp"-->
<%
Function HTMLEncode(Str)
Str=Replace(Str,"java","……")
Str=Replace(Str,"frame","……")
Str=Replace(Str," ","&nbsp;")
Str=Replace(Str,Chr(10),"<br>")
HTMLEncode=Str
End Function
%>
<html>
<head>
<meta http-equiv="Page-Exit" content="revealTrans(Duration=1.0,Transition=12)">
<link href="skin_1.css" rel="stylesheet" type="text/css">
<STYLE type="text/css">
.re {
	background-color: #FFFFFF;
	margin: 4px;
	padding: 4px;
	border: 1px dotted #006699;
}
</STYLE>
<title>RanRan</title>
<link href="style.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
.STYLE2 {color: #FFFFFF}
-->
</style>
</head> 
<body bgcolor="#FFFFFF" text="#000000"> 
<table cellSpacing="0" cellPadding="0" width="612" border="0">
  <tr>
    <td><IMG src="../Images/guestbook.jpg" alt="1" width="350" height="40"></td>
    <td vAlign="bottom" align="right" width="200"><SCRIPT src="include/Rolls.js"></SCRIPT>
    </td>
  </tr>
</table>
<table width="177">
<tr>
<td width="87"><a href="g_add.asp"><img border="0" src="pt/fat.gif" width="80" height="20"></a></td>
    <td width="80"><img border="0" src="pt/re.gif" width="80" height="20" title="权限不够"></td>
</tr>
<% 
    dim rs 
    dim sql 
    msg_per_page    =    12                                                       '定义每页显示记录条数 
    set rs    =    server.createobject("adodb.recordset") 
    sql = "select * from gbook order by id desc"                                      'RanRan 
    rs.cursorlocation    =    3                                                    '使用客户端游标,可以使效率提高 
     
    rs.pagesize    =    msg_per_page                                                'http://www.zgrq.com 
    rs.open sql,conn,0,1                                                         

    if err.number<>0 then                                                        '错误处理 
        response.write "数据库操作失败:" & err.description 
        err.clear 
    else 
        if not (rs.eof and rs.bof) then                                            '检测记录集是否为空 
            totalrec    =    RS.RecordCount                                        'totalrec:总记录条数 
            if rs.recordcount mod msg_per_page    =    0 then                        '计算总页数,recordcount:数据的总记录数 
                n    =    rs.recordcount\msg_per_page                                'n:总页数 
            else                                                                 
                n    =    rs.recordcount\msg_per_page+1                         
            end if                                                                 

            currentpage    =    request("page")                                        'http://www.zgrq.com 
	 If currentpage <> "" then 
                currentpage =  cint(currentpage) 
                if currentpage < 1 then   
                    currentpage = 1 
                end if   
                if err.number <> 0 then  
                    err.clear 
                    currentpage    =    1 
                end if 
            else 
                currentpage = 1 
            End if                                                                 
            if currentpage*msg_per_page > totalrec and not((currentpage-1)*msg_per_page < totalrec)then  
                currentPage=1 
            end if 
            rs.absolutepage    =    currentpage                                    'absolutepage:设置指针指向某页开头                QQ:1019257
	 
            rowcount        =    rs.pagesize                                    'pagesize:设置每一页的数据记录数                         
            dim i 
            dim k 
%> 
<tr><td colspan=2 height=1></td></tr>
</table>
        <%do while not rs.eof and rowcount > 0%> 
<table width="610" border="0" cellspacing="0" cellpadding="1">
  <tr>
    <td><table width="600" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC">
        <tr>
          <td><table width="601" border="0" cellpadding="0" cellspacing="1" bgcolor="#FFFFFF">
              <tr> 
                <td colspan="2" bgcolor="#FFFFFF">
<table width="370" height="20" border="0" cellpadding="0" cellspacing="0">
                    <tr> 
                      <td width="177"><span class="text1" style="font-weight: bold">&nbsp;留言者:<font color="#000000">
                      <%if len(rs("user"))>7 then%><%=Left(rs("user"),7)%>...<%else%><%=rs("user")%><%end if%></font></span></td><td width="193"><div align="right"><font color="#666666"><%=rs("data")%>&nbsp;</font></div></td>
                    </tr>
                  </table></td>
              </tr>
              <tr> 
                <td width="73" valign="top" bgcolor="#FFFFFF"> 
                <div align="center" class="STYLE2"><img src=<%=rs("tx")%> width="50" height="60" title="<%=rs("user")%>"></div></td>
                <td width="449" bgcolor="#FFFFFF"> 
                  <table width="100%" border="0" cellspacing="0" cellpadding="1">
                    <tr>
                      <td valign="bottom">&nbsp;<a href="http://search.tencent.com/cgi-bin/friend/user_show_info?ln=<%=rs("qq")%>" title="OICQ:<%=rs("qq")%>" target="_blank"><img src="pt/qq.gif" width="45" height="18" border="0"></a> <a href="mailto:<%=rs("email")%>" title=email:<%=rs("email")%>><img src="pt/email.gif" width="45" height="18" border="0"></a> <%if session("admin")="" then%><img src="pt/edit.gif" width="47" height="18" title="权限不够" border="0"><%else%><a href="a_gbook.asp"><img src="pt/edit.gif" width="47" height="18" title="你没有足够权限进行管理" border="0"></a><%end if%> <%if session("admin")="" then%><img src="pt/reply.gif" width="45" height="18" border="0" title="你没有足够权限进行管理"><%else%><a href=g_reply.asp?id=<%=rs("id")%>><img src="pt/reply.gif" width="45" height="18" border="0" title="回复留言"></a><%end if%></td>
                    </tr>
                    <tr>
                      <td background="images/bg_dian.gif" height="1"></td>
                    </tr>
                  </table> 
                  <table width="100%" border="0" cellspacing="1" cellpadding="3" style="table-layout:fixed">
                    <tr> 
                      <td bgcolor="#FFFFFF" style="word-break:break-all">  <%=HTMLEncode(rs("content"))%><br> 
                      <div class="re"><font color=#FF000000>管理员回复:</font><%=HTMLEncode(rs("recontent"))%></div></td>
                    </tr>
                </table></td>
              </tr>
          </table></td>
        </tr>
      </table></td>
  </tr>
  <tr><td height=12></td></tr>
</table>

<% 
                        rowcount=rowcount-1 
                        rs.MoveNext 
            loop 
        end if 
    end if 
    rs.close 
    set rs=nothing 
%> 
   
</table> 
<table border="0" align=right> 
  <tr> 
    <td  valign="middle" align=right>  
      <%call listPages()%> 
    </td> 
  </tr> 
</table> 
</body> 
</html> 
<% 
    sub listPages()                                                                 
      'if n <= 1 then exit sub                                              
            for i=0 to n\msg_per_page-1  
                for j=1 to msg_per_page  
%>  
                    <font size="2" color="#006600"> 
                    <a href="<%=request.ServerVariables("script_name")%>?page=<%=i*msg_per_page+j %>">
[<% =i*msg_per_page+j %>]</a></font> 
         <%      
                next  
            next 
            EndPage = n mod msg_per_page  
            for j=1 to EndPage  
         %>  
                <font size="2" color="#006600"> 
                <a href="<%=request.ServerVariables("script_name")%>?page=<% =i*msg_per_page+j %>">
<%if (i*msg_per_page+j)=currentpage then%><b><%else%><%end if%>[<% =i*msg_per_page+j %>]</b></a></font> 
          <%next%> 
          <font color=black face="arial" > 
          &nbsp;<br>当前页:<font color=#FF000000><%=currentpage%>/<%=n%></font> 留言总数:<font color=#FF000000><%=totalrec%></font>&nbsp;条
 </font>每页显示:<font color=#FF000000>12</font><font color=black face="arial" >&nbsp;</font>条&nbsp;
          <%end sub
		  
		  %>

⌨️ 快捷键说明

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