地图生成代码
!--#include file="conn.asp"-->
<%if
ChkAdminLogin()<>1 then response.Write "<script language='javascript'>alert('请先登录!');location.href='login.asp';</script>" response.Endend ifopenconn()sql1="select newsid,SortID,adddate,urlname from SW_News where SortID in( select SortID from SW_NewSort ) order by viewnum desc,newsid desc"set rs1=conn.execute (sql1)do while not rs1.eof
P_Str=P_Str&"<url>"& vbcrlf bid=rs1(0) bsort=rs1(1) bdate=rs1(2) burl=rs1(3) sql2="select SortSeo from SW_NewSort where SortID="&bsort
set rs2=conn.execute (sql2) if not rs2.eof then sseo=rs2(0)
end if rs2.close set rs2=nothing
P_Str=P_Str&"<loc>http://www.hxpsjx.com/"&sseo&"/"&burl&"-"&bid&".html</loc>"& vbcrlfP_Str=P_Str&"<lastmod>"&ConvertDate(bdate)&"</lastmod>"& vbcrlfP_Str=P_Str&"<changefreq>daily</changefreq>"& vbcrlfP_Str=P_Str&"<priority>0.5</priority>"& vbcrlfrs1.movenext P_Str=P_Str&"</url>"& vbcrlfloop rs1.closeset rs1=nothingcall SaveFile("sitemap","../","../Template/sitemap.xml",P_Str,ConvertDate(now()))function SaveFile(pagename,filepath,tempfile,P_Str,P_Date) FileName=pagenameSet Fso = CreateObject("Scripting.FileSystemObject") Mp = Server.MapPath(tempfile) Set ObjStream = Fso.OpenTextFile(Mp,1,-2) while not ObjStream.AtEndOfStream CContent= CContent & ObjStream.ReadLine & vbcrlf '读出文件内容 wend CContent=Replace(CContent,"{Hot_Str}",P_Str) CContent=Replace(CContent,"{Hot_Date}",P_Date) Dir = Server.MapPath(filepath) & "\" Set ObjHtml = Fso.CreateTextFile(Dir & "/" & FileName & ".xml") response.write "------"&FileName & ".xml<br>" ObjHtml.WriteLine CContent CContent = "" '复原内容变量 Set ObjHtml = NothingSet ObjStream = Nothing Set Fso = NothingEnd function %>
!--#include file="conn.asp"-->
<%if
ChkAdminLogin()<>1 then response.Write "<script language='javascript'>alert('请先登录!');location.href='login.asp';</script>" response.Endend ifopenconn()sql1="select newsid,SortID,adddate,urlname from SW_News where SortID in( select SortID from SW_NewSort ) order by viewnum desc,newsid desc"set rs1=conn.execute (sql1)do while not rs1.eof
P_Str=P_Str&"<url>"& vbcrlf bid=rs1(0) bsort=rs1(1) bdate=rs1(2) burl=rs1(3) sql2="select SortSeo from SW_NewSort where SortID="&bsort
set rs2=conn.execute (sql2) if not rs2.eof then sseo=rs2(0)
end if rs2.close set rs2=nothing
P_Str=P_Str&"<loc>http://www.hxpsjx.com/"&sseo&"/"&burl&"-"&bid&".html</loc>"& vbcrlfP_Str=P_Str&"<lastmod>"&ConvertDate(bdate)&"</lastmod>"& vbcrlfP_Str=P_Str&"<changefreq>daily</changefreq>"& vbcrlfP_Str=P_Str&"<priority>0.5</priority>"& vbcrlfrs1.movenext P_Str=P_Str&"</url>"& vbcrlfloop rs1.closeset rs1=nothingcall SaveFile("sitemap","../","../Template/sitemap.xml",P_Str,ConvertDate(now()))function SaveFile(pagename,filepath,tempfile,P_Str,P_Date) FileName=pagenameSet Fso = CreateObject("Scripting.FileSystemObject") Mp = Server.MapPath(tempfile) Set ObjStream = Fso.OpenTextFile(Mp,1,-2) while not ObjStream.AtEndOfStream CContent= CContent & ObjStream.ReadLine & vbcrlf '读出文件内容 wend CContent=Replace(CContent,"{Hot_Str}",P_Str) CContent=Replace(CContent,"{Hot_Date}",P_Date) Dir = Server.MapPath(filepath) & "\" Set ObjHtml = Fso.CreateTextFile(Dir & "/" & FileName & ".xml") response.write "------"&FileName & ".xml<br>" ObjHtml.WriteLine CContent CContent = "" '复原内容变量 Set ObjHtml = NothingSet ObjStream = Nothing Set Fso = NothingEnd function %>