如何落伍 | 站长俱乐部 | 落伍预告 | 落伍分类 | 站长运营 | 站长赚钱 | 免费代码 | 现金任务 | 人才招聘 | 落伍DIY | 站长工具
推荐:图铃+艺术签名效果强!影视播放器安装3毛一个不限手法高价网摘,自定义点击强氧服务器-特价机型回馈落伍者
香港、新加坡、美国服务器招代理上量中客:整机月付得产权,续费仅需399/月!九九数据 20人合租 399元 赠CDN加速联盟20-35元千IP周付.导航站流量收购
WAUEE挚盟:六年锤炼品牌联盟惊!光辉VPS风暴!08联盟一周年真情回报活动10M独享租用550元-合租80/月
DNSPod智能DNS,我们一直在免费紫田网络 诚信典范 5周年服务器促销CPA 影音下载联盟 日付 不限手法!上海4G硬防服务器900/月,空间90/年
百独租用1200 独立IP合租80 .com 43VPS诚招代理酷睿服务器租用300/月起专业合租主机,可月付,用质量,比售后!磐石:香港主机1G99元,COM域名39元
返回列表 回复 发帖

[代码发布] [落伍首发]马克斯MAXZ5.0生成GG SiteMap代码(贴代码)

[代码发布] [落伍首发]马克斯MAXZ5.0生成GG SiteMap代码(贴代码)

在代码区的帖子不能编辑...昨天附件没有上传...
新人区不能用code代码....哎....发个代码费了牛劲了.....
斑竹把那两个删除了吧....这个帖子继续等待审核...哈哈哈......


用MAXZ5.0的人不少...都在搞SEO,做了一个后台生成sitemap的程序...
我自己还没有用的..就贡献出来了....  
先在管理的admin_index.asp修改
  1. menu(2,3)="<a target=main href=make.asp>生成选项</a>"
  2. menu(2,4)="<a target=main href=make_ggmap.asp>生成GG Sitemap</a>"
复制代码
直接在管理文件夹新建一个make_ggmap.asp文件,文件内容如下:
  1. <!--#include file="conn.asp"-->
  2. <!-- #include file="check.asp" -->
  3. <%
  4. '==================================
  5. '  Google SiteMap for MAXZ5.0
  6. '  更新时间: 2008-2-22
  7. '  Eming & Xuesharp
  8. '  www.tuibian.com
  9. '  注:num为提取电影的个数,设为0为全部
  10. '==================================
  11. Dim num,SiteURL
  12. num=100
  13. SiteURL="http://"&maxz_2&"/"
  14. 'Response.write  SiteURL
  15. Sub Escape(ByRef s)
  16.   s = Replace(s, "&", "&amp;")
  17.   s = Replace(s, "'", "&apos;")
  18.   s = Replace(s, """", "&quot;")
  19.   s = Replace(s, "<", "&gt;")
  20.   s = Replace(s, ">", "&lt;")  
  21. End Sub

  22. '制作生成SiteMap.xml的目录,后面不要带"/",大小写敏感
  23. filename="../sitemap.xml"

  24. set objfso = CreateObject("Scripting.FileSystemObject")
  25. rootfile = Server.MapPath(filename)
  26. 'response.End
  27. '创建文件
  28. objfso.createtextfile(rootfile)
  29. response.write "<p><strong style='font-family:arial,sans-serif;font-size=12'>创建SiteMap.xml成功!</strong><I style='font-family:arial,sans-serif;font-size=12'> "&rootfile&" </I></p>"

  30. response.write "<p><strong style='font-family:arial,sans-serif;font-size=12'>对不起了兄弟们,懒得做提交页面,已经开始索引了,正在索引文件,请稍侯吧,如果电影数量较多,时间会稍微长一些,可以修改make_ggmap.asp文件中的num变量,将生成的电影数量减少!...</strong></p>"
  31. Set openfileobj=objfso.opentextfile(rootfile,8)
  32. openfileobj.writeline"<?xml version='1.0' encoding='UTF-8'?>"
  33. openfileobj.writeline"<urlset xmlns='http://www.google.com/schemas/sitemap/0.84'>"
  34. openfileobj.writeline"<url>"
  35. openfileobj.writeline"<loc>"&SiteURL&"index.html</loc>"
  36. openfileobj.writeline"<lastmod>"&ISO8601(DateAdd("h",-1,Now))&"</lastmod>"
  37. openfileobj.writeline"<changefreq>always</changefreq>"
  38. openfileobj.writeline"<priority>1.0</priority>"
  39. openfileobj.writeline"</url>"
  40. response.write "<p><strong style='font-family:arial,sans-serif;font-size=12'>首页索引完毕,开始索引分类页面</strong></p>"
  41. Dim zt_typeRows,zt_typeSql,zt_dataRows,zt_dataSql,topSql
  42. zt_typeSql="select zt_typeid,zt_en from zt_type order by zt_n asc"
  43. If num=0 Then
  44. topSql=""
  45. Else
  46. topSql=" top "&num&""
  47. End If
  48. zt_dataSql="select"&topSql&" zt_id,zt_date,zt_type from zt_data order by zt_date desc"

  49. Dim RS
  50. Set RS=Conn.ExeCute(zt_typeSql)
  51. if RS.EOF then
  52.   ReDim zt_typeRows(0,0)
  53. Else
  54.   zt_typeRows=RS.getrows()
  55. End If
  56. Set RS=Conn.ExeCute(zt_dataSql)
  57. if RS.EOF then
  58.   ReDim zt_dataRows(0,0)
  59. Else
  60.   zt_dataRows=RS.getrows()
  61. End If
  62. RS.close : Set RS=Nothing

  63. If UBound(zt_typeRows,1)>0 then
  64.   Dim iPrior,dtNow
  65.   dtNow = Now
  66.     For i=0 to UBound(zt_typeRows,2)
  67.       openfileobj.writeline"  <url>"
  68.       openfileobj.writeline"    <loc>"
  69.       openfileobj.writeline SiteURL&zt_typeRows(1,i)&"/index.html"
  70.       openfileobj.writeline "</loc>"
  71.       openfileobj.writeline "    <lastmod>"
  72.       openfileobj.writeline ISO8601(DateAdd("h",-1,Now))
  73.       openfileobj.writeline "</lastmod>"
  74.       openfileobj.writeline "    <changefreq>"
  75.       openfileobj.writeline "always"      
  76.       openfileobj.writeline "</changefreq>"
  77.       openfileobj.writeline "    <priority>"
  78.       openfileobj.writeline "0.9"
  79.       openfileobj.writeline "</priority>"
  80.       openfileobj.writeline "  </url>"
  81.     Next
  82. End If
  83. response.write "<p><strong style='font-family:arial,sans-serif;font-size=12'>分类页面索引完毕,共<span style=color:#FF0000> "&i&" </span>个分类页面被索引,开始索引详细电影页面啦...</strong></p>"

  84. If UBound(zt_dataRows,1)>0 then
  85.   dtNow = Now
  86.     For j=0 to UBound(zt_dataRows,2)
  87.       iPrior = "0.5"
  88.       openfileobj.writeline"  <url>"
  89.       openfileobj.writeline"    <loc>"
  90.       openfileobj.writeline SiteURL&get_classenname(zt_dataRows(2,j))&"/"&zt_dataRows(0,j)&"/index.html"
  91.       openfileobj.writeline "</loc>"
  92.       openfileobj.writeline "    <lastmod>"
  93.       openfileobj.writeline ISO8601(zt_dataRows(1,j))
  94.       openfileobj.writeline "</lastmod>"
  95.       openfileobj.writeline "    <changefreq>"
  96.       If DateDiff("h", zt_dataRows(1,j), dtNow) < 24 Then
  97.         openfileobj.writeline "hourly"
  98.         iPrior = "0.8"
  99.       ElseIf DateDiff("d", zt_dataRows(1,j), dtNow) < 7 Then
  100.         openfileobj.writeline "dayly"
  101.         iPrior = "0.7"
  102.       ElseIf DateDiff("ww", zt_dataRows(1,j), dtNow) < 4 Then
  103.         openfileobj.writeline "weekly"
  104.         iPrior = "0.6"
  105.       ElseIf DateDiff("m", zt_dataRows(1,j), dtNow) < 12 Then
  106.         openfileobj.writeline "monthly"
  107.         iPrior = "0.4"
  108.       Else
  109.         openfileobj.writeline "yearly"  
  110.         iPrior = "0.3"
  111.       End If
  112.       openfileobj.writeline "</changefreq>"
  113.       If iPrior <> "0.5" Then
  114.         openfileobj.writeline "    <priority>"
  115.         openfileobj.writeline iPrior
  116.         openfileobj.writeline "</priority>"
  117.       End If
  118.       openfileobj.writeline "  </url>"
  119.     Next
  120. End If

  121. response.write "<p><strong style='font-family:arial,sans-serif;font-size=12'>电影页面索引完毕,共<span style=color:#FF0000> "&j&" </span>个电影页面被索引...</strong></p>"

  122. Function ISO8601(DateTime)  
  123.         Dim DateMonth,DateDay,DateHour,DateMinute,DateWeek,DateSecond

  124.         DateMonth=Month(DateTime)
  125.         DateDay=Day(DateTime)
  126.         DateHour=Hour(DateTime)
  127.         DateMinute=Minute(DateTime)
  128.         DateWeek=weekday(DateTime)
  129.         DateSecond=Second(DateTime)
  130.         If Len(DateMonth)<2 Then DateMonth="0"&DateMonth
  131.         If Len(DateDay)<2 Then DateDay="0"&DateDay
  132.         If Len(DateMinute)<2 Then DateMinute="0"&DateMinute
  133.         If Len(DateHour)<2 Then DateHour="0"&DateHour       
  134.         If Len(DateSecond)<2 Then DateSecond="0"&DateSecond
  135.         ISO8601=Year(DateTime)&"-"&DateMonth&"-"&DateDay&"T"&DateHour&":"&DateMinute&":"&DateSecond&"+08:00"
  136. End Function

  137. openfileobj.writeline "</urlset>"
  138. response.write "<p><strong style='font-family:arial,sans-serif;font-size=12'>恭喜啊~~~SiteMap.xml彻底生成完毕了,共<span style=color:#FF0000> "&i+j+1&" </span>个文件被索引</strong></p>"
  139. set fso = nothing
  140. %>
复制代码
就去创业http://97cy.net/
网罗长寿http://wncs.cn/
94网络http://9411xp.cn/
不错
那Make.asp呢? 跑掉了?
好像不完整,看我的演示:
http://www.nizui.com/SiteMap.xml
楼上的脚不错
不错不错。
记号
好人啊
早该弄一个了
3Q
返回列表