📄 showpage.asp
字号:
<script language="vbscript" runat="server">
'//技术支持:http://localhost/123/index.asp
'//ReWrite on 2006-04-27 with VBScript by cash.//QQ:87256259//Email:tracywy@851102@163.com.
Class ShowPage
Public CurrentPage,Pagesize
Public TotalPage,recordcounti
Public ArrRs,ArriRs,ArriiRs,Ontop,ArrRsErr
Public Css_TableGsbook,Css_TGsbook,Css_div,Css_Onpic
Public Title,Content,Email,Myweb,Ip
Public SearchSql,SearchMode
Public Id
Public Sub SetCurrentPage(sCurrentPage)
If sCurrentPage = Empty Then sCurrentPage=1
If isnumeric(sCurrentPage)=0 Then sCurrentPage=1
CurrentPage = Int(sCurrentPage)
If CurrentPage < 1 Then CurrentPage = 1
Pagesize = 7
End Sub
Public Sub SetCurrentPage_Sys(sCurrentPage)
If sCurrentPage = Empty Then sCurrentPage=1
If isnumeric(sCurrentPage)=0 Then sCurrentPage=1
CurrentPage = Int(sCurrentPage)
If CurrentPage < 1 Then CurrentPage = 1
Pagesize = 20
End Sub
Public Sub SetTotalPage(Recordcounti,Pagesize)
If (Recordcounti mod Pagesize)=0 Then
TotalPage=Recordcounti\Pagesize
Else
TotalPage=Recordcounti\Pagesize+1
End If
End Sub
Public Sub GetPageInfo(CurrentPage,Pagesize)
Set cmd=server.CreateObject("adodb.command")
cmd.ActiveConnection=Conn
cmd.CommandType=4
cmd.CommandText="Gsbook_show_page"
cmd.ParameteRs.AppEnd cmd.CreateParameter("int_pagenow",3,1,0,CurrentPage)
cmd.ParameteRs.AppEnd cmd.CreateParameter("int_Pagesize",3,1,0,Pagesize)
cmd.ParameteRs.AppEnd cmd.CreateParameter("int_recordcount",3,4,0)
Set Rs=cmd.Execute
If Rs.eof Then
ArrRsErr = 1
Else
ArrRs=Rs.getrows
Recordcounti=cmd.ParameteRs("int_recordcount")
End If
Rs.close
Set Rs=Nothing
Set comd=Nothing
End Sub
Public Sub GetReInfo(GsbookId)
Set Rs = Conn.Execute("Execute Gsbook_show_Re "&GsbookId )
If Rs.Eof Then
CallErr("<li>参数错误!")
Else
ArriiRs = Rs.Getrows
End If
Rs.Close
Set Rs = Nothing
End Sub
Public Sub GetOntop()
Set Rs = Conn.execute("Execute Gsbook_show_OnTop")
If Not Rs.eof Then
Ontop = 1
ArriRs=Rs.getrows
End If
Rs.close
Set Rs=Nothing
End Sub
Public Sub GetStyle(i)
ii = (i mod 2)
Select Case ii
Case 0
Css_TableGsbook="TableGsbook1"
Css_TGsbook="TGsbook1"
Css_div="div1"
Css_Onpic="4.gif"
Case Else
Css_TableGsbook="TableGsbook2"
Css_TGsbook="TGsbook2"
Css_div="div2"
Css_Onpic="5.gif"
End Select
End Sub
Public Sub GetGsbookInfo(Open,loginok,sTitle,sContent,sEmail,sMyweb,sIp,sAuthor,Id)
Title = sTitle
Content = sContent
Email = sEmail
Myweb = sMyweb
Author = sAuthor
Ip = sIp
If Open<>True And loginok=0 Then
Title = "悄悄话标题"
Content = "您没有权限查看悄悄话内容。<br>如果你是["&Author&"],请<a href=ShowGsbook.asp?Id="&Id&" target=_blank><u>点此</u></a>输入留言密码查看留言内容!"
Email = "# Title=您没有权限查看["&Author&"]的邮箱地址!"
MyWeb = "# Title=您没有权限查看["&Author&"]的个人主页!"
Ip = "你没有权限查看用户IP"
Else
Select Case Email
Case "空"
Email = "# title=["&Author&"]没有留下邮箱地址"
Case Else
Email = "mailto:"&Email&" title=给["&Author&"]发送邮件"
End Select
Select Case Myweb
Case "空"
MyWeb = "# title=["&Author&"]没有留下主页地址"
Case Else
MyWeb = MyWeb&" title=访问["&Author&"]的个人主页 target=_blank"
End Select
If loginok = 1 Then Ip = Author&"的IP地址为"&Ip Else Ip = "你没有权限查看用户IP"
End If
End Sub
Public Sub GetSearchInfo(sContent,sSearchMode)
Content= Trim(sContent)
SearchMode = sSearchMode
Content = Replace(Content,mid(" "" ",2,1),"")
SearchMode = Replace(SearchMode,mid(" "" ",2,1),"")
Content = Replace(Content,".","")
Content = Replace(Content,"&","")
Content = Replace(Content,"'","")
If Content = Empty Then CallErr("<Li>请输入搜索的关键字")
If Len(Content) > 20 or Len(Content)<2 Then CallErr("<Li>请输入2-20个的关键字!")
Select Case SearchMode
Case "Title"
SearchSql = "Title Like '%"&Content&"%' "
Case "Author"
SearchSql = "Author Like '%"&Content&"%' "
Case Empty
CallErr("<Li>搜索范围参数错误!")
End Select
End Sub
Public Sub GetPageInfo_Search(CurrentPage,Pagesize,SearchSql)
SqlStr="SELECT [Open],Topic,Author,Sex,Email,WebSize,Face,Title,content,Re,Ip,Add_date,EditPass,EmailCall,GsbookId,Id,Ip FROM [GsbookDate] Where "& SearchSql &" And Topic=1 ORDER BY Id desc"
Set Rs = Conn.execute(SqlStr)
If Rs.eof Then
CallErr("<Li>找不到相关留言资料!")
Else
ArrRs=Rs.getrows
End If
Rs.close
Set Rs=Nothing
End Sub
Public Sub CheckGsbookId(sId)
If sId = empty Then CallErr("<li>参数错误!")
If isnumeric(sId) = 0 Then CallErr("<li>参数错误!")
Id = Int(sId)
End Sub
Public Sub ShowGsbookInfo(Id)
Set Rs = Conn.Execute("Execute Gsbook_show_Read "&Id)
If Rs.Eof Then
CallErr("<li>参数错误或数据已被删除!")
Else
ArrRs = Rs.Getrows
End If
Rs.Close
Set Rs = Nothing
End Sub
End Class
</script>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -