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

📄 user_favorite.asp

📁 SK信息采集2.0功能介绍: 1.可针对任何静态网页,动态网页进行采集。包括htm,html,shtml,ASP,ASPX,JSP,PHP等。 2.增加自定文件采集.用户可采集网页中的所有文件.
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%option explicit%>
<!--#include file="../Conn.asp"-->
<!--#include file="../SysCls/KS_UserCommonCls.asp"-->
<%
'===================================================================================================================
'软件名称:科汛网站管理系统
'当前版本:科汛网站管理系统 V2.2 SP2 Free
'Copyright (C) 2005-2006 Kesion.Com  All rights reserved.
'产品咨询QQ:9537636,41904294
'技术支持QQ:111394,54004407 
'程序版权:科汛网络
'程序开发:科汛网络开发组(总策划:林文仲)
'E-Mail  :kesioncms@hotmail.com webmaster@kesion.com
'官方网站:http://www.kesion.com  
'演示站点:http://test.kesion.com 
'郑重声明:
'    ①、免费版本请在程序首页保留版权信息,并做上本站LOGO友情连接,商业版本无此要求;
'    ②、任何个人或组织不得在授权允许的情况下删除、修改、拷贝本软件及其他副本上一切关于版权的信息;
'    ③、科汛网络保留此软件的法律追究权利
'===================================================================================================================
Dim KSCls
Set KSCls = New Admin_Index
KSCls.Execute()
Set KSCls = Nothing

Class Admin_Index
        Private KSCMS,KSUser
		Private CurrentPage,totalPut
		Private RS,MaxPerPage
		Private ChannelID
		Private TempStr,SqlStr
		Private InfoIDArr,InfoID
		Private Sub Class_Initialize()
			MaxPerPage =20
		  Set KSCMS=New CommonCls
		  Set KSUser = New UserCls
		End Sub
        Private Sub Class_Terminate()
		 Set KSCMS=Nothing
		 Set KSUser=Nothing
		End Sub
		Public Sub Execute()
		
		IF Cbool(KSUser.UserLoginChecked)=false Then
		  Response.Write "<script>location.href='Login.asp';</script>"
		  Exit Sub
		End If
		
		ChannelID=KSCMS.G("ChannelID")
		KSUser.LoadHead()
		%>

		<TABLE height="380" cellSpacing=0 width=770 align=center border=0>
		<TR>
		<TD vAlign=top bgColor=#FFFFFF>
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td height="32">&nbsp;当前位置 >> <a href="<%=KSCMS.GetConfig("WebUrl")%>"><%=KSCMS.GetConfig("WebName")%></a> >> <a href="index.asp">会员中心</a> &gt;&gt; 会员收藏夹 </td>
          </tr>
          <tr>
            <td>
			<%
			KSUser.LoadMenu()
			%>
			</td>
          </tr>
        </table>
		
		  <table width="770" height="460" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
              <td valign="top">
				<%
				'Call KSUser.ArticleMenu
				Select Case KSCMS.G("Action")
				 Case "Add"
				   Dim RSAdd
				   InfoID=KSCMS.G("InfoID")
				   Set RSAdd=Server.CreateObject("Adodb.Recordset")
				   RSADD.Open "Select * From KS_Favorite Where ChannelID=" & ChannelID & " And InfoID='" & InfoID & "' And UserName='" & KSUser.Get_UserName & "'",Conn,1,3
				   IF RSADD.Eof And RSADD.Bof Then
				      RSADD.AddNew
					    RSAdd(1)=KSUser.Get_UserName
						RSAdd(2)=ChannelID
						RSAdd(3)=InfoID
						RSAdd(4)=Now
					  RSAdd.Update
				   End IF
				   RSADD.Close
				   SET RSADD=Nothing
				 Case "Cancel"
				  InfoID=KSCMS.G("InfoID")
				  InfoID="'" & Replace(Replace(InfoID,",","','")," ","") & "'"
				
				  Conn.Execute("Delete From KS_Favorite Where InfoID In(" & InfoID & ") And ChannelID=" & ChannelID & " And UserName='" & KSUser.Get_UserName & "'")
				End Select
			  %>
			   <SCRIPT language=javascript>
				function unselectall()
				{
					if(document.myform.chkAll.checked)
					{
				 document.myform.chkAll.checked = document.myform.chkAll.checked&0;
					}
				}
				function CheckAll(form)
				{
				  for (var i=0;i<form.elements.length;i++)
				  {
					var e = form.elements[i];
					if (e.Name != 'chkAll'&&e.disabled==false)
					   e.checked = form.chkAll.checked;
					}
				  }
               </SCRIPT>
			   <SCRIPT language=javascript src="../inc/showtitle.js"></script>
			   <%
			   		       If KSCMS.G("page") <> "" Then
						          CurrentPage = CInt(KSCMS.G("page"))
							Else
								  CurrentPage = 1
							End If
                                    
									Dim Param:Param=" Where UserName='"& KSUser.Get_UserName &"'"
                                    
									If ChannelID="" or not isnumeric(ChannelID) Then ChannelID=0
                                    IF ChannelID<>0 Then 
									   Param= Param & " and ChannelID=" & ChannelID
									End If
									Dim Sql:sql = "select * from KS_Favorite "& Param &" order by AddDate DESC"

			   %>
				<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
                  <tr>
                    <td height="42">
					   <table width="100%"  border="0" cellspacing="0" cellpadding="0">
                              <tr>
                                <td width="50" align="center"><img src="Images/Favorite.gif" width="27" height="28" /></td>
                                <td><span class="font3">
								我收藏的<%
								  Select Case ChannelID
								   Case 1
								    TempStr="文章"
								   Case 2
								    TempStr="图片"
								   Case 3
                                     TempStr="软件"
                                   Case 4
								     TempStr="动漫"
								   End Select
								   Response.Write TempStr%></span></td>
                              </tr>
                      </table>
					</td>
                  </tr>
                
                    <tr>
                      <td>
						 <table width="100%"  border="0" cellpadding="0" cellspacing="0">
                                      <tr>
                                        <td height="3" bgcolor="98984B"></td>
                                      </tr>
                                      <tr>
                                        <td height="22"><table width="100%" height="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="dfdfdf" bgcolor="F6F6F6">
                                          <tr>
                                            <td><table width="100%" height="22"  border="0" cellpadding="0" cellspacing="0">
                                                <tr>
                                                  <td width="5%" height="22" align="center" class="font6">选中</td>
                                                  <td width="51%" height="22" align="center" class="font6"><%=TempStr%>
												  <%if channelid=1 then
												      Response.Write "标题"
												    else
													  Response.Write "名称"
													end if
													%></td>
												  <td width="12%" height="22" align="center" class="font6"><%=TempStr%>录入</td>
                                                  <td width="15%" height="22" align="center" class="font6">更新时间</td>
                                                  <td width="17%" height="22" align="center" class="font6">管理操作</td>
                                                </tr>
                                            </table></td>
                                          </tr>
                                        </table></td>
                                      </tr>
                        </table></td>
                  </tr>
                   <tr>
                        <td  valign="top">
								  <table width="100%" border="0" cellspacing="0" cellpadding="0">
								  
								  <%
						InfoIDArr=GetInfoIDArr(ChannelID)
						  Set RS=Server.CreateObject("AdodB.Recordset")
						Select Case ChannelID
						   Case 1
								SqlStr="Select NewsID,Title,Author,AddDate,Tid,Fname From KS_Article Where NewsID In (" & InfoIDArr &")"
						   Case 2
						     SqlStr="Select PicID,Title,Author,AddDate,Tid,Fname,PhotoUrl From KS_Photo Where PicID In (" & InfoIDArr &")"
						   Case 3
						     SqlStr="Select DownID,Title,Author,AddDate,Tid,Fname From KS_DownLoad Where DownID In (" & InfoIDArr &")"
						   Case 4
						     SqlStr="Select FlashID,Title,Author,AddDate,Tid,Fname,PhotoUrl From KS_Flash Where FlashID In (" & InfoIDArr &")"
						   Case else
						     SqlStr="Select NewsID From KS_Article Where 1=0"
						  End Select
						
						
						 RS.open SqlStr,conn,1,1

						 If RS.EOF And RS.BOF Then
								  Response.Write "<tr><td height=180 valign=top>没有收藏任何" & TempStr &"!</td></tr>"
								 Else
									totalPut = RS.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
									Call ShowContent
								Else
									If (CurrentPage - 1) * MaxPerPage < totalPut Then
										RS.Move (CurrentPage - 1) * MaxPerPage
										Call ShowContent
									Else
										CurrentPage = 1
										Call ShowContent
									End If
								End If
				End If

						
						 %>
					 </table>
			  </td>
			  
            </tr>
          </table>
		  </td>
		  </tr>
		  </table>
		  </TD>
		 </TR>
	</TABLE> 
		  <%
       KSUser.LoadFoot()
  End Sub
    
  Sub ShowContent()
     Dim I,ArticlePath
    Response.Write "<FORM Action=""User_Favorite.asp?Action=Cancel&ChannelID=" & ChannelID& "&Page=" & CurrentPage & """ name=""myform"" method=""post"">"
   Do While Not RS.Eof
        ArticlePath=KSCMS.GetFolderPath(RS(4), False) & RS(5)
		%>
            <tr>
                   <td>
					 <table width="100%" height="25"  border="0" cellpadding="0" cellspacing="0" align="center">
                                          <tr onmouseover="this.style.background='#F5f5f5'" onmouseout="this.style.background='#FFFFFF'">
                                            <td width="5%" height="22" align="center" class="font6">
											<INPUT id="InfoID" onclick="unselectall()" type="checkbox" value="<%=RS(0)%>"  name="InfoID">									</td>
                                            <td width="51%" height="22" align="left">
											<%if ChannelID=2 OR ChannelID=4 Then
											  Dim PicStr
											 if RS(6)="" Or IsNull(RS(6)) Then
											   PicStr="../Skin/Default/nopic.gif"
											 else 
											    PicStr=RS(6)
											 end if
											%>
                                              <a href="<%=ArticlePath%>" target="_blank" class="link3" title="<table width=80 border=0 align=center><tr><td><img src='<%=PicStr%>' border=0 width='130' height='80'></td></tr></table>">
											<%
											Else
											%>
											  <a href="<%=ArticlePath%>" target="_blank" class="link3">                        
											 <%End IF%>
											<%=KSCMS.GotTopic(trim(RS("title")),35)%></a>
											</td>
											<td width="12%" height="22" align="center" class="font6">
											<%if rs(2)="" THEN 
											   Response.Write "佚名"
											  else
											    Response.Write rs(2)
											  end if%>
											 </td>
                                            <td width="15%" height="22" align="center" class="font6"><%=rs(3)%></td>
                                            <td height="22" align="center">
											<a href="User_Favorite.asp?Action=Cancel&ChannelID=<%=ChannelID%>&Page=<%=CurrentPage%>&InfoID=<%=rs(0)%>" onclick = "return (confirm('确定取消该<%=TempStr%>的收藏吗?'))" class="link3">取消收藏</a>
											</td>
                                          </tr>
                     </table>
					 </td>
            </tr>
             <tr>
                <td background="images/bg.gif"></td>
            </tr>
                                      <%
							RS.MoveNext
							I = I + 1
					  If I >= MaxPerPage Then Exit Do
				    Loop
%>
								<tr>
								  <td valign=top>
								<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
                    <TBODY>
                    <TR>
                      <TD width=200 height=30>&nbsp;<INPUT id="chkAll" onclick="CheckAll(this.form)" type="checkbox" value="checkbox"  name="chkAll">&nbsp;选中本页显示的所有<%=TempStr%></TD>
                      <TD><INPUT onClick="return(confirm('确定取消选定<%=TempStr%>的收藏吗?'));" type=submit value=取消选定<%=TempStr%>的收藏 name=submit1>
					
                </TD></TR></TBODY></TABLE>
				
								  </td>
								  </FORM>
								</tr>
								<% IF totalPut>MaxPerPage Then%>
                                <tr>
                                  <td height="30" background="images/MenuBottomBg.gif">
								  <table width="100%" border="0" cellpadding="0" cellspacing="0">
                                      <tr>
                                        <td align="right">
										<%
							Call  KSCMS.ShowPageParamter(totalPut, MaxPerPage, "User_Favorite.asp", True, "篇" & TempStr, CurrentPage, "ChannelID=" & ChannelID)
							  
										%>
                                        </td>
                                      </tr>
                                  </table>
							      </td>
                                </tr>
								<%End IF
  End Sub
  
  Function GetInfoIDArr(ChannelID)
     Dim RSObj,I
	 Set RSObj=Conn.Execute("Select InfoID From KS_Favorite Where UserName='" & KSUser.Get_UserName & "' And ChannelID=" & ChannelID)
	 IF RSObj.Eof And RSObj.Bof Then
	  GetInfoIDArr="'0'"
	 Else
		 I=0
		 Do While Not RSObj.Eof
		   IF I=0 Then
			 GetInfoIDArr="'" & RSObj(0) & "'"
		   Else
			 GetInfoIDArr= GetInfoIDArr & ",'" & RSObj(0) &"'"
		   End IF
		   I=I+1 
		   RSObj.MoveNext
		 Loop
	End IF
	 RSObj.Close:Set RSObj=Nothing
  End Function
End Class
%>

⌨️ 快捷键说明

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