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

📄 powereasy.guestbook.asp

📁 个人网站比较简短
💻 ASP
📖 第 1 页 / 共 5 页
字号:

    Set rsGuest = Server.CreateObject("adodb.recordset")
    rsGuest.Open sqlGuest, Conn, 1, 1
    If rsGuest.BOF And rsGuest.EOF Then
        totalPut = 0
        FoundErr = True
        ErrMsg = ErrMsg & "<li>" & XmlText("Guest", "ShowAllGuest/NoFound", "没有任何留言") & "</li>"
        Exit Sub
    Else
        totalPut = rsGuest.RecordCount
        If CurrentPage < 1 Then
            CurrentPage = 1
        End If
        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
            If (CurrentPage - 1) * MaxPerPage < totalPut Then
                rsGuest.Move (CurrentPage - 1) * MaxPerPage
            Else
                CurrentPage = 1
            End If
        End If
    End If
End Sub

'=================================================
'过程名:ShowJS_Guest()
'作  用:提交留言的输入判断
'参  数:无
'=================================================
Private Function ShowJS_Guest()
    Dim strJS
    strJS = "<script language = 'JavaScript'>" & vbCrLf
    strJS = strJS & "function changeimage()" & vbCrLf
    strJS = strJS & "{" & vbCrLf
    strJS = strJS & "  document.myform.GuestImages.value=document.myform.Image.value;" & vbCrLf
    strJS = strJS & "  document.myform.showimages.src='" & GFacePath & "'+document.myform.Image.value+'.gif';" & vbCrLf
    strJS = strJS & "}" & vbCrLf
    strJS = strJS & "function guestpreview()" & vbCrLf
    strJS = strJS & "{" & vbCrLf
    strJS = strJS & "  document.preview.content.value=document.myform.GuestContent.value;" & vbCrLf
    strJS = strJS & "  var popupWin = window.open('GuestPreview.asp', 'GuestPreview', 'scrollbars=yes,width=620,height=230');" & vbCrLf
    strJS = strJS & "  document.preview.submit();" & vbCrLf
    strJS = strJS & "}" & vbCrLf
    strJS = strJS & "function CheckForm()" & vbCrLf
    strJS = strJS & "{" & vbCrLf
    If UserLogined = False Then
        strJS = strJS & "    if(document.myform.GuestName.value==''){" & vbCrLf
        strJS = strJS & "      alert('姓名不能为空!');" & vbCrLf
        strJS = strJS & "      document.myform.GuestName.focus();" & vbCrLf
        strJS = strJS & "      return(false) ;" & vbCrLf
        strJS = strJS & "    }" & vbCrLf
    End If
    strJS = strJS & "  if(document.myform.GuestTitle.value==''){" & vbCrLf
    strJS = strJS & "    alert('主题不能为空!');" & vbCrLf
    strJS = strJS & "    document.myform.GuestTitle.focus();" & vbCrLf
    strJS = strJS & "    return(false);" & vbCrLf
    strJS = strJS & "  }" & vbCrLf
    strJS = strJS & "  if(document.myform.GuestTitle.value.length>30){" & vbCrLf
    strJS = strJS & "    alert('主题不能超过30字符!');" & vbCrLf
    strJS = strJS & "    document.myform.GuestTitle.focus();" & vbCrLf
    strJS = strJS & "    return(false);" & vbCrLf
    strJS = strJS & "  }" & vbCrLf
    strJS = strJS & "   var IframeContent=document.getElementById(""editor"").contentWindow;" & vbCrLf
    strJS = strJS & "   IframeContent.HtmlEdit.focus();" & vbCrLf
    strJS = strJS & "   IframeContent.HtmlEdit.document.execCommand('selectAll');" & vbCrLf
    strJS = strJS & "   IframeContent.HtmlEdit.document.execCommand('copy');" & vbCrLf
    strJS = strJS & "  var CurrentMode=editor.CurrentMode;" & vbCrLf
    strJS = strJS & "  if (CurrentMode==0){" & vbCrLf
    strJS = strJS & "       document.myform.GuestContent.value=editor.HtmlEdit.document.body.innerHTML; " & vbCrLf
    strJS = strJS & "  }" & vbCrLf
    strJS = strJS & "  else if(CurrentMode==1){" & vbCrLf
    strJS = strJS & "       document.myform.GuestContent.value=editor.HtmlEdit.document.body.innerText;" & vbCrLf
    strJS = strJS & "  }" & vbCrLf
    strJS = strJS & "  if(document.myform.GuestContent.value==''){" & vbCrLf
    strJS = strJS & "    alert('内容不能为空!');" & vbCrLf
    strJS = strJS & "    editor.HtmlEdit.focus();" & vbCrLf
    strJS = strJS & "    return(false);" & vbCrLf
    strJS = strJS & "  }" & vbCrLf
    strJS = strJS & "  if(document.myform.GuestContent.value.length>65536){" & vbCrLf
    strJS = strJS & "    alert('内容不能超过64K!');" & vbCrLf
    strJS = strJS & "    editor.HtmlEdit.focus();" & vbCrLf
    strJS = strJS & "    return(false);" & vbCrLf
    strJS = strJS & "  }" & vbCrLf
    If EnableGuestBookCheck = True Then
        strJS = strJS & "  if(document.myform.CheckCode.value==''){" & vbCrLf
        strJS = strJS & "    alert('请输入您的验证码!');" & vbCrLf
        strJS = strJS & "    document.myform.CheckCode.focus();" & vbCrLf
        strJS = strJS & "    return(false);" & vbCrLf
        strJS = strJS & "  }" & vbCrLf
    End If
    strJS = strJS & "}" & vbCrLf
    strJS = strJS & "</script>" & vbCrLf
    ShowJS_Guest = strJS
End Function

'**************************************************
'函数名:KeywordReplace
'作  用:标示搜索关键字
'参  数:strChar-----要转换的字符
'返回值:转换后的字符
'**************************************************
Private Function KeywordReplace(strChar)
    If strChar = "" Then
        KeywordReplace = ""
    Else
        KeywordReplace = PE_Replace(strChar, "" & Keyword & "", "<font class=Channel_font>" & Keyword & "</font>")
    End If
    If IsNull(KeywordReplace) Then KeywordReplace = ""
End Function


'=================================================
'函数名:Guest_info()
'作  用:留言操作信息
'参  数:info 提示信息内容
'=================================================
Private Function Guest_info(info)
    Dim strInfo
    'strInfo = Replace(Replace(XmlText("Guest", "Guest_info", "<table cellpadding=0 cellspacing=0 border=0 width=100% align=center><tr align='center'><td class='Guest_title_760'>留言操作反馈信息</td></tr><tr><td class='main_tdbg_575'><table cellpadding=5 cellspacing=0 border=0 width=100% align=center><tr><td height='100' valign='top'>{$info}</td></tr><tr align='center' class='tdbg'><td><a href='{$FileName}'>【查看留言】</a><a href='Guest_Write.asp'>【签写留言】</a></td></tr></table></td></tr></table><br>"), "{$info}", info), "{$FileName}", FileName)
    strInfo = Replace(Replace(XmlText("Guest", "Guest_info", "<table cellpadding=0 cellspacing=0 border=0 width=100% align=center><tr align='center'><td class='Guest_title_760'>留言操作反馈信息</td></tr><tr><td class='main_tdbg_575'><table cellpadding=5 cellspacing=0 border=0 width=100% align=center><tr><td height='100' valign='top'>{$info}</td></tr><tr align='center' class='tdbg'><td><a href='{$FileName}'>【查看留言】</a><a href='javascript:history.go(-1)'>【签写留言】</a></td></tr></table></td></tr></table><br>"), "{$info}", info), "{$FileName}", FileName)
    Guest_info = strInfo
End Function

'=================================================
'过程名:GetGKind_Option()
'作  用:下拉框留言类别
'参  数:ShowType 显示类型
'        KindID   类别
'=================================================
Private Function GetGKind_Option(ShowType, KindID)
    Dim sqlGKind, rsGKind, strOption
    If ShowType = 3 Then
        strOption = ""
    Else
        strOption = "<option value='0'"
        If KindID = 0 Then
            strOption = strOption & " selected"
        End If
        strOption = strOption & ">不指定类别</option>"
    End If
    sqlGKind = "select * from PE_Guestkind order by OrderID"
    Set rsGKind = Conn.Execute(sqlGKind)
    Do While Not rsGKind.EOF
        If rsGKind("KindID") = KindID Then
            strOption = strOption & "<option value='" & rsGKind("KindID") & "' selected>" & rsGKind("KindName") & "</option>"
        Else
            strOption = strOption & "<option value='" & rsGKind("KindID") & "'>" & rsGKind("KindName") & "</option>"
        End If
        rsGKind.MoveNext
    Loop
    rsGKind.Close
    Set rsGKind = Nothing
    GetGKind_Option = strOption
End Function
'=================================================
'过程名:GetGKindList()
'作  用:横向显示留言类别
'参  数:无
'=================================================
Private Function GetGKindList()
    Dim rsGKind, sqlGKind, strGKind, i
    sqlGKind = "select * from PE_Guestkind order by OrderID"
    Set rsGKind = Conn.Execute(sqlGKind)
    If rsGKind.BOF And rsGKind.EOF Then
        strGKind = "| " & XmlText("Guest", "KindList/Nofound", "没有任何类别")
    Else
        i = 1
        strGKind = "| "
        Do While Not rsGKind.EOF
            strGKind = strGKind & "<a href='index.asp?KindID=" & rsGKind("KindID") & "'>" & rsGKind("KindName") & "</a>"
            strGKind = strGKind & " | "
            i = i + 1
            If i Mod 10 = 0 Then
                strGKind = strGKind & "<br>"
            End If
            rsGKind.MoveNext
        Loop
    End If
    rsGKind.Close
    Set rsGKind = Nothing
    'If GuestBook_IsAssignSort = False Then
        'strGKind = strGKind & "<a href='index.asp?KindID=0'>" & XmlText("xxxxx", "xxxxxx", "不属任何类别") & "</a> |"
    'End If
    GetGKindList = strGKind
End Function

'=================================================
'函数名:ShowGueststyle()
'作  用:获取查看方式
'参  数:无
'=================================================
Private Function GuestStyle()
    ShowGStyle = Request.Cookies("ShowGStyle")
    If ShowGStyle = "" Or Not IsNumeric(ShowGStyle) Then
        ShowGStyle = 2
    Else
        ShowGStyle = Int(ShowGStyle)
    End If
    GuestStyle = ShowGStyle
End Function
'=================================================
'函数名:ShowGueststyle()
'作  用:显示切换方式
'参  数:无
'=================================================
Private Function ShowGueststyle()
    Dim Shtm
    If ShowGStyle = 1 Then
        Shtm = "<a class=Guest href=ShowGuestStyle.asp?ShowGStyle=2>" & XmlText("Guest", "ShowGueststyle/Mode1", "切换到留言本方式") & "</a>"
    Else
        Shtm = "<a class=Guest href=ShowGuestStyle.asp?ShowGStyle=1>" & XmlText("Guest", "ShowGueststyle/Mode2", "切换到讨论区方式") & "</a>"
    End If
    ShowGueststyle = Shtm
End Function
'=================================================
'函数名:TransformTime()
'作  用:格式化时间
'参  数:时间
'=================================================
Private Function TransformTime(GuestDatetime)
    If Not IsDate(GuestDatetime) Then Exit Function
    Dim thour, tminute, tday, nowday, dnt, dayshow, pshow
    thour = Hour(GuestDatetime)
    tminute = Minute(GuestDatetime)
    tday = DateValue(GuestDatetime)
    nowday = DateValue(Now)
    If thour < 10 Then
        thour = "0" & thour
    End If
    If tminute < 10 Then
        tminute = "0" & tminute
    End If
    dnt = DateDiff("d", tday, nowday)
    If dnt > 2 Then
       dayshow = Year(GuestDatetime)
       If (Month(GuestDatetime) < 10) Then
           dayshow = dayshow & "-0" & Month(GuestDatetime)
       Else
           dayshow = dayshow & "-" & Month(GuestDatetime)
       End If
       If (Day(GuestDatetime) < 10) Then
           dayshow = dayshow & "-0" & Day(GuestDatetime)
       Else
           dayshow = dayshow & "-" & Day(GuestDatetime)
       End If

⌨️ 快捷键说明

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