云网6.0电影系统Google sitemap地图插件

Posted by westanke 8 July,2008 (0)Comment
1.下载包中的文件解压到管理目录admin/中。
以下是代码

<!--#include file="../Conn.asp" -->
<LINK href="css/css.css" type=text/css rel=stylesheet>
<% 
IF Session("Admin")="" and Session("AdminGroup")="" and Session("AdminSession")<>true Then
        Response.write "<script>top.location.href='Admin_Login.asp'</script>"
END IF

Server.ScriptTimeout=50000
Site = "http://www.begood.net.cn"
folder = "Html"

Set fso = CreateObject("Scripting.FileSystemObject")
'fso.CreateFolder (".\")+"\xml"
Fso.createtextfile(server.mappath("/google.xml"))

Set Google=fso.opentextfile(server.mappath("/google.xml"),8)
Google.Writeline("<?xml version=""1.0"" encoding=""utf-8""?>")
Google.Writeline("<urlset xmlns=""http://www.google.com/schemas/sitemap/0.84"">") 

SQL = "select * from YWNT_TMS_Movie order by MovieDate desc"
set rs = server.CreateObject("ADODB.recordset")
rs.Open SQL,Conn,1,1
do        while not rs.eof

Timedate = time_type(rs("MovieDate"),7)

Google.Writeline("<url>") 
Google.Writeline("<loc>" &Site& "/" &folder& "/" &rs("ID")& ".html</loc>")
Google.Writeline("<lastmod>" &Timedate& "</lastmod>") 
Google.Writeline("<changefreq>weekly</changefreq>") 
Google.Writeline("<priority>0.5</priority>") 
Google.Writeline("</url>") 
rs.movenext
Loop
Set rs=Nothing
Google.Writeline("</urlset>") 
Google.Close 
Set objStream = Nothing

function time_type(tvar,tt)
    dim ttt,d_year,d_month,d_day,d_hour,d_minute,d_second
    ttt=tvar
    if ttt="" or isnull(ttt) then ttt=now_time
    if not(isdate(ttt)) then
      time_type=""
      exit function
    end if
    d_year=year(ttt)
    d_month=month(ttt)
    if len(d_month)<2 then d_month="0"&d_month
    d_day=day(ttt)
    if len(d_day)<2 then d_day="0"&d_day
    d_hour=hour(ttt)
    if len(d_hour)<2 then d_hour="0"&d_hour
    d_minute=minute(ttt)
    if len(d_minute)<2 then d_minute="0"&d_minute
    d_second=second(ttt)
    if len(d_second)<2 then d_second="0"&d_second
    select case tt
    case 1        '2000-10-10 23:45:45
      time_type=d_year&"-"&d_month&"-"&d_day&" "&d_hour&":"&d_minute&":"&d_second
    case 2        '年(4)-月-日 时:分:秒
      time_type=d_year&"年"&d_month&"月"&d_day&"日 "&d_hour&"时"&d_minute&"分"&d_second&"秒"
    case 3        '10-10 23:45
      time_type=d_month&"-"&d_day&" "&d_hour&":"&d_minute
    case 4        '10-10
      time_type=d_month&"-"&d_day
    case 5        '2003/10/10
      time_type=d_year&"-"&d_month&"-"&d_day
    case 6        '2003年10月10日
      time_type=d_year&"年"&d_month&"月"&d_day&"日"
    case 7        '2000-10-10
      time_type=d_year&"-"&d_month&"-"&d_day
    case else
      time_type=ttt
    end select
  end function
%>
<TABLE class=table cellSpacing=1 cellPadding=3 width="98%" align=center border=0>
  <tr>
    <td class=xingmu>创建google.xml成功! <%=site%>/google.xml</td>
  </tr>
  <tr>
    <td class="hback">谷歌规范XML地图页面生成完毕,请<a href="/google.xml" target="_blank"><u>点击打开查看</u></a>..........</td>
  </tr>
  <tr>
    <td class="hback">谷歌规范XML地图页面生成完毕,请<a href="https://www.google.com/webmasters/sitemaps/" target="_blank"><u>点击提交到谷歌</u></a>..........</td>
  </tr>
</table>

2.在生成站点中生成googlexml就行了,如下图:



下载:google_xml.rar

Related Items

Categories : 软件记录 Tags : 云网  电影系统  Google  sitemap  地图  插件  
Comments
Leave a comment