<%
 
   
	Function skweboa_lsit(ClassID,ArticleSort,PageStyle,PageNumber,TitleLen,ContentLen,skwebIF,DiyContent,ModeID,Before,After,project,SubClass,DateForm) 

		 Dim Parameter,SqlStr,skwebSQL,skweb_IF
		 If Application(SkcmsCookies & "SK_Data_classification") <> "Folder" Then skweboa_lsit=SKCONN14:Exit Function 
			Select Case ClassID 
			    Case "","0":Parameter=""
				Case "1"
					If Application(SkcmsCookies & "classid")<>"0"  Then 
						If  CBool(SubClass)=True Then 
							 Parameter="ClassID In (" & skweboa.SK_CID_temp(Application(SkcmsCookies & "classid")) & ") And"
						Else 
							Parameter="ClassID='" & Application(SkcmsCookies & "classid") & "' And" 
							ClassID=Application(SkcmsCookies & "classid")
						End If 
					End If 
				Case Else
					If InStr(ClassID, ",") > 0 Then
						 Parameter="ClassID In (" & ClassID & ") And"
					Else
						If CBool(SubClass)=True Then 
						 Parameter="ClassID In (" & skweboa.SK_CID_temp(ClassID) & ") And"
						Else 
						 Parameter="ClassID='" & Replace(ClassID,"'","") & "' And"
						End If 
					End If 
			End Select
			If skwebIF<>"" Then skweb_IF = "  "&skwebIF
			If ModeID="0" Then ModeID=Cint(Application(SkcmsCookies & "ModeID"))
			If Ucase(Left(Trim(ArticleSort),2))<>"ID" Then  ArticleSort=ArticleSort & ",ID Desc"
			   SqlStr = "SELECT ID FROM "&skweboa.SK_Mroot(ModeID,2)&" Where " & Parameter & " isAccept=0 AND and  DateDiff(""d"",UpdateTime," & NowString & ")>=0    delif=0  "&skweb_IF&"  order by IsTop Desc," &ArticleSort 
 			   Dim RS,N
			   Set RS=skweboa.SK_axe(SqlStr)
			   If RS.EOF Then	skweboa_lsit = " NO data ":Application(Cstr(SkcmsCookies & "PageList")) = "":RS.Close:Set RS = Nothing:Exit Function
			   skwebSQL=RS.GetRows(-1):Set RS = Nothing
			   TotalPut=Ubound(skwebSQL,2)+1
			   PageNum=cint(PageNumber)
			   Dim PageNum, I, J, k, TempStr, OpenTypeStr,FolderNameAndLinkStr, TempTitle, NaviStr, ColSpanNum,AddDate,totalput,Tempsk_numericalStr
	 
						if (TotalPut mod PageNumber)=0 then
							PageNum = TotalPut \ PageNumber
						Else 
							PageNum = TotalPut \ PageNumber + 1
						End  If 
					  For I = 1 To PageNum
						 Tempsk_numericalStr = ""
						 For J = 1 To PageNumber
						   Tempsk_numericalStr = Tempsk_numericalStr &skwebSQL(0,N) & ","
						   N=N+1
						   If N>=TotalPut Then Exit For
						 Next
						  Tempsk_numericalStr = Left(Tempsk_numericalStr, Len(Tempsk_numericalStr) - 1)		
	
						  SqlStr = "SELECT ID,ClassID,Title,UpdateTime,skwebLink,FileName,skadminuserpurview,skReadthecontent,PicUrl,Intro,Content,SK_copysource,SK_The_author,KeyWords,ATT,IStop,Hits,UMID "&cmodegg&" "&skweboa.SK_Custom_folder(ModeID)&" FROM "&skweboa.SK_Mroot(ModeID,2)&"   Where ID in (" & Tempsk_numericalStr & ") AND isAccept=0  and  DateDiff(""d"",UpdateTime," & NowString & ")>=0    AND delif=0  "&skweb_IF&" order by IsTop Desc," &ArticleSort 
 						  TempStr = TempStr & skweboa_Page_SQL(SqlStr,TitleLen,DiyContent,ModeID,SubClass,ContentLen,DateForm,0)
						  TempStr = TempStr & skweboa.SK_pagingL(PageStyle,skweboa.SK_Mroot(ModeID,5),PageNum,I,TotalPut,PageNumber)
						  TempStr = TempStr & "{$PageList}" '加上分页符
					
						  If N>=TotalPut Then Exit For
					 Next
 						 Application(SkcmsCookies & "PageList") = TempStr
						 Application(SkcmsCookies & "PageStyle")= PageStyle
						 Application(SkcmsCookies & "pagecount")= TotalPut
 						 skweboa_lsit = "{PageListStr}"

		End Function

		Function skweboa_Page_SQL(SqlStr,TitleLen,DiyContent,ModeID,SubClass,ContentLen,DateForm,uif) '7

			 Dim RS,I,K,N,DateStr,TitleCssName,TypeNews,TempTitle,NaviStr,DateCssStr,skwebSQL,DiyContents,ArticleC
			 Set RS=skweboa.SK_axe(SqlStr)
			 If RS.EOF Then	 skweboa_Page_SQL="暂无内容":RS.Close:Set RS=Nothing:Exit Function
			 skwebSQL=RS.GetRows(-1):Set RS = Nothing
			 Dim skwebNum:skwebNum=Ubound(skwebSQL,2)
			 Dim Title,ClassnameLink

			 Dim SK_Custom_folderText,ModID
			 SK_Custom_folderText=skweboa.SK_Custom_folder(ModeID)
			 Dim J:J=1
				For K=0 To skwebNum
 					    DiyContents=DiyContent
						
												 
						If InStr(DiyContents, "#active") > 0  Then
						   if csng(Application(SkcmsCookies & "id"))=skwebSQL(0,N)  then 
						        DiyContents = Replace(DiyContents, "#active","active")
							else 
						        DiyContents = Replace(DiyContents, "#active","")
							end if
						End If 
 				
				
 						If InStr(DiyContents, "#ModeID") > 0  Then
						    DiyContents = Replace(DiyContents, "#ModeID",ModeID)
						End If
						
 						If InStr(DiyContents, "#ID") > 0  Then
						   DiyContents = Replace(DiyContents, "#ID",skwebSQL(0,N))
						End If	
					
					
						If InStr(DiyContents, "#tjcome") > 0  Then
						   DiyContents = Replace(DiyContents, "#tjcome",skweboa.SK_axe("SELECT Count([ID]) from  Comment_skweb  Where  ModeID=" & ModeID & " And ClassID='" & skwebSQL(1,N)& "' And skwebicleID=" &skwebSQL(0,N))(0))
						End If	
						
							
				if uif<>"0" then	
						If InStr(DiyContents, "#Link") > 0  Then
						   DiyContents = Replace(DiyContents, "#Link", "?page-"&uif&"-"&ModeID&"-"&skwebSQL(0,N)&"")
						End if
				else
						If InStr(DiyContents, "#Link") > 0  Then
						   DiyContents = Replace(DiyContents, "#Link", skweboa.SK_pageaddress(ModeID,skwebSQL(1,N),skwebSQL(0,N),skwebSQL(4,N),skwebSQL(5,N),skwebSQL(6,N),skwebSQL(7,N)))
						End if				
				end if 		
						
						
						If InStr(DiyContents, "#Title") > 0  Then
						   DiyContents = Replace(DiyContents, "#Title",skweboa.GetStrValue(skwebSQL(2,N),TitleLen) )
						End if
 						If InStr(DiyContents, "#CTitle") > 0  Then
						   DiyContents = Replace(DiyContents, "#CTitle",skweboa.CloseHtml(skwebSQL(2,N)))
						End if
 					 	If InStr(DiyContents, "#KeyWord") > 0  Then
							If skwebSQL(13,N)<>"" Then 
						    DiyContents = Replace(DiyContents, "#KeyWord","<a href=""" & SK_DataCMS_subject & "do/?searchtype=3&ModeID=" & ModeID & "&keyword=" & skwebSQL(13,N)& """ target=""_blank"">" & skwebSQL(13,N) & "</a>")
							Else
						    DiyContents = Replace(DiyContents, "#KeyWord","")
							End If 
					 	End If
    					If InStr(DiyContents, "#Thumb") > 0  Then
						   If  Trim(skwebSQL(8,N))<>"" Then 
							   DiyContents = Replace(DiyContents, "#Thumb",skweboa.PathDoMain&skwebSQL(8,N))
						   Else
							   DiyContents = Replace(DiyContents, "#Thumb",skweboa.SK_sys(69))
						   End If 
						End if
   						If InStr(DiyContents, "#PicUrl") > 0  Then
						   If  Trim(skwebSQL(8,N))<>"" Then 
						   DiyContents = Replace(DiyContents, "#PicUrl",skweboa.PathDoMain&Replace(skwebSQL(8,N),"thumb_",""))
						   Else
							   DiyContents = Replace(DiyContents, "#PicUrl",skweboa.SK_sys(69))
						   End If 
 						End If
 						If InStr(DiyContents, "#Intro") > 0  Then'暂用
							If Trim(skwebSQL(9,N))<>"" Then 
							   DiyContents = Replace(DiyContents, "#Intro",skweboa.GetStrValue(Replace(Replace(Replace(skweboa.CloseHtml(skwebSQL(9,N)), vbCrLf, ""), "[NextPage]", ""), "&nbsp;", ""), ContentLen))
							Else
							   DiyContents = Replace(DiyContents, "#Intro",skweboa.GetStrValue(Replace(Replace(Replace(skweboa.CloseHtml(skwebSQL(10,N)), vbCrLf, ""), "[NextPage]", ""), "&nbsp;", ""), ContentLen))
							End If 
						End if
  						If InStr(DiyContents, "#ClassName") > 0  Then
						   DiyContents = Replace(DiyContents, "#ClassName",skweboa.skCMSlist(skwebSQL(1,N),2))
						End if
						
	  				 If InStr(DiyContents, "#Classtitle") > 0  Then
						   DiyContents = Replace(DiyContents, "#Classtitle",skweboa.skCMSlist(skwebSQL(1,N),25))
						End if
						
  						If InStr(DiyContents, "#ClassLink") > 0  Then
						   DiyContents = Replace(DiyContents, "#ClassLink",skweboa.SK_MYListname(skwebSQL(1,N)))
						End If
						
					
  						If InStr(DiyContents, "#Time") > 0  Then
						   DiyContents = Replace(DiyContents, "#Time",CodeDateStr(skwebSQL(3,N),DateForm))
						End if
 						If InStr(DiyContents, "#Hits") > 0  Then
						   DiyContents = Replace(DiyContents, "#Hits","<Script Language=""Javascript"" Src=""" & SK_DataCMS_subject & "SKCMS/skweb.Hits.asp?A=List&ModeID="&ModeID&"&ID=" & skwebSQL(0,N)  & """></Script>")
						End If
						
						If InStr(DiyContents, "#Hittp") > 0  Then
						   DiyContents = Replace(DiyContents, "#Hittp",skwebSQL(16,N))
						End If

 						If InStr(DiyContents, "#AutoID") > 0  Then
						   DiyContents = Replace(DiyContents, "#AutoID",J)
						End if
 						If InStr(DiyContents, "#ModID") > 0  Then
 							If  N Mod 2 =0 Then ModID=0 Else ModID=1
						    DiyContents = Replace(DiyContents, "#ModID",ModID)
						End If
						
						 If InStr(DiyContents, "#A0ID") > 0  Then
						   DiyContents = Replace(DiyContents, "#A0ID",J-1)
						End if	
						
 						If InStr(DiyContents, "#Path") > 0  Then
						   DiyContents = Replace(DiyContents, "#Path",skweboa.SK_Root_directory)
						End if
 
 						If InStr(DiyContents, "#New") > 0  Then
						   If  (Year(skwebSQL(3,N))&Month(skwebSQL(3,N))&Day(skwebSQL(3,N)) =Year(Now)&Month(Now)&Day(Now)) Then
							   DiyContents = Replace(DiyContents, "#New","<b class=""skchom_ico sknewico"">新</b>")
						   Else 
							   DiyContents = Replace(DiyContents, "#New","")
						   End If 
 						End if
  
 
  						If InStr(DiyContents, "#Hot") > 0  Then
						   If  skwebSQL(14,N)=1 Then
							   DiyContents = Replace(DiyContents, "#Hot","<b class=""skchom_ico skhotico"">热门</b>")
						   Else 
							   DiyContents = Replace(DiyContents, "#Hot","")
						   End If 
 						End if
						
  						If InStr(DiyContents, "#Tj") > 0  Then
						   If  skwebSQL(14,N)=2 Then
							   DiyContents = Replace(DiyContents, "#Tj","<b class=""skchom_ico sktjico"">推荐</b>")
						   Else 
							   DiyContents = Replace(DiyContents, "#Tj","")
						   End If 
 						End if
						 
 
   						If InStr(DiyContents, "#Top") > 0  Then
						   If  skwebSQL(15,N)=1 Then
							   DiyContents = Replace(DiyContents, "#Top","<b class=""skchom_ico sktopico"">顶</b>")
						   Else 
							   DiyContents = Replace(DiyContents, "#Top","")
						   End If 
 						End if

						
  						If InStr(DiyContents, "#Classimg") > 0  Then
						   DiyContents = Replace(DiyContents, "#Classimg","<img src="""&skweboa.skCMSlist(skwebSQL(1,N),24)&"""/>")
						End if
  						 
  						If InStr(DiyContents, "#Classinfo") > 0  Then
						   DiyContents = Replace(DiyContents, "#Classinfo",skweboa.skCMSlist(skwebSQL(1,N),9))
						End if
						
						If Trim(SK_Custom_folderText)<>"" Then '11开始
 							Dim SK_Custom_folderarr,jj,ii
							ii=18
							SK_Custom_folderarr=Split(SK_Custom_folderText,",")
 							For jj=1 To UBound(SK_Custom_folderarr)
	
			 
					If InStr(DiyContents,"#"&SK_Custom_folderarr(jj)) > 0  Then
 								 If (InStr(DiyContents,"#"&SK_Custom_folderarr(jj))>0) and (trim(skwebSQL(ii,N))<>"") Then
									 DiyContents=Replace(DiyContents,"#"&SK_Custom_folderarr(jj),skwebSQL(ii,N))
 								 Else
									 DiyContents=Replace(DiyContents,"#"&SK_Custom_folderarr(jj),"")
								 End If 
					end if 		
								 ii=ii+1
							Next 
  						End If 
 	 	 
 					   skweboa_Page_SQL= skweboa_Page_SQL &DiyContents& vbCrLf
 					   N=N+1:j=j+1
					   
				Next
		End Function
		
		
		

%>
