<% function mm_create_js_pic(mm_np_word) %>
<%
Dim rsn_pic__mmnpword
rsn_pic__mmnpword = ""
If (mm_np_word <> "") Then 
  rsn_pic__mmnpword = mm_np_word
End If
%>
<%
Dim rsn_pic
Dim rsn_pic_numRows

Set rsn_pic = Server.CreateObject("ADODB.Recordset")
rsn_pic.ActiveConnection = MM_conn_news_STRING
rsn_pic.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 and n_index = 1 " + Replace(rsn_pic__mmnpword, "'", "''") + "  ORDER BY n_date DESC"
rsn_pic.CursorType = 0
rsn_pic.CursorLocation = 2
rsn_pic.LockType = 1
rsn_pic.Open()

rsn_pic_numRows = 0
%>
<%
Dim HLooper1__numRows
HLooper1__numRows = 9
Dim HLooper1__index
HLooper1__index = 0
rsn_pic_numRows = rsn_pic_numRows + HLooper1__numRows
%>
<% 
dim mm_np_line 
dim mm_np_path
dim np_path
mm_np_path = mm_np_word
mm_np_path = replace(mm_np_path," and ","_")
mm_np_path = replace(mm_np_path," <> null ","_all")
mm_np_path = replace(mm_np_path," = ","_")
mm_np_path = replace(mm_np_path," ","")
mm_np_line = "document.write('"
if mm_np_path = "" then
np_path = ("js/news_pic__all.js")
else
np_path = ("js/news_pic_"&mm_np_path&".js")
end if
%>
&lt;script language=&quot;JavaScript&quot; src=&quot;<%=yns_js_path%><%=np_path%>&quot; 
      type=&quot;text/JavaScript&quot;&gt;&lt;/script&gt;
<%
np_path =  server.MapPath(np_path)
%>
<% if not rsn_pic.eof or not rsn_pic.bof then %>
<% mm_np_line= mm_np_line&"<table cellspacing="&chr(34)&yns_js_pic_cellspaceing&chr(34)&" cellpadding="&chr(34)&yns_js_pic_cellpadding&chr(34)&">" %>
  <%
startrw = 0
endrw = HLooper1__index
numberColumns = yns_js_pic_columns
numrows = yns_js_pic_rows
while((numrows <> 0) AND (Not rsn_pic.EOF))
	startrw = endrw + 1
	endrw = endrw + numberColumns
 %>
  <% mm_np_line= mm_np_line&"<tr align="&chr(34)&"center"&chr(34)&">"%> 
    <%
While ((startrw <= endrw) AND (Not rsn_pic.EOF))
%>
<% mm_np_line= mm_np_line&"<td><a href="&chr(34)&yns_js_path&(rsn_pic.Fields.Item("t_dir").Value)&"/"&(rsn_pic.Fields.Item("ts_dir").Value)&"/"&(rsn_pic.Fields.Item("n_fpath").Value)&"/"&(rsn_pic.Fields.Item("n_fname").Value)&chr(34)&" target="&chr(34)&"_blank"&chr(34)&"><img src="&chr(34)&yns_js_path&"upload/"&(rsn_pic.Fields.Item("n_mpic").Value)&chr(34)&" width="&chr(34)&yns_js_pic_width&chr(34)&" border="&chr(34)&"0"&chr(34)&" height="&chr(34)&yns_js_pic_height&chr(34)&">"%> 
<% mm_np_line= mm_np_line&"<br>"&(DoTrimProperly((rsn_pic.Fields.Item("n_title").Value),yns_js_np_font_num,0,1,"..."))&"</a></td>"%>
    <%
	startrw = startrw + 1
	rsn_pic.MoveNext()
	Wend
	%>
  <% mm_np_line= mm_np_line&"</tr>"%>
  <%
 numrows=numrows-1
 Wend
 %>
<% mm_np_line = mm_np_line&"</table>"%>
<% 
 else '如果没有记录执行下面的
 mm_np_line = mm_np_line&"没有新闻" 
 response.Write("<font color=red>没有新闻</font>")
 end if 
%>
<% mm_np_line = mm_np_line&"')"%>
<%
set fso = createobject("scripting.filesystemobject")
set fso_create = fso.createtextfile(np_path,true)
fso_create.Write mm_np_line
fso_create.close 
%>
<%
rsn_pic.Close()
Set rsn_pic = Nothing
%>
<% end function %>