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

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

<% '读取模板内容
'模板类型获取
set rs_1=server.createobject("adodb.recordset")
sql="select FileName,FolderName from web_Models_type where [id]=1"
rs_1.open(sql),cn,1,1
if not rs_1.eof then
Model_FileName=rs_1("FileName")
if rs_1("FolderName")<>"" then
Model_FolderName="/"&rs_1("FolderName")
end if
end if
rs_1.close
set rs_1=nothing

TemplatePath="/templates/"&web_theme&"/"&Model_FileName
replace_code=ReadFromUTF(TemplatePath,"utf-8") 
%>
<%
'Mobile Url
PetMobileUrl="/"&web_Folder&"/"

replace_code=replace(replace_code,"$web_name$",web_name)
replace_code=replace(replace_code,"$web_url$",web_url)
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_theme$",web_theme)
replace_code=replace(replace_code,"$web_consult$",web_consult)
replace_code=replace(replace_code,"$web_TopHTML$",web_TopHTML)
replace_code=replace(replace_code,"$web_BottomHTML$",web_BottomHTML)
replace_code=replace(replace_code,"$web_tel$",web_tel)
replace_code=replace(replace_code,"$search_FolderName$",search_FolderName)
replace_code=replace(replace_code,"$PetMobileUrl$",PetMobileUrl)



'顶部导航
web_TopMenu=""
set rs=server.createobject("adodb.recordset")
sql="select [id],[url],[name] from web_menu_type where TopNav=1 order by [order]"
rs.open(sql),cn,1,1
if not rs.eof then
web_TopMenu=web_TopMenu&"<ul id='sddm'>"
for i=1 to rs.recordcount
if i=1 then
web_TopMenu=web_TopMenu&"<li class='CurrentLi'>"
Else
web_TopMenu=web_TopMenu&"<li class=''>"
End if

web_TopMenu=web_TopMenu&"<a href='"&rs("url")&"' onmouseover=mopen('m"&i&"') onmouseout='mclosetime()'><abbr>"&rs("name")&"</abbr><span>"&rs("name")&"</span></a> "

set rss=server.createobject("adodb.recordset")
sql="select [url],[name] from web_menu where view_yes=1 and [position]="&rs("id")&" order by [order]"
rss.open(sql),cn,1,1
if not rss.eof then
web_TopMenu=web_TopMenu&"<div id='m"&i&"' onmouseover='mcancelclosetime()' onmouseout='mclosetime()'>"
do while not rss.eof
web_TopMenu=web_TopMenu&"<a href='"&rss("url")&"'>"&rss("name")&"</a> "
rss.movenext
loop
web_TopMenu=web_TopMenu&"</div> "
end if
rss.close
set rss=nothing

rs.movenext
next
web_TopMenu=web_TopMenu&"</ul>"
end if
rs.close
set rs=nothing

replace_code=replace(replace_code,"$web_TopMenu$",web_TopMenu)
replace_code=replace(replace_code,"$web_BottomMenu$",web_BottomMenu)
replace_code=replace(replace_code,"$Common_TxtBot$",Common_TxtBot)
replace_code=replace(replace_code,"$web_HotKeywords$",web_HotKeywords)



'首页顶部幻灯广告读取替换
set rs=server.createobject("adodb.recordset")
sql="select top 10 name,url,image from web_ads  where [position]=36 and view_yes=1 order by [order]"
rs.open(sql),cn,1,1
if not rs.eof then
for i=1 to rs.recordcount

web_TopIMGAD=web_TopIMGAD&"<li _src=""url(/images/up_images/"&rs("image")&")"" style='background:#FFF center 0 no-repeat;'><a href='"&rs("url")&"' target='_blank'></a></li>"

rs.movenext
next
end if
rs.close
set rs=nothing

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



'首页专题专栏广告读取替换
set rs=server.createobject("adodb.recordset")
sql="select top 3 name,url,image from web_ads  where [position]=42 and view_yes=1 order by [order]"
rs.open(sql),cn,1,1
if not rs.eof then
for i=1 to rs.recordcount
web_TopSpeAD=web_TopSpeAD&"<li class='SLi_"&i&"'><a  href='"&rs("url")&"' target='_blank'><img src='/images/up_images/"&rs("image")&"' alt='"&rs("name")&"'></a></li> "
rs.movenext
next
end if
rs.close
set rs=nothing

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



'关于我们
set rs=server.createobject("adodb.recordset")
sql="select top 1  [name],[folder],[id],[pid],[ppid],[image],[content],[description] from [category] where ClassType=5 and ppid=1 order by [order]"
rs.open(sql),cn,1,1
if not rs.eof then
ItemID=rs("id")
WebAboutName=rs("name")
WebAboutFolderName=rs("folder")
WebAboutImage=rs("image")
WebAboutContent=left(ClearHtml(rs("content")),210)
WebAboutDes=left(ClearHtml(rs("description")),40)
WebAboutFolder="/"&rs("folder") 

'Class
set rsp=server.createobject("adodb.recordset")
sql="select top 6 [name],[folder],[image] from [category] where pid="&ItemID&" and ppid=2 order by [Order]"
rsp.open(sql),cn,1,1
if not rsp.eof then
for i=1 to rsp.recordcount 

WebAboutList=WebAboutList&"<li class='ALi_"&i&"'><div><a href='"&WebAboutFolder&"/"&rsp("folder")&"'><img src='/images/up_images/"&rsp("image")&"' alt='"&rsp("name")&"'></a>"
WebAboutList=WebAboutList&"<p><a href='"&WebAboutFolder&"/"&rsp("folder")&"'>"&rsp("name")&"</a></p></div></li>"

rsp.movenext
next
end if 
rsp.close
set rsp=nothing

end if
rs.close
set rs=nothing

replace_code=replace(replace_code,"$WebAboutName$",WebAboutName)
replace_code=replace(replace_code,"$WebAboutFolderName$",WebAboutFolderName)
replace_code=replace(replace_code,"$WebAboutFolder$",WebAboutFolder)
replace_code=replace(replace_code,"$WebAboutImage$",WebAboutImage)
replace_code=replace(replace_code,"$WebAboutContent$",WebAboutContent)
replace_code=replace(replace_code,"$WebAboutDes$",WebAboutDes)
replace_code=replace(replace_code,"$WebAboutList$",WebAboutList)



'新闻动态
set rs=server.createobject("adodb.recordset")
sql="select top 1  [name],[folder],[id],[pid],[ppid] from [category] where ClassType=1 and ppid=1 order by [order]"
rs.open(sql),cn,1,1
if not rs.eof then
ItemID=rs("id")
WebNewNewsName=rs("name")
WebNewNewsFolderName=rs("folder")
ClassSQL="cid"
WebNewNewsFolder="/"&rs("folder") 

'content
set rss=server.createobject("adodb.recordset")
sql="select  [name],[folder],[id],[pid],[ppid] from [category] where pid="&ItemID&" and ClassType=1 and ppid=2 order by [order] "
rss.open(sql),cn,1,1
if not rss.eof then
for i=1 to rss.recordcount
WebNewNewsTitles=WebNewNewsTitles&"<li><A href='"&WebNewNewsFolder&"/"&rss("Folder")&"'>"&rss("name")&"</A></li> "

WebNewNewsList=WebNewNewsList&"<li><div class='DivList'><table class='MBlockTable' width='100%' border='0' cellspacing='0' cellpadding='0'>"

'Image
TopID=0
set rsp=server.createobject("adodb.recordset")
sql="select top 1 [id],[title],file_path,[description],[url] from [article] where ArticleType=1  and  cid='"&ItemID&"' and pid='"&rss("id")&"' and index_push=1 and view_yes=1 order by [time] desc"
rsp.open(sql),cn,1,1
if not rsp.eof then
TopID=rsp("id")
rs_url=""
rs_url=ArticleContent_FolderName&"/"&rsp("file_path")
WebNewNewsList=WebNewNewsList&"<div class='DivTop'><h1><a href='"&rs_url&"' target='_blank' title='"&rsp("title")&"'>"&left(rsp("title"),18)&"</a></h1>"
WebNewNewsList=WebNewNewsList&"<p>"&left(rsp("description"),65)&"...<a href='"&rs_url&"' target='_blank' title='"&rsp("title")&"'>详细>></a></p></div>"
end if 
rsp.close
set rsp=Nothing

'List
set rsp=server.createobject("adodb.recordset")
sql="select top 7 [title],file_path,[time] from [article] where ArticleType=1 and id<>"&TopID&" and cid='"&ItemID&"' and pid='"&rss("id")&"' and view_yes=1 order by [time] desc"
rsp.open(sql),cn,1,1
if not rsp.eof then
do while not rsp.eof 
rs_url=""
rs_url=ArticleContent_FolderName&"/"&rsp("file_path")
WebNewNewsList=WebNewNewsList&"<tr><td width='85%' class='ListTitle'><a href='"&rs_url&"' target='_blank' title='"&rsp("title")&"'>"&left(rsp("title"),32)&"</a></td>"
WebNewNewsList=WebNewNewsList&"<td width='15%'><span>"&month(rsp("time"))&"月"&day(rsp("time"))&"日</span></td></tr>"
rsp.movenext
loop
end if 
rsp.close
set rsp=nothing

WebNewNewsList=WebNewNewsList&"</table><div class='clearfix'></div></div></li>"
rss.movenext
next
end if
rss.close
set rss=nothing

'Slide
set rsp=server.createobject("adodb.recordset")
sql="select top 5 [title],file_path,[image],[time] from [article] where ArticleType=1 and [image]<>'' and cid='"&ItemID&"' and view_yes=1 order by [time] desc"
rsp.open(sql),cn,1,1
if not rsp.eof then
for i=1 to rsp.recordcount
rs_url=""
rs_url=ArticleContent_FolderName&"/"&rsp("file_path")

WebArticleSlide_IMG=WebArticleSlide_IMG&"<li>"
WebArticleSlide_IMG=WebArticleSlide_IMG&"<a href='"&rs_url&"' target='_blank' onfocus='this.blur();' >"
WebArticleSlide_IMG=WebArticleSlide_IMG&"<div class='con_img'><img  alt='"&left(rsp("title"),48)&"' src='images/up_images/"&rsp("image")&"' width='400' height='300'  />"
WebArticleSlide_IMG=WebArticleSlide_IMG&"<span class='ms'>"&left(rsp("title"),27)&"</span></div></a>"
WebArticleSlide_IMG=WebArticleSlide_IMG&"</li> "

WebArticleSlide_IMGNo=WebArticleSlide_IMGNo&"<li>"&i&"</li> "
 
rsp.movenext
next

end if 
rsp.close
set rsp=nothing

'Scroll
set rsp=server.createobject("adodb.recordset")
sql="select top 50 [title],file_path,[image] from [article] where ArticleType=1 and [image]<>'' and cid='"&ItemID&"' and view_yes=1 order by [time] desc"
rsp.open(sql),cn,1,1
if not rsp.eof then
for i=1 to rsp.recordcount
rs_url=""
rs_url=ArticleContent_FolderName&"/"&rsp("file_path")
 
'WebNewNewsSlideList=WebNewNewsSlideList&"<DIV class='box'><A href='"&rs_url&"' target='_blank'><IMG alt='"&rsp("title")&"' src='images/up_images/"&rsp("image")&"'  ></a>"
'WebNewNewsSlideList=WebNewNewsSlideList&" <p><A href='"&rs_url&"' target='_blank'>"&left(rsp("title"),15)&"</A></p> </DIV>"

WebNewNewsSlideList=WebNewNewsSlideList&"<li> <a href='"&rs_url&"' target='_blank' class='pic'>"
WebNewNewsSlideList=WebNewNewsSlideList&"<div class='content'> <img  alt='"&rsp("title")&"' src='/images/up_images/"&rsp("image")&"'>"
WebNewNewsSlideList=WebNewNewsSlideList&"<div class='mask'> <span class='fdj'></span>"
WebNewNewsSlideList=WebNewNewsSlideList&"<h4>"&left(rsp("title"),12)&"</h4>"
WebNewNewsSlideList=WebNewNewsSlideList&"<span class='project-arrow'></span> </div>"
WebNewNewsSlideList=WebNewNewsSlideList&"</div>"
WebNewNewsSlideList=WebNewNewsSlideList&"</a>"
WebNewNewsSlideList=WebNewNewsSlideList&"<p><a href='"&rs_url&"' target='_blank'>"&left(rsp("title"),16)&"</a></p>"
WebNewNewsSlideList=WebNewNewsSlideList&"</li>"

rsp.movenext
next

end if 
rsp.close
set rsp=nothing

end if
rs.close
set rs=nothing

replace_code=replace(replace_code,"$WebNewNewsTitles$",WebNewNewsTitles)
replace_code=replace(replace_code,"$WebNewNewsList$",WebNewNewsList)
replace_code=replace(replace_code,"$WebNewNewsFolder$",WebNewNewsFolder)
replace_code=replace(replace_code,"$WebArticleSlide_IMG$",WebArticleSlide_IMG)
replace_code=replace(replace_code,"$WebArticleSlide_IMGNo$",WebArticleSlide_IMGNo)
replace_code=replace(replace_code,"$WebNewNewsSlideList$",WebNewNewsSlideList)



'通知公告
set rs=server.createobject("adodb.recordset")
sql="select top 1  [name],[folder],[id],[pid],[ppid] from [category] where id<>"&ItemID&" and ClassType=1 and ppid=1 order by [order]"
rs.open(sql),cn,1,1
if not rs.eof then
ItemID=rs("id")
WebNewNews2Name=rs("name")
WebNewNews2FolderName=rs("folder")
select case rs("ppid")
case 1
ClassSQL="cid"
WebNewNews2Folder="/"&rs("folder") 
case 2
ClassSQL="pid"
set rs0=server.createobject("adodb.recordset")
sql="select [folder] from [category] where id="&rs("pid")
rs0.open(sql),cn,1,1
if not rs0.eof then
WebNewNews2Folder="/"&rs0("folder")&"/"&rs("folder")
end if
rs0.close
set rs0=nothing
case 3
ClassSQL="ppid"
set rs0=server.createobject("adodb.recordset")
sql="select [folder],[pid] from [category] where id="&rs("pid")
rs0.open(sql),cn,1,1
if not rs0.eof then
set rs00=server.createobject("adodb.recordset")
sql="select [folder] from [category] where id="&rs0("pid")
rs00.open(sql),cn,1,1
if not rs00.eof then
WebNewNews2Folder="/"&rs00("folder")&"/"&rs0("folder")&"/"&rs("folder") 
end if
rs00.close
set rs00=nothing
end if
rs0.close
set rs0=nothing
end select

'List
WebNewNews2List=WebNewNews2List&"<div class='DivList'><table class='MBlockTable' width='100%' border='0' cellspacing='0' cellpadding='0'>"
set rsp=server.createobject("adodb.recordset")
sql="select top 10 [title],file_path,[time] from [article] where ArticleType=1 and "&ClassSQL&"='"&ItemID&"'  and view_yes=1 order by [time] desc"
rsp.open(sql),cn,1,1
if not rsp.eof then
do while not rsp.eof 
rs_url=""
rs_url=ArticleContent_FolderName&"/"&rsp("file_path")
WebNewNews2List=WebNewNews2List&"<tr><td width='78%' class='ListTitle'><a href='"&rs_url&"' target='_blank' title='"&rsp("title")&"'>"&left(rsp("title"),15)&"</a></td>"
WebNewNews2List=WebNewNews2List&"<td width='22%'><span>"&month(rsp("time"))&"月"&day(rsp("time"))&"日</span></td></tr>"
rsp.movenext
loop
end if 
rsp.close
set rsp=nothing

WebNewNews2List=WebNewNews2List&"</table><div class='clearfix'></div></div></li>"

end if
rs.close
set rs=nothing

replace_code=replace(replace_code,"$WebNewNews2Name$",WebNewNews2Name)
replace_code=replace(replace_code,"$WebNewNews2List$",WebNewNews2List)
replace_code=replace(replace_code,"$WebNewNews2Folder$",WebNewNews2Folder)



'6Blanks 20 - 30
set rs=server.createobject("adodb.recordset")
sql="select top 6  [name],[folder],[id],[pid],[ppid] from [category] where [Order]>20 and [Order]<30 and ClassType=1 and ppid=1 order by [order] "
rs.open(sql),cn,1,1
if not rs.eof then
for i=1 to rs.recordcount
WebNewBlankList=WebNewBlankList&"<div class='leftx'>"
WebNewBlankList=WebNewBlankList&"<div class='BlockInner'>"
WebNewBlankList=WebNewBlankList&"<div class='topic'>"
WebNewBlankList=WebNewBlankList&"<div class='TopicTitle'><A href='/"&rs("Folder")&"/'>"&rs("name")&"</A></div>"
WebNewBlankList=WebNewBlankList&"<div class='TopicMore'> <a  href='/"&rs("Folder")&"/'>更多>></a></div>"
WebNewBlankList=WebNewBlankList&"</div>"
WebNewBlankList=WebNewBlankList&"<div class='HeightTab clearfix'></div>"

TopID=0
'Image
WebNewBlankList=WebNewBlankList&"<div class='DivList'>"
set rsp=server.createobject("adodb.recordset")
sql="select top 1 [id],[title],file_path,[description],[time],[image] from [article] where ArticleType=1 and cid='"&rs("id")&"' and image<>'' and view_yes=1 order by [time] desc"
rsp.open(sql),cn,1,1
if not rsp.eof then
TopID=rsp("id")
rs_url=""
rs_url=ArticleContent_FolderName&"/"&rsp("file_path")

WebNewBlankList=WebNewBlankList&"<div class='DivLi'>"
WebNewBlankList=WebNewBlankList&"<div class='DivLeft'><a href=''><img src='/images/up_images/"&rsp("image")&"' alt='"&rsp("title")&"'></a></div>"
WebNewBlankList=WebNewBlankList&"<div class='DivRight'>"
WebNewBlankList=WebNewBlankList&"<p><a href='"&rs_url&"' target='_blank' title='"&rsp("title")&"'>"&left(rsp("title"),20)&"</a></p>"
WebNewBlankList=WebNewBlankList&"<p class='Des'>"&left(ClearHtml(rsp("description")),45)&"...</p>"
WebNewBlankList=WebNewBlankList&"</div>"
WebNewBlankList=WebNewBlankList&"<div class='clearfix'></div>"
WebNewBlankList=WebNewBlankList&"</div>"
end if 
rsp.close
set rsp=nothing
WebNewBlankList=WebNewBlankList&"<div class='clearfix'></div></div></li>"

'List
WebNewBlankList=WebNewBlankList&"<div class='DivList'><table class='MBlockTable' width='100%' border='0' cellspacing='0' cellpadding='0'>"
set rsp=server.createobject("adodb.recordset")
sql="select top 7 [title],file_path,[time] from [article] where ArticleType=1 and cid='"&rs("id")&"' and id<>"&TopID&"  and view_yes=1 order by [time] desc"
rsp.open(sql),cn,1,1
if not rsp.eof then
do while not rsp.eof 
rs_url=""
rs_url=ArticleContent_FolderName&"/"&rsp("file_path")
WebNewBlankList=WebNewBlankList&"<tr><td width='85%' class='ListTitle'><a href='"&rs_url&"' target='_blank' title='"&rsp("title")&"'>"&left(rsp("title"),25)&"</a></td>"
WebNewBlankList=WebNewBlankList&"<td width='15%'><span>"&month(rsp("time"))&"月"&day(rsp("time"))&"日</span></td></tr>"
rsp.movenext
loop
end if 
rsp.close
set rsp=nothing

WebNewBlankList=WebNewBlankList&"</table><div class='clearfix'></div></div>"

WebNewBlankList=WebNewBlankList&"<div class=' clearfix'></div>"
WebNewBlankList=WebNewBlankList&"</div>"
WebNewBlankList=WebNewBlankList&"</div>"

if i mod 2 =0 then
WebNewBlankList=WebNewBlankList&"<div class='HeightTab clearfix'></div>"
else
WebNewBlankList=WebNewBlankList&"<div class='WidthTab'></div>"
end if

rs.movenext
next
end if
rs.close
set rs=nothing

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



'信息公开 416
set rs=server.createobject("adodb.recordset")
sql="select top 1  [folder],[id],[name],[Description] from [category] where id=416"
rs.open(sql),cn,1,1
if not rs.eof then
ItemID=rs("id")
WebItemFolderName=rs("folder")
WebItemFolder="/"&rs("folder")
WebItemName=rs("name")
WebItemDes=rs("Description")
'List
set rsl=server.createobject("adodb.recordset")
sql="select top 6 [name],[folder],[image] from [category] where pid="&ItemID&" and  ppid=2 order by [order] "
rsl.open(sql),cn,1,1
if not rsl.eof then
for i=1 to rsl.recordcount

WebItemList=WebItemList&"<li class='ILi_"&i&"'><a href='"&WebItemFolder&"/"&rsl("folder")&"'><img src='/images/up_images/"&rsl("image")&"' alt='"&rsl("name")&"'><span>"&rsl("name")&"</span></a></li>"

rsl.movenext
next
end if
rsl.close 
set rsl=nothing

end if
rs.close 
set rs=nothing

replace_code=replace(replace_code,"$WebItemList$",WebItemList)
replace_code=replace(replace_code,"$WebItemName$",WebItemName)
replace_code=replace(replace_code,"$WebItemFolderName$",WebItemFolderName)
replace_code=replace(replace_code,"$WebItemFolder$",WebItemFolder)
replace_code=replace(replace_code,"$WebItemDes$",WebItemDes)



'便民服务 441
set rs=server.createobject("adodb.recordset")
sql="select top 1  [name],[folder],[id],[pid],[ppid] from [category] where id=441"
rs.open(sql),cn,1,1
if not rs.eof then
ItemID=rs("id")
WebConvName=rs("name")
WebConvFolderName=rs("folder")
WebConvFolder="/"&rs("folder")

'List
set rsp=server.createobject("adodb.recordset")
sql="select top 12 [title],file_path from [article] where ArticleType=1 and cid='"&ItemID&"' and view_yes=1 order by [time] desc"
rsp.open(sql),cn,1,1
if not rsp.eof then
For i=1 To rsp.recordcount
rs_url=""
rs_url=ArticleContent_FolderName&"/"&rsp("file_path")

WebConvList=WebConvList&"<li class='ILi_"&i&"'><a href='"&rs_url&"' target='_blank' title='"&rsp("title")&"'><span>"&left(rsp("title"),6)&"</span></a></li> "

rsp.movenext
next
end if 
rsp.close
set rsp=nothing

end if
rs.close
set rs=nothing

replace_code=replace(replace_code,"$WebConvName$",WebConvName)
replace_code=replace(replace_code,"$WebConvFolderName$",WebConvFolderName)
replace_code=replace(replace_code,"$WebConvFolder$",WebConvFolder)
replace_code=replace(replace_code,"$WebConvList$",WebConvList)



'互动交流
set rs=server.createobject("adodb.recordset")
sql="select top 1  [name],[folder],[id],[pid],[ppid] from [category] where ClassType=4 and ppid=1 order by [order]"
rs.open(sql),cn,1,1
if not rs.eof then
ItemID=rs("id")
WebFeedName=rs("name")
WebFeedFolderName=rs("folder")
WebFeedFolder="/"&rs("folder")

'Class List
set rsl=server.createobject("adodb.recordset")
sql="select top 4 [name],[folder],[image] from [category] where pid="&ItemID&" and  ppid=2 order by [order] "
rsl.open(sql),cn,1,1
if not rsl.eof then
for i=1 to rsl.recordcount

WebFeedClassList=WebFeedClassList&"<li class='FLi_"&i&"'><a href='"&WebFeedFolder&"/"&rsl("folder")&"'><span>"&rsl("name")&"</span></a></li>"

rsl.movenext
next
end if
rsl.close 
set rsl=nothing

'List
set rsp=server.createobject("adodb.recordset")
sql="select top 7 [title],file_path,[PetID],[PetName],[ReContent],[time] from [web_info] where  cid='"&ItemID&"' and view_yes=1 order by [time] desc"
rsp.open(sql),cn,1,1
if not rsp.eof then
do while not rsp.eof 
rs_url=""
rs_url=FeedContent_FolderName&"/"&rsp("file_path")

If rsp("ReContent")<>"" Then
FeedStatus="<div class='Sta01'>处理完毕</div>"
Else
FeedStatus="<div class='Sta02'>等待处理</div>"
End if
WebFeedList=WebFeedList&"<tr><td><a href='"&rs_url&"' target='_blank' title='"&rsp("title")&"'>"&rsp("PetID")&"</a></td><td>"&Left(rsp("PetName"),1)&"**</td><td><a href='"&rs_url&"' target='_blank' title='"&rsp("title")&"'>"&left(rsp("title"),25)&"</a></td>"
WebFeedList=WebFeedList&"<td>"&FeedStatus&"</td><td><span>"&month(rsp("time"))&"月"&day(rsp("time"))&"日</span></td></tr>"

rsp.movenext
loop
end if 
rsp.close
set rsp=nothing

end if
rs.close
set rs=nothing

replace_code=replace(replace_code,"$WebFeedClassList$",WebFeedClassList)
replace_code=replace(replace_code,"$WebFeedList$",WebFeedList)
replace_code=replace(replace_code,"$WebFeedName$",WebFeedName)
replace_code=replace(replace_code,"$WebFeedFolderName$",WebFeedFolderName)
replace_code=replace(replace_code,"$WebFeedFolder$",WebFeedFolder)



'友情链接
web_link=""
set rsl=server.createobject("adodb.recordset")
sql="select  [name],[id] from [web_link_position]  order by [time] "
rsl.open(sql),cn,1,1
if not rsl.eof then
For i=1 To rsl.recordcount

web_link=web_link&"<div class='dropselect'>"
web_link=web_link&"<select onchange='window.open(this.value);'>"
web_link=web_link&"<option value=''>"&rsl("name")&"</option>"
                                
set rs=server.createobject("adodb.recordset")
sql="select  [name],[url],follow_yes from [web_link] where PositionID="&rsl("id")&" and view_yes=1 order by [order]"
rs.open(sql),cn,1,1
if not rs.eof then
do while not rs.eof
if rs("follow_yes")=1 then
NoFollow="rel='nofollow'"
else
NoFollow=""
end if 
web_link=web_link&"<option value='"&rs("url")&"'><a href='"&rs("url")&"'  "&NoFollow&">"&rs("name")&"</a></option>"
rs.movenext
loop
end if
rs.close
set rs=nothing

web_link=web_link&"</select>"
web_link=web_link&"</div> "

rsl.movenext
next
end if
rsl.close 
set rsl=nothing

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

%>

<% '判断文件夹是否存在，否则创建
Set Fso=Server.CreateObject("Scripting.FileSystemObject") 
If Fso.FolderExists(Server.MapPath(Model_FolderName))=false Then
NewFolderDir=Model_FolderName
call CreateFolderB(NewFolderDir)
end if
%>

<%'声明HTML文件名,指定文件路径
filepath=Model_FolderName&"/index.html"
%>

<% '读取模板
'******************************************
'功能：生成UTF-8文件
'******************************************
mappath =filepath
Set objStream = Server.CreateObject("ADODB.Stream")
With objStream
.Open
.Charset = "utf-8"
.Position = objStream.Size
.WriteText=replace_code
.SaveToFile server.mappath(mappath),2
.Close
End With
Set objStream = Nothing

%>
<%
end function
%>