<% function mm_create_js(mm_js_word,mm_js_num) %>
<%
'请尊重作者版权不要删除以下信息
' 程序作者:业一
'  http://yeyi.cn    
'  http://yeyicn.com
' 业一中国 
'--------------------------------------------------
' 承接各类网站制作和系统开发业务
'---------------------------------------------------
%>
<SCRIPT RUNAT=SERVER LANGUAGE=VBSCRIPT> 
function DoTrimProperly(str, nNamedFormat, properly, pointed, points)
  dim strRet
  strRet = Server.HTMLEncode(str)
  strRet = replace(strRet, vbcrlf,"")
  strRet = replace(strRet, vbtab,"")
  If (LEN(strRet) > nNamedFormat) Then
    strRet = LEFT(strRet, nNamedFormat)   
    If (properly = 1) Then     
      Dim TempArray        
      TempArray = split(strRet, " ") 
      Dim n
      strRet = ""
      for n = 0 to Ubound(TempArray) - 1
        strRet = strRet & " " & TempArray(n)
      next
    End If
    If (pointed = 1) Then
      strRet = strRet & points
    End If
  End If
  DoTrimProperly = strRet
End Function
</SCRIPT>
<%
dim mm_js_sort_by
dim mm_js_sort_type 
mm_js_sort_by = yns_js_item
mm_js_sort_type =yns_js_order
%>
<%
Dim rsn_js_create__mmword
rsn_js_create__mmword = ""
If (mm_js_word <> "") Then 
  rsn_js_create__mmword = mm_js_word
End If
%>
<%
Dim rsn_js_create
Dim rsn_js_create_numRows

Set rsn_js_create = Server.CreateObject("ADODB.Recordset")
rsn_js_create.ActiveConnection = MM_conn_news_STRING
rsn_js_create.Source = "SELECT *  FROM (t_news inner join t_type on t_news.n_tid = t_type.t_id) inner join t_type_son on t_news.n_tsid = t_type_son.ts_id  WHERE n_check=1 " + Replace(rsn_js_create__mmword, "'", "''") + " ORDER BY n_date DESC "
rsn_js_create.CursorType = 0
rsn_js_create.CursorLocation = 2
rsn_js_create.LockType = 1
rsn_js_create.Open()

rsn_js_create_numRows = 0
%>
<%
Dim Repeat_js_news1__numRows
Dim Repeat_js_news1__index

Repeat_js_news1__numRows = mm_js_num
Repeat_js_news1__index = 0
rsn_js_create_numRows = rsn_js_create_numRows + Repeat_js_news1__numRows
%>
<% 
dim mm_js_line 
dim mm_js_path
dim js_path
mm_js_path = mm_js_word
mm_js_path = replace(mm_js_path," and ","_")
mm_js_path = replace(mm_js_path," <> null ","_all")
mm_js_path = replace(mm_js_path," = ","_")
mm_js_path = replace(mm_js_path," ","")
mm_js_line = "document.write('"
if mm_js_path = "" then
js_path = ("js/news__all.js")
else
js_path = ("js/news_"&mm_js_path&".js")
end if
%>
&lt;script language=&quot;JavaScript&quot; src=&quot;<%=yns_js_path%><%=js_path%>&quot; 
      type=&quot;text/JavaScript&quot;&gt;&lt;/script&gt;
<%
js_path =  server.MapPath(js_path)
%>
<% If Not rsn_js_create.EOF Or Not rsn_js_create.BOF Then %>
<% While ((Repeat_js_news1__numRows <> 0) AND (NOT rsn_js_create.EOF)) %>

<%
mm_js_line=mm_js_line&yns_js_icon&" <a href="&chr(34)&yns_js_path&(rsn_js_create.Fields.Item("t_dir").Value)&"/"&(rsn_js_create.Fields.Item("ts_dir").Value)&"/"&(rsn_js_create.Fields.Item("n_fpath").Value)&"/"&(rsn_js_create.Fields.Item("n_fname").Value)&chr(34)&" target="&chr(34)&"_blank"&chr(34)&">"&(DoTrimProperly((rsn_js_create.Fields.Item("n_title").Value),yns_js_font_num,0,1,"..."))&"</a> <font class=copyriht color=#999999>"&(rsn_js_create.Fields.Item("n_fpath").Value)&"</font><br>"%>
<% 
  Repeat_js_news1__index=Repeat_js_news1__index+1
  Repeat_js_news1__numRows=Repeat_js_news1__numRows-1
  rsn_js_create.MoveNext()
Wend
%>
<%
else
mm_js_line =mm_js_line&"没有新闻"
response.Write("<font color=red>没有新闻</font>")
%>
<% End If ' end Not rsn_js_create.EOF Or NOT rsn_js_create.BOF %>

<%
mm_js_line=mm_js_line&"')"
set fso = createobject("scripting.filesystemobject")
set fso_create = fso.createtextfile(js_path,true)
fso_create.Write mm_js_line
fso_create.close 
%>
<%
rsn_js_create.Close()
Set rsn_js_create = Nothing
%>
<% end function %>