Chinapromoter Blog

生活, 艺术, 网络, 技术, 工业, 消费, 记录趣味生活的点点滴滴。

« 《明清室内陈设》目录传说中的经济危机来了 »

修正子类别模板调用 - 搜索优化网站 SXWO EC

一、在文件createpage.asp 423行,函数function createtype(id)在处理子类别页面时, 没有取出出正确模板, 导致套用大类别模板。出错。先打开记录rs.open "select id,stypename,foldername,description,templateid from stype where btypeid="&id,conn,1,1, 加入templateid 。

没有修改的源代码如下:

rs.open "select id,stypename,foldername,description from stype where btypeid="&id,conn,1,1
    do while not rs.eof
        stypename=rs("stypename")
        sfoldername=rs("foldername")
        t_tstypename="- "&stypename
        sdescription=htmlcode(rs("description"))
        tpath="../../../"
'没有取出出正确模板
        tcontent1=replace(tcontent,"<@btypepath@>","<@path@>"&productfolder&bfoldername)
        tcontent1=replace(tcontent1,"<@stypepath@>","<@page@>"&productfolder&bfoldername&"/"&sfoldername)
        tcontent1=replace(tcontent1,"<@typelist@>",createbtypetree(0,id))
        tcontent1=replace(tcontent1,"<@menulist@>",createmenu(2))
        tcontent1=replace(tcontent1,"<@btypename@>",btypename)
        tcontent1=replace(tcontent1,"<@stypename@>",stypename)
        tcontent1=replace(tcontent1,"<@tstypename@>",t_tstypename)
        tcontent1=replace(tcontent1,"<@description@>",sdescription)
        rs1.open "select id from products where isvip=false and btypeid="&id&" and stypeid="&rs("id"),conn,1,1
        totalrecord=rs1.recordcount
        rs1.close
        totalpage=chu(totalrecord,productstnum)
        if totalpage=0 then totalpage=1
        ttofile=webpath(session("langid"))&productfolder&bfoldername&"/"&sfoldername
        for i=0 to totalpage-1
           j=i
           if j=0 then j=""
           ttofile1=server.mappath(ttofile&"/index"&j&".htm")
           tcontent2=replace(tcontent1,"<@pagelist@>",gettypeindex(id,rs("id"),bfoldername,sfoldername,i))
           tcontent2=replace(tcontent2,"<@productlist@>",getproduct(id,rs("id"),i*productstnum))
           tcontent2=replace(tcontent2,"<@path@>",tpath)
           call createfile(ttofile1,tcontent2)
        next
        rs.movenext
     loop
     rs.close

修改以后源代码如下:

rs.open "select id,stypename,foldername,description,templateid from stype where btypeid="&id,conn,1,1 ' 加入templateid
    do while not rs.eof
        stypename=rs("stypename")
        sfoldername=rs("foldername")
        t_tstypename="- "&stypename
        sdescription=htmlcode(rs("description"))
        tpath="../../../"
        '产品小类页面取模板文件
        tfromfile=conn.execute("select templatepagename from template where id="&rs("templateid"))(0)
        tfromfile=server.mappath(tsaveurl&tfromfile)  '类别页面模板位置
        tcontent=readfile(tfromfile)

        tcontent1=replace(tcontent,"<@btypepath@>","<@path@>"&productfolder&bfoldername)
        tcontent1=replace(tcontent1,"<@stypepath@>","<@page@>"&productfolder&bfoldername&"/"&sfoldername)
        tcontent1=replace(tcontent1,"<@typelist@>",createbtypetree(0,id))
        tcontent1=replace(tcontent1,"<@menulist@>",createmenu(2))
        tcontent1=replace(tcontent1,"<@btypename@>",btypename)
        tcontent1=replace(tcontent1,"<@stypename@>",stypename)
        tcontent1=replace(tcontent1,"<@tstypename@>",t_tstypename)
        tcontent1=replace(tcontent1,"<@description@>",sdescription)
        rs1.open "select id from products where isvip=false and btypeid="&id&" and stypeid="&rs("id"),conn,1,1
        totalrecord=rs1.recordcount
        rs1.close
        totalpage=chu(totalrecord,productstnum)
        if totalpage=0 then totalpage=1
        ttofile=webpath(session("langid"))&productfolder&bfoldername&"/"&sfoldername
        for i=0 to totalpage-1
           j=i
           if j=0 then j=""
           ttofile1=server.mappath(ttofile&"/index"&j&".htm")
           tcontent2=replace(tcontent1,"<@pagelist@>",gettypeindex(id,rs("id"),bfoldername,sfoldername,i))
           tcontent2=replace(tcontent2,"<@productlist@>",getproduct(id,rs("id"),i*productstnum))
           tcontent2=replace(tcontent2,"<@path@>",tpath)
           call createfile(ttofile1,tcontent2)
        next
        rs.movenext
     loop
     rs.close

二、在文件createpage.asp 534行,VIP会员函数function createviptype(id)在处理子类别页面时, 同样没有取出出正确模板, 导致套用大类别模板。出错。需要同样处理。

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

日历

最新评论及回复

最近发表


Powered By Z-Blog 1.8 Spirit Build 80605

Copyright www.chinapromoter.cn. Some Rights Reserved. 浙ICP备05022498号