复制内容到剪贴板
代码:
public sub createmap()
dim rs,i,data,irs,outmap,listid,listpath
if len(king.mapname)=0 then exit sub
set rs=conn.execute("select top "&king.mapnumber&" artdate,artpath,artid,listid,artcommend,arthead from kingart where artshow=1 and artgrade=0 order by artid desc;")
if not rs.eof and not rs.bof then
data=rs.getrows()
outmap="<?xml version=""1.0"" encoding=""UTF-8""?>"
outmap=outmap&"<urlset xmlns="""&king_map_xmlns&""">"
for i=0 to ubound(data,2)
if cstr(listid)<>cstr(data(3,i)) then
listid=data(3,i)
set irs=conn.execute("select listpath from kingart_list where listid="&listid&";")
if not irs.eof and not irs.bof then
listpath=irs(0)
end if
irs.close
set irs=nothing
end if
outmap=outmap&"<url>"
outmap=outmap&"<loc>"&getpath(data(2,i),0,king.siteurl&king.inst&listpath&"/"&data(1,i))&"</loc>"
outmap=outmap&"<lastmod>"&formatdate(data(0,i),"yyyy-MM-dd")&"</lastmod>"'~~~~~~~~edit
outmap=outmap&"<priority>"&formatnumber((data(4,i)+data(5,i)+2)/4,1,true)&"</priority>"
outmap=outmap&"</url>"
next
outmap=outmap&"</urlset>"
king.savetofile "../../"&art.path&".xml",outmap
end if
rs.close
set rs=nothing
end sub