<!-- #include file="../../inc/html_clear.asp" -->

<%'容错处理
function news_to_html()
On Error Resume Next
%>

<%'读取模板内容
Set fso=Server.CreateObject("Scripting.FileSystemObject") 
Set htmlwrite=fso.OpenTextFile(Server.MapPath("/model/news_model.html")) 
replace_code=htmlwrite.ReadAll() 
htmlwrite.close 
%>

<%'首页基本信息内容读取替换
set rs=server.createobject("adodb.recordset")
sql="select web_name,web_url,web_image,web_title,web_keywords,web_description,web_person,web_url,web_email,web_tel,web_copyright from web_settings"
rs.open(sql),cn,1,1
if not rs.eof and not rs.bof then
web_name=rs("web_name")
web_image=rs("web_image")
web_title=rs("web_title")
web_keywords=rs("web_keywords")
web_description=rs("web_description")
web_copyright=rs("web_copyright")
web_person=rs("web_person")
web_url=rs("web_url")
web_email=rs("web_email")
web_tel=rs("web_tel")
end if
rs.close
set rs=nothing

replace_code=replace(replace_code,"$web_name$",web_name)
replace_code=replace(replace_code,"$web_image$",web_image)
replace_code=replace(replace_code,"$web_title$",web_title)
replace_code=replace(replace_code,"$web_keywords$",web_keywords)
replace_code=replace(replace_code,"$web_description$",web_description)
replace_code=replace(replace_code,"$web_copyright$",web_copyright)
replace_code=replace(replace_code,"$web_person$",web_person)
replace_code=replace(replace_code,"$web_url$",web_url)
replace_code=replace(replace_code,"$web_email$",web_email)
replace_code=replace(replace_code,"$web_tel$",web_tel)



'资讯标题列表读取替换
set rs=server.createobject("adodb.recordset")
sql="select name from category where id=45 order by time asc"
rs.open(sql),cn,1,1
if not rs.eof then
wb_name=wb_name&""
do while not rs.eof 
wb_name=wb_name&""&rs("name")&""
rs.movenext
loop
wb_name=wb_name&""
else
wb_name=wb_name&"无数据"
end if
rs.close
set rs=nothing

replace_code=replace(replace_code,"$wb_name$",wb_name)



'资讯关键字列表读取替换
set rs=server.createobject("adodb.recordset")
sql="select keywords from category where id=45 order by time asc"
rs.open(sql),cn,1,1
if not rs.eof then
wb_keywords=wb_keywords&""
do while not rs.eof 
wb_keywords=wb_keywords&""&rs("keywords")&""
rs.movenext
loop
wb_keywords=wb_keywords&""
else
wb_keywords=wb_keywords&"无数据"
end if
rs.close
set rs=nothing

replace_code=replace(replace_code,"$wb_keywords$",wb_keywords)



'资讯标签列表读取替换
set rs=server.createobject("adodb.recordset")
sql="select description from category where id=45 order by time asc"
rs.open(sql),cn,1,1
if not rs.eof then
wb_description=wb_description&""
do while not rs.eof 
wb_description=wb_description&""&rs("description")&""
rs.movenext
loop
wb_description=wb_description&""
else
wb_description=wb_description&"无数据"
end if
rs.close
set rs=nothing

replace_code=replace(replace_code,"$wb_description$",wb_description)



'顶部导航列表读取替换
set rs=server.createobject("adodb.recordset")
sql="select [number],[id] from web_menu_type order by [order]"
rs.open(sql),cn,1,1
if not rs.eof and not rs.bof then
do while not rs.eof
web_menu=web_menu&""
set rs_menu=server.createobject("adodb.recordset")
sql="select top "&rs("number")&" [name],[url] from web_menu where [position]="&rs("id")&" order by [order] "
rs_menu.open(sql),cn,1,1
if not rs_menu.eof and not rs_menu.bof then
for i= 1 to rs_menu.recordcount
if i=1  or i=rs_menu.recordcount/2+1 then
web_menu=web_menu&"<li><a href='"&rs_menu("url")&"' title='"&rs_menu("name")&"' target='_self'>"&left(rs_menu("name"),4)&"</a></li>"
else
web_menu=web_menu&"<li><a href='"&rs_menu("url")&"' title='"&rs_menu("name")&"' target='_self'>"&left(rs_menu("name"),4)&"</a></li>"
end if
if i=rs_menu.recordcount/2 then
web_menu=web_menu&""
end if
rs_menu.movenext
next
else
web_menu=web_menu&"无数据"
end if
rs_menu.close
set rs_menu=nothing

web_menu=web_menu&""
rs.movenext
loop
else
web_menu=web_menu&"无数据"
end if
rs.close
set rs=nothing

replace_code=replace(replace_code,"$web_menu$",web_menu)



'二层导航列表读取替换
set rs=server.createobject("adodb.recordset")
sql1="select top 12 name,folder from category where ppid=1 and id > 48 order by id asc"
rs.open(sql1),cn,1,1
if not rs.eof and not rs.bof then
web_menus=web_menus&""
do while not rs.eof 
web_menus=web_menus&"<li><a href='/"&rs("folder")&"/index.html' title='"&rs("name")&"' target='_self'>"&left(rs("name"),4)&"</a></li>"
rs.movenext
loop
web_menus=web_menus&""
else
web_menus=web_menus&"无数据"
end if
rs.close
set rs=nothing

replace_code=replace(replace_code,"$web_menus$",web_menus)



'二级导航列表读取替换
set rs=server.createobject("adodb.recordset")
sql="select top 12 [id],[name],[folder],[pid] from [category] where pid=36 and ppid=2 order by id"
rs.open(sql),cn,1,1
if not rs.eof and not rs.bof then
for i=1 to rs.recordcount

folder_name_0=rs("folder")
'ppid=2
set rs_1=server.createobject("adodb.recordset")
sql="select [folder] from [category] where [id]="&rs("pid")&" and ppid=1"
rs_1.open(sql),cn,1,1
if not rs_1.eof then

folder_name_1=rs_1("folder")

if folder_name_1<>"" and  folder_name_0<>"" then

Set Fso=Server.CreateObject("Scripting.FileSystemObject") 
If Fso.FolderExists(Server.MapPath("/"&folder_name_0))=true then
folder_path="/"&folder_name_0
else
folder_path="/html/"&rs("folder")
end if

else
folder_path="/html/"&rs("folder")
end if

end if
rs_1.close
set rs_1=nothing

if i=1 then
web_menuss=web_menuss&"<li><a href='"&folder_path&"/index.html' title='"&rs("name")&"' target='_self'>"&rs("name")&"</a></li>"
else
web_menuss=web_menuss&"<li><a href='"&folder_path&"/index.html' title='"&rs("name")&"' target='_self'>"&rs("name")&"</a></li>"
end if
rs.movenext
next
else
web_menuss=web_menuss&"无数据"
end if 
rs.close
set rs=nothing

replace_code=replace(replace_code,"$web_menuss$",web_menuss)



'站点推广①列表读取替换
set rs=server.createobject("adodb.recordset")
sql="select top 5 [name],[url] from web_keywords where hot_yes=1 order by [time] asc"
rs.open(sql),cn,1,1
if not rs.eof and not rs.bof then
do while not rs.eof
hotkeys_url=rs("url")
if rs("url")="" then
hotkeys_url=""
end if
web_hotsearch=web_hotsearch&"<a href='"&hotkeys_url&"' target='_blank' title='"&rs("name")&"'>"&left(rs("name"),6)&"</a>"
rs.movenext
loop
else
web_hotsearch=web_hotsearch&"无数据"
end if
rs.close
set rs=nothing

replace_code=replace(replace_code,"$web_hotsearch$",web_hotsearch)



'站内公告列表读取替换
set rs=server.createobject("adodb.recordset")
sql="select top 1 id,title,content,file_path,[url],time from [article] where view_yes=1 and index_push=1 and cid='58' order by [time] desc"
rs.open(sql),cn,1,1
if not rs.eof and not rs.bof then
rs_url=""
if rs("url")<>"" then
rs_url=rs("url")
else
rs_url=rs("file_path")
end if 
web_gonggao_list=web_gonggao_list&"<a href='"&rs_url&"' title='"&rs("title")&"' target='_blank'><font color=#333333>"&left(rs("title"),27)&"</font>"
web_gonggao_list=web_gonggao_list&""
else
web_gonggao_list=web_gonggao_list&"无数据"
end if
rs.close
set rs=Nothing

replace_code=replace(replace_code,"$web_gonggao_list$",web_gonggao_list)



'站点推广②列表读取替换
set rs=server.createobject("adodb.recordset")
sql="select top 20 [name],[url] from web_keywords where index_yes=1 order by [time] asc"
rs.open(sql),cn,1,1
if not rs.eof and not rs.bof then
do while not rs.eof
hotkeys_url=rs("url")
if rs("url")="" then
hotkeys_url=""
end if
web_indexsearch=web_indexsearch&"<div><a href='"&hotkeys_url&"' target='_blank' title='"&rs("name")&"'><font color=#333333>"&left(rs("name"),15)&"</font></a></div>"
rs.movenext
loop
else
web_indexsearch=web_indexsearch&"无数据"
end if
rs.close
set rs=nothing

replace_code=replace(replace_code,"$web_indexsearch$",web_indexsearch)



'幻灯广告列表读取替换
set rs=server.createobject("adodb.recordset")
sql="select top 10 name,[url],image from web_pic where view_yes=1 order by [order]"
rs.open(sql),cn,1,1
if not rs.eof and not rs.bof then
web_img_slide=web_img_slide&""
do while not rs.eof 
web_img_slide=web_img_slide&"<li><a href='"&rs("url")&"' target='_blank'>"&"<img src='/7yimg/"&rs("image")&"' alt='"&rs("name")&"' border='0' />"&"</a></li>"
rs.movenext
loop
web_img_slide=web_img_slide&""
else
web_img_slide=web_img_slide&"无数据"
end if
rs.close
set rs=nothing

replace_code=replace(replace_code,"$web_img_slide$",web_img_slide)

'教育新闻列表读取替换
set rs=server.createobject("adodb.recordset")
sql="select top 1 id,title,content,file_path,[url],time from [article]  where view_yes=1 and index_push=1 and cid='36' order by [time] desc"
rs.open(sql),cn,1,1
if not rs.eof and not rs.bof then
rs_url=""
if rs("url")<>"" then
rs_url=rs("url")
else
rs_url=rs("file_path")
end if 
web_jiaoyuxinwen_list=web_jiaoyuxinwen_list&"<li><a href='"&rs_url&"' title='"&rs("title")&"' target='_blank'>"&left(rs("title"),20)&"</li>"
web_jiaoyuxinwen_list=web_jiaoyuxinwen_list&""
else
web_jiaoyuxinwen_list=web_jiaoyuxinwen_list&"无数据"
end if
rs.close
set rs=nothing

set rs=server.createobject("adodb.recordset")
sql="select top 10 title,content,file_path,[url],time from [article]  where [id] not in (select top 1 [id] from [article]  where view_yes=1 and index_push=1 and cid='36' order by [time] desc) and view_yes=1 and cid='36' order by [time] desc"
rs.open(sql),cn,1,1
if not rs.eof and not rs.bof then
web_jiaoyuxinwen_list=web_jiaoyuxinwen_list&""
do while not rs.eof 
rs_url=""
if rs("url")<>"" then
rs_url=rs("url")
else
rs_url=rs("file_path")
end if 
web_jiaoyuxinwen_list=web_jiaoyuxinwen_list&"<li><a href='"&rs_url&"' target='_blank' title='"&rs("title")&"'>"&left(rs("title"),20)&"</a></li>"
rs.movenext
loop
web_jiaoyuxinwen_list=web_jiaoyuxinwen_list&""
else
web_jiaoyuxinwen_list=web_jiaoyuxinwen_list&"无数据"
end if
rs.close
set rs=nothing

replace_code=replace(replace_code,"$web_jiaoyuxinwen_list$",web_jiaoyuxinwen_list)

'新闻资讯①列表读取替换
set rs=server.createobject("adodb.recordset")
sql="select top 1 id,title,content,file_path,[url],time from [article]  where view_yes=1 and index_push=1 and cid='45' order by [time] desc"
rs.open(sql),cn,1,1
if not rs.eof and not rs.bof then

rs_url=""
if rs("url")<>"" then
rs_url=rs("url")
else
rs_url=rs("file_path")
end if 

web_new_list=web_new_list&"<a href='"&rs_url&"' target='_blank' title='"&rs("title")&"'>"&left(rs("title"),20)&"</a>"
web_new_list=web_new_list&""
else
web_new_list=web_new_list&"无数据"
end if
rs.close
set rs=Nothing

replace_code=replace(replace_code,"$web_new_list$",web_new_list)

'新闻资讯②列表读取替换
set rs=server.createobject("adodb.recordset")
sql="select top 17 title,content,file_path,[url],time from [article]  where [id] not in (select top 1 [id] from [article]  where view_yes=1 and index_push=1 and cid='45' order by [time] desc) and view_yes=1 and cid='45' order by [time] desc"
rs.open(sql),cn,1,1
if not rs.eof and not rs.bof then
web_news_list=web_news_list&""
do while not rs.eof 
rs_url=""
if rs("url")<>"" then
rs_url=rs("url")
else
rs_url=rs("file_path")
end if 
web_news_list=web_news_list&"<li><a href='"&rs_url&"' target='_blank' title='"&rs("title")&"'>"&left(rs("title"),25)&"</a></li>"
rs.movenext
loop
web_news_list=web_news_list&""
else
web_news_list=web_news_list&"无数据"
end if
rs.close
set rs=nothing

replace_code=replace(replace_code,"$web_news_list$",web_news_list)


'学校新闻列表读取替换
set rs=server.createobject("adodb.recordset")
sql="select top 1 id,title,content,file_path,[url],time from [article]  where view_yes=1 and index_push=1 and cid='37' order by [time] desc"
rs.open(sql),cn,1,1
if not rs.eof and not rs.bof then
rs_url=""
if rs("url")<>"" then
rs_url=rs("url")
else
rs_url=rs("file_path")
end if 
web_xuexiaoxinwen_list=web_xuexiaoxinwen_list&"<div><a href='"&rs_url&"' title='"&rs("title")&"'  target='_blank'>"&left(rs("title"),20)&"</div>"
web_xuexiaoxinwen_list=web_xuexiaoxinwen_list&""
else
web_xuexiaoxinwen_list=web_xuexiaoxinwen_list&"无数据"
end if
rs.close
set rs=nothing

set rs=server.createobject("adodb.recordset")
sql="select top 18 title,content,file_path,[url],time from [article]  where [id] not in (select top 1 [id] from [article]  where view_yes=1 and index_push=1 and cid='37' order by [time] desc) and view_yes=1 and cid='37' order by [time] desc"
rs.open(sql),cn,1,1
if not rs.eof and not rs.bof then
web_xuexiaoxinwen_list=web_xuexiaoxinwen_list&""
do while not rs.eof 
rs_url=""
if rs("url")<>"" then
rs_url=rs("url")
else
rs_url=rs("file_path")
end if 
web_xuexiaoxinwen_list=web_xuexiaoxinwen_list&"<div><a href='"&rs_url&"' target='_blank' title='"&rs("title")&"'>"&left(rs("title"),20)&"</a></div>"
rs.movenext
loop
web_xuexiaoxinwen_list=web_xuexiaoxinwen_list&""
else
web_xuexiaoxinwen_list=web_xuexiaoxinwen_list&"无数据"
end if
rs.close
set rs=nothing

replace_code=replace(replace_code,"$web_xuexiaoxinwen_list$",web_xuexiaoxinwen_list)


'国内教育列表读取替换
set rs=server.createobject("adodb.recordset")
sql="select top 1 id,title,content,file_path,[url],time from [article]  where view_yes=1 and index_push=1 and cid='46' order by [time] desc"
rs.open(sql),cn,1,1
if not rs.eof and not rs.bof then
rs_url=""
if rs("url")<>"" then
rs_url=rs("url")
else
rs_url=rs("file_path")
end if 
web_guoneijiaoyu_list=web_guoneijiaoyu_list&"<li><a href='"&rs_url&"' title='"&rs("title")&"'  target='_blank'>"&left(rs("title"),21)&"</li>"
web_guoneijiaoyu_list=web_guoneijiaoyu_list&""
else
web_guoneijiaoyu_list=web_guoneijiaoyu_list&"无数据"
end if
rs.close
set rs=nothing

set rs=server.createobject("adodb.recordset")
sql="select top 9 title,content,file_path,[url],time from [article]  where [id] not in (select top 1 [id] from [article]  where view_yes=1 and index_push=1 and cid='46' order by [time] desc) and view_yes=1 and cid='46' order by [time] desc"
rs.open(sql),cn,1,1
if not rs.eof and not rs.bof then
web_guoneijiaoyu_list=web_guoneijiaoyu_list&""
do while not rs.eof 
rs_url=""
if rs("url")<>"" then
rs_url=rs("url")
else
rs_url=rs("file_path")
end if 
web_guoneijiaoyu_list=web_guoneijiaoyu_list&"<li><a href='"&rs_url&"' target='_blank' title='"&rs("title")&"'>"&left(rs("title"),21)&"</a></li>"
rs.movenext
loop
web_guoneijiaoyu_list=web_guoneijiaoyu_list&""
else
web_guoneijiaoyu_list=web_guoneijiaoyu_list&"无数据"
end if
rs.close
set rs=nothing

replace_code=replace(replace_code,"$web_guoneijiaoyu_list$",web_guoneijiaoyu_list)

'国际教育列表读取替换
set rs=server.createobject("adodb.recordset")
sql="select top 1 id,title,content,file_path,[url],time from [article]  where view_yes=1 and index_push=1 and cid='47' order by [time] desc"
rs.open(sql),cn,1,1
if not rs.eof and not rs.bof then
rs_url=""
if rs("url")<>"" then
rs_url=rs("url")
else
rs_url=rs("file_path")
end if 
web_guojijiaoyu_list=web_guojijiaoyu_list&"<li><a href='"&rs_url&"' title='"&rs("title")&"'  target='_blank'>"&left(rs("title"),21)&"</li>"
web_guojijiaoyu_list=web_guojijiaoyu_list&""
else
web_guojijiaoyu_list=web_guojijiaoyu_list&"无数据"
end if
rs.close
set rs=nothing

set rs=server.createobject("adodb.recordset")
sql="select top 9 title,content,file_path,[url],time from [article]  where [id] not in (select top 1 [id] from [article]  where view_yes=1 and index_push=1 and cid='47' order by [time] desc) and view_yes=1 and cid='47' order by [time] desc"
rs.open(sql),cn,1,1
if not rs.eof and not rs.bof then
web_guojijiaoyu_list=web_guojijiaoyu_list&""
do while not rs.eof 
rs_url=""
if rs("url")<>"" then
rs_url=rs("url")
else
rs_url=rs("file_path")
end if 
web_guojijiaoyu_list=web_guojijiaoyu_list&"<li><a href='"&rs_url&"' target='_blank' title='"&rs("title")&"'>"&left(rs("title"),21)&"</a></li>"
rs.movenext
loop
web_guojijiaoyu_list=web_guojijiaoyu_list&""
else
web_guojijiaoyu_list=web_guojijiaoyu_list&"无数据"
end if
rs.close
set rs=nothing

replace_code=replace(replace_code,"$web_guojijiaoyu_list$",web_guojijiaoyu_list)


'基础教育列表读取替换
set rs=server.createobject("adodb.recordset")
sql="select top 1 id,title,content,file_path,[url],time from [article]  where view_yes=1 and index_push=1 and cid='48' order by [time] desc"
rs.open(sql),cn,1,1
if not rs.eof and not rs.bof then
rs_url=""
if rs("url")<>"" then
rs_url=rs("url")
else
rs_url=rs("file_path")
end if 
web_jichujiaoyu_list=web_jichujiaoyu_list&"<li><a href='"&rs_url&"' title='"&rs("title")&"'  target='_blank'>"&left(rs("title"),21)&"</li>"
web_jichujiaoyu_list=web_jichujiaoyu_list&""
else
web_jichujiaoyu_list=web_jichujiaoyu_list&"无数据"
end if
rs.close
set rs=nothing

set rs=server.createobject("adodb.recordset")
sql="select top 9 title,content,file_path,[url],time from [article]  where [id] not in (select top 1 [id] from [article]  where view_yes=1 and index_push=1 and cid='48' order by [time] desc) and view_yes=1 and cid='48' order by [time] desc"
rs.open(sql),cn,1,1
if not rs.eof and not rs.bof then
web_jichujiaoyu_list=web_jichujiaoyu_list&""
do while not rs.eof 
rs_url=""
if rs("url")<>"" then
rs_url=rs("url")
else
rs_url=rs("file_path")
end if 
web_jichujiaoyu_list=web_jichujiaoyu_list&"<li><a href='"&rs_url&"' target='_blank' title='"&rs("title")&"'>"&left(rs("title"),21)&"</a></li>"
rs.movenext
loop
web_jichujiaoyu_list=web_jichujiaoyu_list&""
else
web_jichujiaoyu_list=web_jichujiaoyu_list&"无数据"
end if
rs.close
set rs=nothing

replace_code=replace(replace_code,"$web_jichujiaoyu_list$",web_jichujiaoyu_list)

'高等教育列表读取替换
set rs=server.createobject("adodb.recordset")
sql="select top 1 id,title,content,file_path,[url],time from [article]  where view_yes=1 and index_push=1 and cid='49' order by [time] desc"
rs.open(sql),cn,1,1
if not rs.eof and not rs.bof then
rs_url=""
if rs("url")<>"" then
rs_url=rs("url")
else
rs_url=rs("file_path")
end if 
web_gaodengjiaoyu_list=web_gaodengjiaoyu_list&"<li><a href='"&rs_url&"' title='"&rs("title")&"'  target='_blank'>"&left(rs("title"),21)&"</li>"
web_gaodengjiaoyu_list=web_gaodengjiaoyu_list&""
else
web_gaodengjiaoyu_list=web_gaodengjiaoyu_list&"无数据"
end if
rs.close
set rs=nothing

set rs=server.createobject("adodb.recordset")
sql="select top 9 title,content,file_path,[url],time from [article]  where [id] not in (select top 1 [id] from [article]  where view_yes=1 and index_push=1 and cid='49' order by [time] desc) and view_yes=1 and cid='49' order by [time] desc"
rs.open(sql),cn,1,1
if not rs.eof and not rs.bof then
web_gaodengjiaoyu_list=web_gaodengjiaoyu_list&""
do while not rs.eof 
rs_url=""
if rs("url")<>"" then
rs_url=rs("url")
else
rs_url=rs("file_path")
end if 
web_gaodengjiaoyu_list=web_gaodengjiaoyu_list&"<li><a href='"&rs_url&"' target='_blank' title='"&rs("title")&"'>"&left(rs("title"),21)&"</a></li>"
rs.movenext
loop
web_gaodengjiaoyu_list=web_gaodengjiaoyu_list&""
else
web_gaodengjiaoyu_list=web_gaodengjiaoyu_list&"无数据"
end if
rs.close
set rs=nothing

replace_code=replace(replace_code,"$web_gaodengjiaoyu_list$",web_gaodengjiaoyu_list)

'职业教育列表读取替换
set rs=server.createobject("adodb.recordset")
sql="select top 1 id,title,content,file_path,[url],time from [article]  where view_yes=1 and index_push=1 and cid='50' order by [time] desc"
rs.open(sql),cn,1,1
if not rs.eof and not rs.bof then
rs_url=""
if rs("url")<>"" then
rs_url=rs("url")
else
rs_url=rs("file_path")
end if 
web_zhiyejiaoyu_list=web_zhiyejiaoyu_list&"<li><a href='"&rs_url&"' title='"&rs("title")&"'  target='_blank'>"&left(rs("title"),21)&"</li>"
web_zhiyejiaoyu_list=web_zhiyejiaoyu_list&""
else
web_zhiyejiaoyu_list=web_zhiyejiaoyu_list&"无数据"
end if
rs.close
set rs=nothing

set rs=server.createobject("adodb.recordset")
sql="select top 9 title,content,file_path,[url],time from [article]  where [id] not in (select top 1 [id] from [article]  where view_yes=1 and index_push=1 and cid='50' order by [time] desc) and view_yes=1 and cid='50' order by [time] desc"
rs.open(sql),cn,1,1
if not rs.eof and not rs.bof then
web_zhiyejiaoyu_list=web_zhiyejiaoyu_list&""
do while not rs.eof 
rs_url=""
if rs("url")<>"" then
rs_url=rs("url")
else
rs_url=rs("file_path")
end if 
web_zhiyejiaoyu_list=web_zhiyejiaoyu_list&"<li><a href='"&rs_url&"' target='_blank' title='"&rs("title")&"'>"&left(rs("title"),21)&"</a></li>"
rs.movenext
loop
web_zhiyejiaoyu_list=web_zhiyejiaoyu_list&""
else
web_zhiyejiaoyu_list=web_zhiyejiaoyu_list&"无数据"
end if
rs.close
set rs=nothing

replace_code=replace(replace_code,"$web_zhiyejiaoyu_list$",web_zhiyejiaoyu_list)

'成人教育列表读取替换
set rs=server.createobject("adodb.recordset")
sql="select top 1 id,title,content,file_path,[url],time from [article]  where view_yes=1 and index_push=1 and cid='51' order by [time] desc"
rs.open(sql),cn,1,1
if not rs.eof and not rs.bof then
rs_url=""
if rs("url")<>"" then
rs_url=rs("url")
else
rs_url=rs("file_path")
end if 
web_chengrenjiaoyu_list=web_chengrenjiaoyu_list&"<li><a href='"&rs_url&"' title='"&rs("title")&"'  target='_blank'>"&left(rs("title"),21)&"</li>"
web_chengrenjiaoyu_list=web_chengrenjiaoyu_list&""
else
web_chengrenjiaoyu_list=web_chengrenjiaoyu_list&"无数据"
end if
rs.close
set rs=nothing

set rs=server.createobject("adodb.recordset")
sql="select top 9 title,content,file_path,[url],time from [article]  where [id] not in (select top 1 [id] from [article]  where view_yes=1 and index_push=1 and cid='51' order by [time] desc) and view_yes=1 and cid='51' order by [time] desc"
rs.open(sql),cn,1,1
if not rs.eof and not rs.bof then
web_chengrenjiaoyu_list=web_chengrenjiaoyu_list&""
do while not rs.eof 
rs_url=""
if rs("url")<>"" then
rs_url=rs("url")
else
rs_url=rs("file_path")
end if 
web_chengrenjiaoyu_list=web_chengrenjiaoyu_list&"<li><a href='"&rs_url&"' target='_blank' title='"&rs("title")&"'>"&left(rs("title"),21)&"</a></li>"
rs.movenext
loop
web_chengrenjiaoyu_list=web_chengrenjiaoyu_list&""
else
web_chengrenjiaoyu_list=web_chengrenjiaoyu_list&"无数据"
end if
rs.close
set rs=nothing

replace_code=replace(replace_code,"$web_chengrenjiaoyu_list$",web_chengrenjiaoyu_list)

'教学列表读取替换
set rs=server.createobject("adodb.recordset")
sql="select top 1 id,title,content,file_path,[url],time from [article]  where view_yes=1 and index_push=1 and cid='52' order by [time] desc"
rs.open(sql),cn,1,1
if not rs.eof and not rs.bof then
rs_url=""
if rs("url")<>"" then
rs_url=rs("url")
else
rs_url=rs("file_path")
end if 
web_jiaoxue_list=web_jiaoxue_list&"<li><a href='"&rs_url&"' title='"&rs("title")&"'  target='_blank'>"&left(rs("title"),21)&"</li>"
web_jiaoxue_list=web_jiaoxue_list&""
else
web_jiaoxue_list=web_jiaoxue_list&"无数据"
end if
rs.close
set rs=nothing

set rs=server.createobject("adodb.recordset")
sql="select top 9 title,content,file_path,[url],time from [article]  where [id] not in (select top 1 [id] from [article]  where view_yes=1 and index_push=1 and cid='52' order by [time] desc) and view_yes=1 and cid='52' order by [time] desc"
rs.open(sql),cn,1,1
if not rs.eof and not rs.bof then
web_jiaoxue_list=web_jiaoxue_list&""
do while not rs.eof 
rs_url=""
if rs("url")<>"" then
rs_url=rs("url")
else
rs_url=rs("file_path")
end if 
web_jiaoxue_list=web_jiaoxue_list&"<li><a href='"&rs_url&"' target='_blank' title='"&rs("title")&"'>"&left(rs("title"),21)&"</a></li>"
rs.movenext
loop
web_jiaoxue_list=web_jiaoxue_list&""
else
web_jiaoxue_list=web_jiaoxue_list&"无数据"
end if
rs.close
set rs=nothing

replace_code=replace(replace_code,"$web_jiaoxue_list$",web_jiaoxue_list)

'教研列表读取替换
set rs=server.createobject("adodb.recordset")
sql="select top 1 id,title,content,file_path,[url],time from [article]  where view_yes=1 and index_push=1 and cid='53' order by [time] desc"
rs.open(sql),cn,1,1
if not rs.eof and not rs.bof then
rs_url=""
if rs("url")<>"" then
rs_url=rs("url")
else
rs_url=rs("file_path")
end if 
web_jiaoyan_list=web_jiaoyan_list&"<li><a href='"&rs_url&"' title='"&rs("title")&"'  target='_blank'>"&left(rs("title"),21)&"</li>"
web_jiaoyan_list=web_jiaoyan_list&""
else
web_jiaoyan_list=web_jiaoyan_list&"无数据"
end if
rs.close
set rs=nothing

set rs=server.createobject("adodb.recordset")
sql="select top 9 title,content,file_path,[url],time from [article]  where [id] not in (select top 1 [id] from [article]  where view_yes=1 and index_push=1 and cid='53' order by [time] desc) and view_yes=1 and cid='53' order by [time] desc"
rs.open(sql),cn,1,1
if not rs.eof and not rs.bof then
web_jiaoyan_list=web_jiaoyan_list&""
do while not rs.eof 
rs_url=""
if rs("url")<>"" then
rs_url=rs("url")
else
rs_url=rs("file_path")
end if 
web_jiaoyan_list=web_jiaoyan_list&"<li><a href='"&rs_url&"' target='_blank' title='"&rs("title")&"'>"&left(rs("title"),21)&"</a></li>"
rs.movenext
loop
web_jiaoyan_list=web_jiaoyan_list&""
else
web_jiaoyan_list=web_jiaoyan_list&"无数据"
end if
rs.close
set rs=nothing

replace_code=replace(replace_code,"$web_jiaoyan_list$",web_jiaoyan_list)

'就业列表读取替换
set rs=server.createobject("adodb.recordset")
sql="select top 1 id,title,content,file_path,[url],time from [article]  where view_yes=1 and index_push=1 and cid='54' order by [time] desc"
rs.open(sql),cn,1,1
if not rs.eof and not rs.bof then
rs_url=""
if rs("url")<>"" then
rs_url=rs("url")
else
rs_url=rs("file_path")
end if 
web_jiuye_list=web_jiuye_list&"<li><a href='"&rs_url&"' title='"&rs("title")&"'  target='_blank'>"&left(rs("title"),21)&"</li>"
web_jiuye_list=web_jiuye_list&""
else
web_jiuye_list=web_jiuye_list&"无数据"
end if
rs.close
set rs=nothing

set rs=server.createobject("adodb.recordset")
sql="select top 9 title,content,file_path,[url],time from [article]  where [id] not in (select top 1 [id] from [article]  where view_yes=1 and index_push=1 and cid='54' order by [time] desc) and view_yes=1 and cid='54' order by [time] desc"
rs.open(sql),cn,1,1
if not rs.eof and not rs.bof then
web_jiuye_list=web_jiuye_list&""
do while not rs.eof 
rs_url=""
if rs("url")<>"" then
rs_url=rs("url")
else
rs_url=rs("file_path")
end if 
web_jiuye_list=web_jiuye_list&"<li><a href='"&rs_url&"' target='_blank' title='"&rs("title")&"'>"&left(rs("title"),21)&"</a></li>"
rs.movenext
loop
web_jiuye_list=web_jiuye_list&""
else
web_jiuye_list=web_jiuye_list&"无数据"
end if
rs.close
set rs=nothing

replace_code=replace(replace_code,"$web_jiuye_list$",web_jiuye_list)

'高考列表读取替换
set rs=server.createobject("adodb.recordset")
sql="select top 1 id,title,content,file_path,[url],time from [article]  where view_yes=1 and index_push=1 and cid='55' order by [time] desc"
rs.open(sql),cn,1,1
if not rs.eof and not rs.bof then
rs_url=""
if rs("url")<>"" then
rs_url=rs("url")
else
rs_url=rs("file_path")
end if 
web_gaokao_list=web_gaokao_list&"<li><a href='"&rs_url&"' title='"&rs("title")&"'  target='_blank'>"&left(rs("title"),21)&"</li>"
web_gaokao_list=web_gaokao_list&""
else
web_gaokao_list=web_gaokao_list&"无数据"
end if
rs.close
set rs=nothing

set rs=server.createobject("adodb.recordset")
sql="select top 9 title,content,file_path,[url],time from [article]  where [id] not in (select top 1 [id] from [article]  where view_yes=1 and index_push=1 and cid='55' order by [time] desc) and view_yes=1 and cid='55' order by [time] desc"
rs.open(sql),cn,1,1
if not rs.eof and not rs.bof then
web_gaokao_list=web_gaokao_list&""
do while not rs.eof 
rs_url=""
if rs("url")<>"" then
rs_url=rs("url")
else
rs_url=rs("file_path")
end if 
web_gaokao_list=web_gaokao_list&"<li><a href='"&rs_url&"' target='_blank' title='"&rs("title")&"'>"&left(rs("title"),21)&"</a></li>"
rs.movenext
loop
web_gaokao_list=web_gaokao_list&""
else
web_gaokao_list=web_gaokao_list&"无数据"
end if
rs.close
set rs=nothing

replace_code=replace(replace_code,"$web_gaokao_list$",web_gaokao_list)

'考研列表读取替换
set rs=server.createobject("adodb.recordset")
sql="select top 1 id,title,content,file_path,[url],time from [article]  where view_yes=1 and index_push=1 and cid='56' order by [time] desc"
rs.open(sql),cn,1,1
if not rs.eof and not rs.bof then
rs_url=""
if rs("url")<>"" then
rs_url=rs("url")
else
rs_url=rs("file_path")
end if 
web_kaoyan_list=web_kaoyan_list&"<li><a href='"&rs_url&"' title='"&rs("title")&"'  target='_blank'>"&left(rs("title"),21)&"</li>"
web_kaoyan_list=web_kaoyan_list&""
else
web_kaoyan_list=web_kaoyan_list&"无数据"
end if
rs.close
set rs=nothing

set rs=server.createobject("adodb.recordset")
sql="select top 9 title,content,file_path,[url],time from [article]  where [id] not in (select top 1 [id] from [article]  where view_yes=1 and index_push=1 and cid='56' order by [time] desc) and view_yes=1 and cid='56' order by [time] desc"
rs.open(sql),cn,1,1
if not rs.eof and not rs.bof then
web_kaoyan_list=web_kaoyan_list&""
do while not rs.eof 
rs_url=""
if rs("url")<>"" then
rs_url=rs("url")
else
rs_url=rs("file_path")
end if 
web_kaoyan_list=web_kaoyan_list&"<li><a href='"&rs_url&"' target='_blank' title='"&rs("title")&"'>"&left(rs("title"),21)&"</a></li>"
rs.movenext
loop
web_kaoyan_list=web_kaoyan_list&""
else
web_kaoyan_list=web_kaoyan_list&"无数据"
end if
rs.close
set rs=nothing

replace_code=replace(replace_code,"$web_kaoyan_list$",web_kaoyan_list)

'读书列表读取替换
set rs=server.createobject("adodb.recordset")
sql="select top 1 id,title,content,file_path,[url],time from [article]  where view_yes=1 and index_push=1 and cid='57' order by [time] desc"
rs.open(sql),cn,1,1
if not rs.eof and not rs.bof then
rs_url=""
if rs("url")<>"" then
rs_url=rs("url")
else
rs_url=rs("file_path")
end if 
web_dushu_list=web_dushu_list&"<li><a href='"&rs_url&"' title='"&rs("title")&"' target='_blank'>"&left(rs("title"),21)&"</li>"
web_dushu_list=web_dushu_list&""
else
web_dushu_list=web_dushu_list&"无数据"
end if
rs.close
set rs=nothing

set rs=server.createobject("adodb.recordset")
sql="select top 9 title,content,file_path,[url],time from [article]  where [id] not in (select top 1 [id] from [article]  where view_yes=1 and index_push=1 and cid='57' order by [time] desc) and view_yes=1 and cid='57' order by [time] desc"
rs.open(sql),cn,1,1
if not rs.eof and not rs.bof then
web_dushu_list=web_dushu_list&""
do while not rs.eof 
rs_url=""
if rs("url")<>"" then
rs_url=rs("url")
else
rs_url=rs("file_path")
end if 
web_dushu_list=web_dushu_list&"<li><a href='"&rs_url&"' target='_blank' title='"&rs("title")&"'>"&left(rs("title"),21)&"</a></li>"
rs.movenext
loop
web_dushu_list=web_dushu_list&""
else
web_dushu_list=web_dushu_list&"无数据"
end if
rs.close
set rs=nothing

replace_code=replace(replace_code,"$web_dushu_list$",web_dushu_list)

'招商专区列表读取替换
set rs=server.createobject("adodb.recordset")
sql="select [name],[url],[memo] from web_gov where view_yes=1 order by [order]"
rs.open(sql),cn,1,1
if not rs.eof then
web_zhaoshang_list=web_zhaoshang_list&""
do while not rs.eof 
web_zhaoshang_list=web_zhaoshang_list&"<li><a href='"&rs("url")&"' target='_blank' title='"&rs("name")&"'><font color='#"&rs("memo")&"'>"&left(rs("name"),20)&"</font></a></li>"
rs.movenext
loop
web_zhaoshang_list=web_zhaoshang_list&""
else
web_zhaoshang_list=web_zhaoshang_list&"无数据"
end if
rs.close
set rs=nothing

replace_code=replace(replace_code,"$web_zhaoshang_list$",web_zhaoshang_list)



'友情链接列表读取替换
set rs=server.createobject("adodb.recordset")
sql="select [name],[url] from web_link where view_yes=1 order by [time] asc"
rs.open(sql),cn,1,1
if not rs.eof then
web_links_list=web_links_list&""
do while not rs.eof 
web_links_list=web_links_list&"<a href='"&rs("url")&"' target='_blank' title='"&rs("name")&"'>"&left(rs("name"),12)&"</a>"
rs.movenext
loop
web_links_list=web_links_list&""
else
web_links_list=web_links_list&"无数据"
end if
rs.close
set rs=nothing

replace_code=replace(replace_code,"$web_links_list$",web_links_list)



'①15560广告列表读取替换
set rs=server.createobject("adodb.recordset")
sql1="select top 12 name,url,image from web_site where index_push=1 and id < 63 order by time asc"
rs.open(sql1),cn,1,1
if not rs.eof and not rs.bof then
web_ad1site_list=web_ad1site_list&""
do while not rs.eof 
web_ad1site_list=web_ad1site_list&"<li><a href='"&rs("url")&"' target='_blank'><img src='/7yimg/"&rs("image")&"' alt='"&rs("name")&"' border='0'></a></li>"
rs.movenext
loop
web_ad1site_list=web_ad1site_list&""
else
web_ad1site_list=web_ad1site_list&"无数据"
end if
rs.close
set rs=nothing

replace_code=replace(replace_code,"$web_ad1site_list$",web_ad1site_list)



'②47080广告列表读取替换
set rs=server.createobject("adodb.recordset")
sql1="select top 2 name,url,image from web_site where index_push=1 and id > 62 order by time asc"
rs.open(sql1),cn,1,1
if not rs.eof and not rs.bof then
web_ad2site_list=web_ad2site_list&""
do while not rs.eof 
web_ad2site_list=web_ad2site_list&"<li><a href='"&rs("url")&"' target='_blank'><img src='/7yimg/"&rs("image")&"' alt='"&rs("name")&"' border='0'></a></li>"
rs.movenext
loop
web_ad2site_list=web_ad2site_list&""
else
web_ad2site_list=web_ad2site_list&"无数据"
end if
rs.close
set rs=nothing

replace_code=replace(replace_code,"$web_ad2site_list$",web_ad2site_list)



'③47080广告列表读取替换
set rs=server.createobject("adodb.recordset")
sql1="select top 2 name,url,image from web_site where index_push=1 and id > 64 order by time asc"
rs.open(sql1),cn,1,1
if not rs.eof and not rs.bof then
web_ad3site_list=web_ad3site_list&""
do while not rs.eof 
web_ad3site_list=web_ad3site_list&"<li><a href='"&rs("url")&"' target='_blank'><img src='/7yimg/"&rs("image")&"' alt='"&rs("name")&"' border='0'></a></li>"
rs.movenext
loop
web_ad3site_list=web_ad3site_list&""
else
web_ad3site_list=web_ad3site_list&"无数据"
end if
rs.close
set rs=nothing

replace_code=replace(replace_code,"$web_ad3site_list$",web_ad3site_list)



'④47080广告列表读取替换
set rs=server.createobject("adodb.recordset")
sql1="select top 2 name,url,image from web_site where index_push=1 and id > 66 order by time asc"
rs.open(sql1),cn,1,1
if not rs.eof and not rs.bof then
web_ad4site_list=web_ad4site_list&""
do while not rs.eof 
web_ad4site_list=web_ad4site_list&"<li><a href='"&rs("url")&"' target='_blank'><img src='/7yimg/"&rs("image")&"' alt='"&rs("name")&"' border='0'></a></li>"
rs.movenext
loop
web_ad4site_list=web_ad4site_list&""
else
web_ad4site_list=web_ad4site_list&"无数据"
end if
rs.close
set rs=nothing

replace_code=replace(replace_code,"$web_ad4site_list$",web_ad4site_list)


'⑤招商推荐列表读取替换
set rs=server.createobject("adodb.recordset")
sql1="select top 4 name,url,image from web_site where index_push=1 and id > 68 order by time asc"
rs.open(sql1),cn,1,1
if not rs.eof and not rs.bof then
web_ad5site_list=web_ad5site_list&""
do while not rs.eof 
web_ad5site_list=web_ad5site_list&"<li><a href='"&rs("url")&"' target='_blank'><img src='/7yimg/"&rs("image")&"' alt='"&rs("name")&"' border='0'></a><a href='"&rs("url")&"' target='_blank' title='"&rs("name")&"'>"&left(rs("name"),11)&"</a></li>"
rs.movenext
loop
web_ad5site_list=web_ad5site_list&""
else
web_ad5site_list=web_ad5site_list&"无数据"
end if
rs.close
set rs=nothing

replace_code=replace(replace_code,"$web_ad5site_list$",web_ad5site_list)
%>

<%'生成HTML文件名,指定文件路径
filepath="/news/Index.html"
%>

<% '生成首页静态文件
Set fout = fso.CreateTextFile(Server.MapPath(filepath))
fout.WriteLine replace_code
fout.close
fso.close
set fso=nothing
end function
%>