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

📄 classfriendsite.asp

📁 依蓝旅游网站管理系统Elan2008.SP2
💻 ASP
字号:
<%
Class ClassFriendSite

   Private HTML, CommonRegExp

   Private Sub Class_Initialize
      Set CommonRegExp = New RegExp
	  CommonRegExp.IgnoreCase = True 
      CommonRegExp.Global = True
   End Sub
   
   Private Sub Class_Terminate
      Set CommonRegExp = Nothing
   End Sub 
   
   Private Function CommonLabels(ByVal HTML)
	  Dim TempHTML
	  
	  TempHTML = EL_Common.RegExpStaticLabel(HTML, "{$MetaKeywords}", "<meta name=""keywords"" content="""& MetaKeywords &""" />")
	  TempHTML = EL_Common.RegExpStaticLabel(TempHTML, "{$MetaDescription}", "<meta name=""description"" content="""& MetaDescription &""" />")
	  CommonLabels = TempHTML
   End Function
   
   Public Sub Execute()
      HTML = EL_Common.Template(0, 10, 0)
	  HTML = EL_Common.ReplaceCommonLabels(HTML)
	  
	  HTML = EL_Common.RegExpStaticLabel(HTML, "{$DefaultSkin}", EL_Common.Skin(0, 0, 0))
	  HTML = CommonLabels(HTML)
	  HTML = EL_Common.RegExpStaticLabel(HTML, "{$ShowFriendSite_Logo}", ShowFriendSiteLogo())
	  HTML = EL_Common.RegExpStaticLabel(HTML, "{$ShowFriendSite_Text}", ShowFriendSiteText())
	  Response.Write HTML
   End Sub
   
   Public Sub FriendSiteReg()
      HTML = EL_Common.Template(0, 35, 0)
	  HTML = EL_Common.ReplaceCommonLabels(HTML)
	  
	  HTML = EL_Common.RegExpStaticLabel(HTML, "{$DefaultSkin}", EL_Common.Skin(0, 0, 0))
	  HTML = CommonLabels(HTML)
	  
	  HTML = EL_Common.RegExpStaticLabel(HTML, "{$ShowFriendSite_Logo}", ShowFriendSiteLogo())
	  HTML = EL_Common.RegExpStaticLabel(HTML, "{$ShowFriendSite_Text}", ShowFriendSiteText())
	  
	  Response.Write HTML
   End Sub
   
   Public Sub SaveReg()   
      If Action = "Succ" Then
	     EL_Common.ShowSuccessMsg(EL_Common.Lang("FriendSite.RegSuccess", "恭喜,您的链接已成功提交,请等待管理员审核"))
		 Exit Sub
	  End If
	  
	  If CheckComeURL = False Then
	     EL_Common.ShowErrorMsg(EL_Common.Lang("BaseConfig.ComeURLError", "禁止从本站外部提交数据"))
		 Exit Sub
	  End If
	  
	  Dim SiteCmd
	  Dim SiteName, SiteURL, SiteLogo, WebmasterName, WebmasterEmail, Password, Password2, Content, RegDateTime 
	  
	  SiteName = EL_Common.ELRequest("SiteName", 1)
	  SiteURL = EL_Common.ELRequest("SiteURL", 1)
	  SiteLogo = EL_Common.ELRequest("SiteLogo", 1)
	  WebmasterName = EL_Common.ELRequest("WebmasterName", 1)
	  WebmasterEmail = EL_Common.ELRequest("WebmasterEmail", 1)
	  Password = EL_Common.ELRequest("Password", 1)
	  Password2 = EL_Common.ELRequest("PasswordConfirm", 1)
	  Content = EL_Common.ELRequest("Content", 1)
	  RegDateTime = EL_Common.ELRequest("RegDateTime", 1)
	  
	  If Trim(Password) = "" Then
         EL_Common.ShowErrorMsg(EL_Common.Lang("FriendSite.Error1", "请输入管理密码"))
	     Exit Sub
      End If
  
      If Password <> Password2 Then
         EL_Common.ShowErrorMsg(EL_Common.Lang("FriendSite.Error2", "您两次输入的密码不一致"))
	     Exit Sub
      End If
	  
	  If lCase(SiteLogo) = "http://" Then SiteLogo = ""
	  Password = MD5(Password, 32)
	  
	  Call EL_Common.InitCommand(SiteCmd, "EL_SP_FriendSite")
	  With SiteCmd
        .Parameters.Append .CreateParameter("RETUEN", 2, 4)
	    .Parameters.Append .CreateParameter("@UpdateType", 3, 1, 4, 0)
		.Parameters.Append .CreateParameter("@SiteID", 3, 2, 4) 
        .Parameters.Append .CreateParameter("@SiteName", 200, 1, 255, SiteName)
        .Parameters.Append .CreateParameter("@SiteURL", 200, 1, 255, SiteURL)
        .Parameters.Append .CreateParameter("@SiteLogo", 200, 1, 255, SiteLogo)
        .Parameters.Append .CreateParameter("@WebmasterName", 200, 1, 50, WebmasterName)
        .Parameters.Append .CreateParameter("@WebmasterEmail", 200, 1, 100, WebmasterEmail)
        .Parameters.Append .CreateParameter("@Password", 200, 1, 32, Password)
        .Parameters.Append .CreateParameter("@Content", 200, 1, 500, Content)
        .Parameters.Append .CreateParameter("@Commended", 11, 1, 1, 0)
        .Parameters.Append .CreateParameter("@Passed", 11, 1, 1, 0)
        .Parameters.Append .CreateParameter("@RegDateTime", 135, 1, 8, Now())
        .Execute()
      End With
	  Set SiteCmd = Nothing
	  EL_Common.ShowScriptError()
	  
	  Response.Redirect "SaveReg.asp?Action=Succ"
   End Sub
   
   Private Function ShowFriendSiteLogo()
      Dim SiteCmd, rsSite, i, RowCount, ReturnString
	  
	  Call EL_Common.InitCommonCmd(SiteCmd, rsSite, "EL_FriendSite", "*", "RTRIM(LTRIM(SiteLogo))<>''")
	  rsSite.Close()
	  RowCount = SiteCmd(0)
	  If RowCount = 0 Then
	     Set rsSite = Nothing
		 Set SiteCmd = Nothing
		 Exit Function
	  End If
	  
	  Dim LogoWidth, LogoHeight, Title_SiteName, Title_SiteURL, Title_Content
	  LogoWidth = EL_Common.Lang("FriendSite.LogoWidth", 88)
	  LogoHeight = EL_Common.Lang("FriendSite.LogoHeight", 31)
	  Title_SiteName = EL_Common.Lang("FriendSite.t1", "网站名称")
	  Title_SiteURL = EL_Common.Lang("FriendSite.t2", "网站地址")
	  Title_Content = EL_Common.Lang("FriendSite.t3", "网站简介")
	  
	  rsSite.Open()
	  ReturnString = ""
	  For i = 1 To RowCount
	     ReturnString = ReturnString &"<a href='"& rsSite("SiteURL") &"' target='_blank' title='"& Title_SiteName & EL_Common.ServerHTMLEncode(rsSite("SiteName")) &"&#13;"& Title_SiteURL & EL_Common.ServerHTMLEncode(rsSite("SiteURL")) &"&#13;"& Title_Content & EL_Common.ServerHTMLEncode(rsSite("Content")) &"'><img src='"& rsSite("SiteLogo") &"' border='0' width='"& LogoWidth &"' height='"& LogoHeight &"' style='margin:5px;'></a> "
		 If i<RowCount Then rsSite.MoveNext
	  Next
	  rsSite.Close()
	  Set rsSite = Nothing
	  Set SiteCmd = Nothing	  
	  ShowFriendSiteLogo = ReturnString
   End Function
   
   Private Function ShowFriendSiteText()
      Dim SiteCmd, rsSite, i, RowCount, ReturnString
	  
	  Call EL_Common.InitCommonCmd(SiteCmd, rsSite, "EL_FriendSite", "*", "RTRIM(LTRIM(SiteLogo))=''")
	  rsSite.Close()
	  RowCount = SiteCmd(0)
	  If RowCount = 0 Then
	     Set rsSite = Nothing
		 Set SiteCmd = Nothing
		 Exit Function
	  End If
	  
	  Dim LogoWidth, LogoHeight, Title_SiteName, Title_SiteURL, Title_Content
	  LogoWidth = EL_Common.Lang("FriendSite.LogoWidth", 88)
	  LogoHeight = EL_Common.Lang("FriendSite.LogoHeight", 31)
	  Title_SiteName = EL_Common.Lang("FriendSite.t1", "网站名称")
	  Title_SiteURL = EL_Common.Lang("FriendSite.t2", "网站地址")
	  Title_Content = EL_Common.Lang("FriendSite.t3", "网站简介")
	  
	  rsSite.Open()
	  ReturnString = ""
	  For i = 1 To RowCount
	     ReturnString = ReturnString &"<a href='"& rsSite("SiteURL") &"' target='_blank' title='"& Title_SiteName & EL_Common.ServerHTMLEncode(rsSite("SiteName")) &"&#13;"& Title_SiteURL & EL_Common.ServerHTMLEncode(rsSite("SiteURL")) &"&#13;"& Title_Content & EL_Common.ServerHTMLEncode(rsSite("Content")) &"'><span style='margin:5px;'>"& EL_Common.ServerHTMLEncode(rsSite("SiteName")) &"</span></a>"
		 If i<RowCount Then rsSite.MoveNext
	  Next
	  rsSite.Close()
	  Set rsSite = Nothing
	  Set SiteCmd = Nothing	  
	  ShowFriendSiteText = ReturnString
   End Function
   
   Private Function CheckComeURL()
      CheckComeURL = False
      If ComeURL = "" Then Exit Function
	  Dim Current_URL
	  Current_URL = "http://" & Trim(Request.ServerVariables("HTTP_HOST"))
	  Current_URL = Current_URL & Trim(Request.ServerVariables("SCRIPT_NAME"))
	  CheckComeURL = EL_Common.CheckComefrom(ComeURL, Current_URL)
   End Function
   
End Class
%>

⌨️ 快捷键说明

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