<!--#include file="../Inc/Consts.inc" -->
<!--#include file="../Inc/common.Asp" -->
<!--#include file="../Inc/sharefunc.Asp" -->
<!--#include file="CheckAdmin.Asp"-->
<%
' Ss简单网站管理系统-开源版 
'晴天设计www.xxzwz.com
If InStr(SsMasterPurview, "|39,") = 0 Then
    response.Write ("<br /><br /><div align=""center""><font style=""color:red; font-size:9pt; "")>您没有管理该模块的权限！</font></div>")
    response.End
End If
%>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="Images/Admin_style.css">
<script language="javascript" src="Admin.js"></script>
<%
Session("count") = 0

strURL = "http://" & request.servervariables("server_name")

Dim foolcat,strUrl,AutoLink
foolcat = foolcat + "<?xml version=""1.0"" encoding=""utf-8""?>"
foolcat = foolcat + "<!--Google Site Map File Generated by http://www.xxzwz.com " & return_RFC822_Date(Now, "GMT") & "-->"
foolcat = foolcat + "<urlset xmlns=""http://www.google.com/schemas/sitemap/0.84"">"
foolcat = foolcat + "<url>"
foolcat = foolcat + "<loc>" & strURL & "</loc>"
foolcat = foolcat + "<lastmod>" & FormatTime(Now, 1) & "</lastmod>"
foolcat = foolcat + "<changefreq>always</changefreq>"
foolcat = foolcat + "<priority>1.0</priority>"
foolcat = foolcat + "</url>"
Session("count") = Session("count") + "1"

Dim Rs, SQL

Set Rs = server.CreateObject("adodb.RecordSet")
SQL = "select * from "&Datapre&"_News"
Set Rs = conn.Execute (SQL)
Do Until Rs.EOF
    If ISHTML = 1 Then
        AutoLink = ""&NewName&""&Separated&""&Rs("ID")&"."&HTMLName&""
    Else
        AutoLink = "NewsView.Asp?ID="&Rs("ID")&""
    End If
    foolcat = foolcat + "<url>"
    foolcat = foolcat + "<loc>" & strURL & "" & SysRootDir & "" & AutoLink & "</loc>"
    foolcat = foolcat + "<lastmod>"&FormatTime(Rs("AddTime"), 1)&"</lastmod>"
    foolcat = foolcat + "<changefreq>daily</changefreq>"
    foolcat = foolcat + "<priority>0.8</priority>"
    foolcat = foolcat + "</url>"
    Session("count") = Session("count") + "1"
    Rs.movenext
Loop
Rs.Close
Set Rs = Nothing

Set Rs = server.CreateObject("adodb.RecordSet")
SQL = "select * from "&Datapre&"_Products"
Set Rs = conn.Execute (SQL)
Do Until Rs.EOF
    If ISHTML = 1 Then
        AutoLink = ""&ProName&""&Separated&""&rs("ID")&"."&HTMLName&""
    Else
        AutoLink = "ProductView.Asp?ID="&rs("ID")&""
    End If
    foolcat = foolcat + "<url>"
    foolcat = foolcat + "<loc>" & strURL & "" & SysRootDir & "" & AutoLink & "</loc>"
    foolcat = foolcat + "<lastmod>"&FormatTime(Rs("UpdateTime"), 1)&"</lastmod>"
    foolcat = foolcat + "<changefreq>daily</changefreq>"
    foolcat = foolcat + "<priority>0.8</priority>"
    foolcat = foolcat + "</url>"
    Session("count") = Session("count") + "1"
    Rs.movenext
Loop
Rs.Close
Set Rs = Nothing

Set Rs = server.CreateObject("adodb.RecordSet")
SQL = "select * from "&Datapre&"_Download"
Set Rs = conn.Execute (SQL)
Do Until Rs.EOF
    If ISHTML = 1 Then
        AutoLink = ""&DownNameDiy&""&Separated&""&rs("ID")&"."&HTMLName&""
    Else
        AutoLink = "DownView.Asp?ID="&rs("ID")&""
    End If
    foolcat = foolcat + "<url>"
    foolcat = foolcat + "<loc>" & strURL & "" & SysRootDir & "" & AutoLink & "</loc>"
    foolcat = foolcat + "<lastmod>"&FormatTime(Rs("UpdateTime"), 1)&"</lastmod>"
    foolcat = foolcat + "<changefreq>daily</changefreq>"
    foolcat = foolcat + "<priority>0.6</priority>"
    foolcat = foolcat + "</url>"
    Session("count") = Session("count") + "1"
    Rs.movenext
Loop
Rs.Close
Set Rs = Nothing

Set Rs = server.CreateObject("adodb.RecordSet")
SQL = "select * from "&Datapre&"_Others"
Set Rs = conn.Execute (SQL)
Do Until Rs.EOF
    If ISHTML = 1 Then
        AutoLink = ""&OtherName&""&Separated&""&rs("ID")&"."&HTMLName&""
    Else
        AutoLink = "OtherView.Asp?ID="&rs("ID")&""
    End If
    foolcat = foolcat + "<url>"
    foolcat = foolcat + "<loc>" & strURL & "" & SysRootDir & "" & AutoLink & "</loc>"
    foolcat = foolcat + "<lastmod>"&FormatTime(Rs("UpdateTime"), 1)&"</lastmod>"
    foolcat = foolcat + "<changefreq>daily</changefreq>"
    foolcat = foolcat + "<priority>0.6</priority>"
    foolcat = foolcat + "</url>"
    Session("count") = Session("count") + "1"
    Rs.movenext
Loop
Rs.Close
Set Rs = Nothing

Set Rs = server.CreateObject("adodb.RecordSet")
SQL = "select * from "&Datapre&"_About"
Set Rs = conn.Execute (SQL)
Do Until Rs.EOF
    If ISHTML = 1 Then
        AutoLink = ""&AboutNameDiy&""&Separated&""&rs("ID")&"."&HTMLName&""
    Else
        AutoLink = "About.Asp?ID="&rs("ID")&""
    End If
    foolcat = foolcat + "<url>"
    foolcat = foolcat + "<loc>" & strURL & "" & SysRootDir & "" & AutoLink & "</loc>"
    foolcat = foolcat + "<lastmod>"&FormatTime(Rs("UpdateTime"), 1)&"</lastmod>"
    foolcat = foolcat + "<changefreq>daily</changefreq>"
    foolcat = foolcat + "<priority>0.5</priority>"
    foolcat = foolcat + "</url>"
    Session("count") = Session("count") + "1"
    Rs.movenext
Loop
Rs.Close
Set Rs = Nothing

foolcat = foolcat + "</urlset>"

foolcat = "" + foolcat + ""
foolcat = "" & foolcat & ""
Dim fso,fout,FolderPath
FolderPath = Server.MapPath("..")
Set fso = Server.CreateObject("Scripting.FileSystemObject")
Set fout = fso.CreateTextFile(FolderPath&"\sitemap.xml")
fout.WriteLine foolcat
fout.Close
Set fout = Nothing
conn.Close
Set conn = Nothing

Function return_RFC822_Date(ByVal myDate, ByVal TimeZone)
    Dim myDay, myDays, myMonth, myYear
    Dim myHours, myMinutes, mySeconds

    myDate = CDate(myDate)
    myDay = EnWeekDayName(myDate)
    myDays = Right("00" & Day(myDate), 2)
    myMonth = EnMonthName(myDate)
    myYear = Year(myDate)
    myHours = Right("00" & Hour(myDate), 2)
    myMinutes = Right("00" & Minute(myDate), 2)
    mySeconds = Right("00" & Second(myDate), 2)

    return_RFC822_Date = myDay&", "& _
                         myDays&" "& _
                         myMonth&" "& _
                         myYear&" "& _
                         myHours&":"& _
                         myMinutes&":"& _
                         mySeconds&" "& _
                         " " & TimeZone
End Function

Function EnWeekDayName(InputDate)
    Dim Result
    Select Case Weekday(InputDate, 1)
        Case 1
            Result = "Sun"
        Case 2
            Result = "Mon"
        Case 3
            Result = "Tue"
        Case 4
            Result = "Wed"
        Case 5
            Result = "Thu"
        Case 6
            Result = "Fri"
        Case 7
            Result = "Sat"
    End Select
    EnWeekDayName = Result
End Function

Function EnMonthName(InputDate)
    Dim Result
    Select Case Month(InputDate)
        Case 1
            Result = "Jan"
        Case 2
            Result = "Feb"
        Case 3
            Result = "Mar"
        Case 4
            Result = "Apr"
        Case 5
            Result = "May"
        Case 6
            Result = "Jun"
        Case 7
            Result = "Jul"
        Case 8
            Result = "Aug"
        Case 9
            Result = "Sep"
        Case 10
            Result = "Oct"
        Case 11
            Result = "Nov"
        Case 12
            Result = "Dec"
    End Select
    EnMonthName = Result
End Function

Function FormatTime(sTime, iFmt)
    Dim sTemp
    If IsNull(sTime) Or sTime = "" Then
        FormatTime = Year(Date) & "-" & Right("0" & Month(Date), 2) & "-" & Right("0" & Day(Date), 2)
        Exit Function
    End If
    sTemp = Year(sTime) & "-" & Right("0" & Month(sTime), 2) & "-" & Right("0" & Day(sTime), 2)
    Select Case iFmt
        Case 0
            FormatTime = sTemp
        Case 1
            FormatTime = sTemp& "T" & Right("0" & Hour(sTime), 2) & ":" & Right("0" & Minute(sTime), 2) & "+08:00"
    End Select
End Function

Response.Write "<br />&nbsp;&nbsp;SsCMS为您提供适用于Google的SiteMap。<br />&nbsp;&nbsp;SiteMap.xml生成完毕，共<font color=""#FF0000""> "&Session("count")&" </font>条记录被索引。<br />&nbsp;&nbsp;点击查看 <a href=""../sitemap.xml"" target=""_blank""><font color=""#FF0000""><u>SiteMap.xml</u></font></a> <a href=""http://www.google.com/webmasters/sitemaps/"" target=""_blank""><u>立即提交至Google</u></a>"
%>