如何落伍 | 落伍帐号规则 | 站长俱乐部 | 落伍代码下载 | 落伍预告页 | 现金任务 | 人才招聘 | 落伍DIY | 站长工具
北京VPS 香港VPS ­­— 紫田网络千次搜索税后周付11元,比百度赚钱!做广告赚钱,还得找XIOO联盟强氧服务器落伍硬件专卖全面升级
"壹支付"秒清算,提现立刻到卡! 中客:新春新年新气象,跃马奔腾迎新年!九九数据 20人合租 399元 赠CDN加速韩国高速主机 合租 服务器 月付!
恋爱塔罗/虎年运势, 挚盟新品火爆上线discuz!旗下联盟,加入就送10元65视讯cps40%分成/效果佳!3A网络 为合法网站护航 2G仅188元/年
广东浙江电信SAS百独1400/月网通9折韩国资源招租 韩国VPSCPC点击100元千IP不限量周结十强ISP服务商,COM 36,主机稳定之选
网通100M独享1200/月,另代理企业QQ英拓网络Q8200租用3999送产权高速多线合租空间 可试用 可月付 稳定!香港虚拟主机 1G只要99元
返回列表 发帖

[代码发布] [落伍首发]马克斯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/

TOP

那Make.asp呢? 跑掉了?

TOP

好像不完整,看我的演示:
http://www.nizui.com/SiteMap.xml

TOP

楼上的脚不错

TOP

不错不错。

TOP

好人啊
早该弄一个了

TOP

好东西

TOP

做个记号,谢楼主

TOP

1.0有没?
魔兽地图吧wowba.net
http://www.jingmen.info

TOP

返回列表