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

📄 user_collectionsave.asp

📁 网人分类信息5.0商业版。非常优秀的分类信息系统。比较少见。
💻 ASP
字号:
<!--#include file="Cook.asp" -->
<%
If Int(UserFlag(11)) < 1 Then Call WRMPS.ErrView("·您没有权限使用此功能", 0)
Dim eType,CollectionSort,Title,Url,i,S,eSort

ID = WRMPS.CheckStr(Request("ID"), 0)
eType = WRMPS.CheckStr(Request("Type"), 1)
Title = WRMPS.CheckStr(Request("Tit"), 0)
Url = WRMPS.CheckStr(Request("Url"), 0)
If Title = "" Then URl = ""
      Call DBConnBegin()
	  If Request("Action") = "Save" Then
         eSort = WRMPS.CheckStr(Request("Sort"), 0)
		 If eSort = "" Then eSort = NUll
		 If Title <> "" and Url <> "" Then
	       Set Rs = Conn.Execute("Select Count(0) as WM_ID From WM_Collection where WM_User='"&MemName&"'")
		   If Int(UserFlag(12)) > 0 and Rs(0) >= Int(UserFlag(12)) Then Call WRMPS.ErrView("·您的收藏容量已达上限!<meta http-equiv=refresh content='1;URL=User_Collection.asp'>",0)
		   Rs.Close
		   Conn.Execute("insert into WM_Collection(WM_User,WM_Title,WM_Url,WM_Sort)values('"&MemName&"','"&Title&"', '"&Url&"', '"&eSort&"')")
           Select Case eType
             Case 1
               Conn.Execute("Update WM_Article Set WM_Collection = WM_Collection + 1 Where WM_ID="&ID)
             Case 2
               Conn.Execute("Update WM_ClassAD Set WM_Collection = WM_Collection + 1 Where WM_ID="&ID)
             Case 3
               Conn.Execute("Update WM_Company Set WM_Collection = WM_Collection + 1 Where WM_ID="&ID)
             Case 4
               Conn.Execute("Update WM_Coupon Set WM_Collection = WM_Collection + 1 Where WM_ID="&ID)
           End Select
		 Else
		   Call WRMPS.ErrView("·收藏标题或URL不能为空<meta http-equiv=refresh content='1;URL=User_Collection.asp'>",0)
		 End If
	     Call WRMPS.ErrView("·收藏成功<meta http-equiv=refresh content='1;URL=User_Collection.asp?Type="&eSort&"'>",1)
	  End If
	  
      Set Rs = Server.CreateObject("ADODB.RecordSet")
      SQL = "Select WM_CollectionSort From WM_Member Where WM_ID = "&MemID
      Rs.Open SQL ,Conn,1,1
      If Not Rs.Eof Then
	     CollectionSort = Rs(0)
      End If
      Rs.Close
	  
      '1文章 2信息 3店铺
      Select Case eType
        Case 1
          S = "文章收藏"
		  SQL = "Select WM_ID,WM_Title,WM_AddTime,WM_ChannelID,WM_ChannelDir,WM_ClassDir From WM_Article Where WM_ID="&ID&" and WM_IsDeleted=0 and WM_Passed=1"
        Case 2
          S = "信息收藏"
		  SQL = "Select WM_ID,WM_Title,WM_PostTime,WM_ChannelID,WM_ChannelDir,WM_ClassDir From WM_ClassAD Where WM_ID="&ID&" and WM_Key=1"
		Case 3
          S = "店铺收藏"
		  SQL = "Select WM_ID,WM_Company From WM_Company Where WM_ID="&ID&" and WM_Key>0"
		Case 4
          S = "优惠券收藏"
		  SQL = "Select WM_ID,WM_Title,WM_Time,WM_ChannelID,WM_ChannelDir,WM_ClassDir From WM_Coupon Where WM_ID="&ID&" and WM_Key=1"
	  End Select
	  If SQL <> "" Then
	    Rs.Open SQL,Conn,1,1
		If Not Rs.Eof Then
          UrlPath = WR_Setting(4)
          Select Case eType
	        Case 1
		      Url = WRMPS.GetShowUrl(1,1,0,Rs(0),Rs(2),Rs(4)&Rs(5),Rs(3))
			  Title = Rs(1)
	        Case 2
		      Url = WRMPS.GetShowUrl(1,1,0,Rs(0),Rs(2),Rs(4)&Rs(5),Rs(3))
			  Title = Rs(1)
	        Case 3
		      Url = WRMPS.GetCompanyUrl(Rs(0))
		      Title = Rs(1)
	        Case 4
		      Url = WRMPS.GetShowUrl(1,1,0,Rs(0),Rs(2),Rs(4)&Rs(5),Rs(3))
			  Title = Rs(1)
	        End Select
		End If
		Rs.Close
	  End If
      Set Rs = Nothing
 
      Content = Content & PageTop()
      Content = Content & UserPath(",<a href=User_Collection.asp>收藏管理</a>")

	  Content = Content & "<table width='100%' cellpadding=0 cellspacing=1 class=td1>" & vbCrLf
      Content = Content & "<tr><td colspan=2 class=td4><strong>添加收藏</strong></td></tr>" & vbCrLf
      Content = Content & "<form action='?Action=Save&ID="&ID&"&Type="&eType&"' name=myform method=POST>" & vbCrLf
	  Content = Content & "<tr>" & vbCrLf
      Content = Content & "<td width='20%' class=td2>所属分类</td>" & vbCrLf
      Content = Content & "<td class=td2 width='80%'><select name=Sort>"
	  Content = Content & "<option value=''></option>"
	  Content = Content & "<option value='文章收藏'"&WRMPS.GetCheckVer("文章收藏",S,0)&">文章收藏</option>"
	  Content = Content & "<option value='信息收藏'"&WRMPS.GetCheckVer("信息收藏",S,0)&">信息收藏</option>"
	  Content = Content & "<option value='店铺收藏'"&WRMPS.GetCheckVer("店铺收藏",S,0)&">店铺收藏</option>"
	  Content = Content & "<option value='优惠券收藏'"&WRMPS.GetCheckVer("优惠券收藏",S,0)&">优惠券收藏</option>"
      If CollectionSort <> "" and IsNull(CollectionSort) = False Then
	    For i=0 To UBound(Split(CollectionSort,","))
	      Content = Content & "<option value='"&Split(CollectionSort,",")(i)&"'>"&Split(CollectionSort,",")(i)&"</option>"
	    Next
	  End If
	  Content = Content & "</select></td>" & vbCrLf
      Content = Content & "</tr>" & vbCrLf
	  Content = Content & "<tr>" & vbCrLf
      Content = Content & "<td class=td2>收藏名称</td>" & vbCrLf
      Content = Content & "<td class=td2><input type=text name=Tit size=50 maxlength=50 value="""&Title&"""></td>" & vbCrLf
      Content = Content & "</tr>" & vbCrLf
	  Content = Content & "<tr>" & vbCrLf
      Content = Content & "<td class=td2>URL</td>" & vbCrLf
      Content = Content & "<td class=td2><input type=text name=Url size=50 maxlength=100 value="""&Url&"""></td>" & vbCrLf
      Content = Content & "</tr>" & vbCrLf
	  Content = Content & "<tr>" & vbCrLf
      Content = Content & "<td class=td2></td>" & vbCrLf
      Content = Content & "<td class=td2><input type='submit' name='submit' value='确认收藏'></td>" & vbCrLf
      Content = Content & "</tr>" & vbCrLf
      Content = Content & "</form>" & vbCrLf
      Content = Content & "</Table>" & vbCrLf
	  
	  Content = Content & PageButtom()

Call DBConnEnd()
Call ClassEnd()
Response.write Content

%>

⌨️ 快捷键说明

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