<%
		Function related_Article(ModeID,ArticleSort,ListNumber,TitleLen,IntroNumber,skwebIF,Content,DateForm,acctyp)
 
		Dim skweb_IF
			 If Application(SkcmsCookies & "SK_Data_classification") = "CURRENT"  Then
			 
				 Dim RS,SqlStr:SqlStr = "Select KeyWords,association From "&skweboa.SK_Mroot(Application(SkcmsCookies & "modeid"),2)&" Where ID=" & skweboa.C_SKCMSSQL(Application(SkcmsCookies & "id")) & ""
				 Set RS=skweboa.SK_axe(SqlStr) 
 	 If RS.EOF Then	 related_Article=skweboa.SK_sys(24) :RS.Close:Set RS=Nothing:Exit Function
				 
				  If Ucase(Left(Trim(ArticleSort),2))<>"ID" Then  ArticleSort=ArticleSort & ",ID Desc"
					   	If skwebIF<>"" Then skweb_IF = "  "&skwebIF
		
			          dim gomid,dqid
					  if ModeID=0 then
					  gomid=Application(SkcmsCookies&"modeid")
					  dqid="AND ID<>"&skweboa.C_SKCMSSQL(Application(SkcmsCookies & "id"))&"  "
					  else 
					    gomid=ModeID
						dqid=""
					  end if 
					  
		   
			if 	Trim(acctyp)=0 then  
 	 
					 If Trim(RS(0))<>"" And IsNull(RS(0)) = False Then
						Dim KeyWordsArr, I, SqlKeyWordStr
						KeyWordsArr = Split(Trim(RS(0)), ",")
						 For I = 0 To UBound(KeyWordsArr)
							If SqlKeyWordStr = "" Then
								SqlKeyWordStr = "  KeyWords like '%" & KeyWordsArr(I) & "%'  or  Title Like '%" & KeyWordsArr(I) & "%'  "
							Else
								SqlKeyWordStr = SqlKeyWordStr & "or KeyWords like '%" & KeyWordsArr(I) & "%' or  Title Like '%" & KeyWordsArr(I) & "%' "
							End If
						Next
	  				
  				     	Else
					   related_Article =skweboa.SK_sys(24)
					      Exit Function	
				       End If
					   
					   ddsql="   (" & SqlKeyWordStr & ")   " 
				
              else  
 
	          If  IsNull(RS(1))  Then 
					    related_Article = skweboa.SK_sys(24)
					    Exit Function	
			  else
				       association= Split(RS(1),",")
			  end if
		 
		cont=ubound(association)-1
		 	
	    For i=0 to cont  
    dim  skweboa_fordll
	
	 
	skweboa_fordll=Split(""&association(i)&"","|")
	
	if skweboa_fordll(0)=ModeID then
	     sqltj=sqltj&skweboa_fordll(1)&","
	end if 
         Next
	  
                  SqlKeyWordStr = "  id in("&sqltj&")   "
                  ddsql=" " & SqlKeyWordStr & "  " 
			 end if 			  
				 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 "&cmodegg&" "&skweboa.SK_Custom_folder(gomid)&"  FROM "&skweboa.SK_Mroot(gomid,2)&"  Where  " & ddsql & "   "&skweb_IF&" AND isAccept=0  and  DateDiff(""d"",UpdateTime," & NowString & ")>=0    AND delif=0   "&dqid&" order by IsTop Desc," & ArticleSort
						related_Article =  skweb_P_Code(SqlStr,IntroNumber,TitleLen,Content,gomid,DateForm) 
			 Else
					related_Article = skweboa.SK_sys(24)
					
		 End If
				 
		 
		End Function
		

%>
