KingCMS分页链接增加斜杠的修改

CMS与SEO 04-26 阅读:161 评论:0

问题:KingCMS的列表页页码链接处,链接结尾都不是/结尾,会被当作301处理,在Godaddy的服务器也有问题.

先转贴下Ash的处理总结.

---------我是分割线---------------

找了一下,修改page/system/fun.asp,搜索'pagelist,大概在2684行

function pagelist(l1,l2,l3,l5)
 if instr(l1,"$")=0 then exit function
 if l5=0 then exit function
 dim l4,k,l6,l7,I2
 l2=int(l2):l3=int(l3):l5=int(l5)
 if l2>3 then
  l4=("<a href="""&replace(l1,"$","")&""">1 ...</a>")'
 end if
 if l2>2 then
  l4=l4&("<a href="""&replace(l1,"$",l2-1)&""">&lsaquo;&lsaquo;</a>")
 elseif l2=2 then
  l4=l4&("<a href="""&replace(l1,"$","")&"/"">&lsaquo;&lsaquo;</a>")
 end if
 for k=l2-2 to l2+7
  if k>=1 and k<=l3 then
   if cstr(k)=cstr(l2) then
    l4=l4&("<strong>"&k&"</strong>")
   else
    if k=1 then
     l4=l4&("<a href="""&replace(l1,"$","")&""">"&k&"</a>")
    else
     l4=l4&("<a href="""&replace(l1,"$",k)&"/"">"&k&"</a>")
    end if
   end if
  end if
 next
 if l2<l3 and l3<>1 then
  l4=l4&("<a href="""&replace(l1,"$",l2+1)&"/"">&rsaquo;&rsaquo;</a>")
 end if
 if l2<l3-7 then
  l4=l4&("<a href="""&replace(l1,"$",l3)&"/"">... "&l3&"</a>")
 end if

 I2=split(l1,"$")
 pagelist="<span class=""k_pagelist""><em>"&l5&"</em>"&l4&"</span>"
end function

---------我是分割线---------------

我之前也做过一个 KingCMS列表页的修改  的笔记.不过是个半吊子工程.没有Ash的这么详实.

按照Ash的修改,今天又发现了一个新问题.

后台项目列表中 /random/index.asp?action=field&listid=1 这样的页面上的 分页链接也是有问题的.第二页会成为

 /random/index.asp?action=field&pid=2&rn=20&listid=1/ 这样的链接样式. Ash给的方法是在/之前加上一个 & 即可.

找到了加的地方.在 admin/OO_public/code/admin/index.asp 中,第340行,改成 

  dp.purl="index.asp?action=field&pid=$&rn="&dp.rn&"&listid="&listid&"&"

这里修改的是 自定义模块的通用代码,至于文章模板的,当然应该在 admin/article/index.asp中,修改方法基本一致.

 

有不明白的再来问我~~