<%
		Function SK_PHOTO(ClassID,ATT,ArticleSort,ListNumber,TitleLen,ContentLen,skwebIF,DiyContent,ModeID,Before,After,project,SubClass,Labelval,DateForm)   
			Dim SqlStr, skweb_IF,Parameter,skweboa_ATT
			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"
						  tnavclassid=true
						Else 
						 Parameter="ClassID='" & Replace(ClassID,"'","") & "' And"
						 tnavclassid=true
						End If 
					End If 
			End Select
			If ModeID="0" Then ModeID=Cint(Application(SkcmsCookies & "modeid"))
			If Labelval="true" Then  
			Labelvalc=" AND PicUrl<>'' "
			elseif Labelval="0" Then  
			Labelvalc=" AND SlIDe=1 "
			end if
 					
			If skwebIF<>"" Then 
			    if skwebIF="user" then
				     skweb_IF = "  and UMID="&UserID&"  and UserID="&UsmID&"  "
					 isAcceptif =" isAccept=0 AND "
				elseif  skwebIF="skuser" then
					skweb_IF = "  and UMID="&UMID&"  and UserID="&UID&"  "		
					isAcceptif =" "
				else
				 isAcceptif =" isAccept=0 AND "
			     skweb_IF = "  "&skwebIF&""
			  end if
			end if 

			If ATT="0" Then  skweboa_ATT="" Else skweboa_ATT = " And ATT="&ATT
			If Ucase(Left(Trim(ArticleSort),2))<>"ID" Then  ArticleSort=ArticleSort & ",ID Desc"		
			Sqlstr="Select TOP " & ListNumber & " ID,ClassID,Title,UpdateTime,skwebLink,FileName,skadminuserpurview,skReadthecontent,PicUrl,Intro,Content,SK_copysource,SK_The_author,KeyWords,ATT,IStop,Hits,UMID "&skweboa.SK_Custom_folder(ModeID)&" From  "&skweboa.SK_Mroot(ModeID,2)&"  Where " & Parameter & "  "&isAcceptif&"  delif=0   "&Labelvalc&" "&project&" " & skweboa_ATT &skweb_IF& " ORDER BY  " & ArticleSort
			
			if skweb_P_Code(SqlStr,ContentLen,TitleLen,DiyContent,ModeID,DateForm)<>"" then
			 
			if tnavclassid=true   then 
 			SK_PHOTO =sktitle_Nav(ClassID,Before&"")&skweb_P_Code(SqlStr,ContentLen,TitleLen,DiyContent,ModeID,DateForm)&sktitle_Nav(ClassID,After&"")
			else
			SK_PHOTO =Before&skweb_P_Code(SqlStr,ContentLen,TitleLen,DiyContent,ModeID,DateForm)&After
			end if
			
			else
			SK_PHOTO=""
			end if
			
		   End Function
		   
		  Function skweb_P_Code(SqlStr,ContentLen,TitleLen,DiyContent,ModeID,DateForm) 
			 Dim K,N,skwebSQL,RS,ArticleC,DiyContents,j,ModID
			 Set RS=skweboa.SK_axe(SqlStr)
 			 If RS.EOF Then	 skweb_P_Code="":RS.Close:Set RS=Nothing:Exit Function
			 skwebSQL=RS.GetRows(-1):RS.Close:Set RS = Nothing
			 Dim skwebNum:skwebNum=Ubound(skwebSQL,2)
			 Dim SK_Custom_folderText
			 SK_Custom_folderText=skweboa.SK_Custom_folder(ModeID)
 
					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, "#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
						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","" & skwebSQL(13,N) & "")
							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, "#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, "#A0ID") > 0  Then
						   DiyContents = Replace(DiyContents, "#A0ID",J-1)
						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, "#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(outerfors, "#Classinfo") > 0  Then
								 outerfors= Replace(outerfors,"#Classinfo",skweboa.skCMSlist(skwebSQL(0,N),9))
							End if
							
						   If InStr(outerfors, "#ClassAD") > 0  Then
								 outerfors= Replace(outerfors,"#ClassAD",skweboa.skCMSlist(skwebSQL(0,N),18))
							End if
								  If InStr(outerfors, "#Classimg") > 0  Then
								 outerfors= Replace(outerfors,"#Classimg","<img src="""&skweboa.skCMSlist(skwebSQL(0,N),24)&"""/>")
							End if
				 
						If Trim(SK_Custom_folderText)<>"" Then  
						    
 							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) 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 
								 ii=ii+1
							Next 
		 		
  						End If 
						skweb_P_Code =skweb_P_Code& DiyContents & vbCrLf
						N=N+1:j=j+1
  					Next 					  
 		End Function 
%>
