K9 通用版 博客版 主题版 地方门户版 企业版 |   企业(ASP) 分类 使用 分享 疑问 模板 建议 帮助 错误 其他
+新建主题 [Ajax]
填写帐号密码即可完成注册
+新建话题 最新回复排序 最新主题排序 精华帖子

福州seo使用kingcms心得:分页导航的修改

1Next >

jujutang 发表于:11-08-12 09:21 编辑于:08-23 12:35 [添加收藏] 楼主 [回复] #Top#
jujutang 人气:53 积分:27 金币:496


使用kingcms心得:分页导航的修改
一、Kingcms评论分页导航修改

打开KingCMS5.1pagecommentfun.asp,将function kpagelist(l1,l2,l3,l5)函数修改为

function kpagelist(l1,l2,l3,l5)
    if instr(l1,"$")=0 then exit function
    if l5=0 then exit function
    if l3=1 then exit function
    dim l4,k,m,n
    l2=int(l2):l3=int(l3):l5=int(l5)
    if l2>2 then
        l4=l4&("<a href="""&replace(l1,"$",(l2-1)&"."&split(king_ext,".")(1))&""">上一页</a>")
    elseif l2=2 then
        l4=l4&("<a href="""&replace(l1,"$",king_ext)&""">上一页</a>")
    end if
    if l2>8 then
        l4=l4&("<a href="""&replace(l1,"$",king_ext)&""">1</a>")'
    end if
    if l2 Mod 8 then
        k=l2 Mod 8
    else
        k=8
    end if
    m=l2-k
    n=9-k+l2
    if m=0 then m=1
    if n>l3 then n=l3
    for k=m to n
        if cstr(k)=cstr(l2) then
            l4=l4&("<strong>"&k&"</strong>")
        else
            if k=1 then
                l4=l4&("<a href="""&replace(l1,"$",king_ext)&""">"&k&"</a>")
            elseif k=m and m>1 then
                l4=l4&("<a href="""&replace(l1,"$",k&"."&split(king_ext,".")(1))&""">.."&k&"</a>")
            elseif k=n and n<l3 then
                l4=l4&("<a href="""&replace(l1,"$",k&"."&split(king_ext,".")(1))&""">"&k&"..</a>")
            else
                l4=l4&("<a href="""&replace(l1,"$",k&"."&split(king_ext,".")(1))&""">"&k&"</a>")
            end if
        end if
    next
    if n<l3 then
        l4=l4&("<a href="""&replace(l1,"$",l3&"."&split(king_ext,".")(1))&""">"&l3&"</a>")
    end if
    if l2<l3 then
        l4=l4&("<a href="""&replace(l1,"$",(l2+1)&"."&split(king_ext,".")(1))&""">下一页</a>")
        k=l2+1
    else
        k=1
    end if
    'l4=l4&"<input type=""text"" id=""goPage"" value="""&k&"""/>"
    kpagelist="<span class=""k_pagelist"">"&l4&"</span>"
end function

对应的css样式为

.k_pagelist { 
    display:block;
    margin-top:5px;
}
.k_pagelist *{
    font-size:12px;
    padding:2px 5px;
    margin-right:3px;
    vertical-align:middle;
}
.k_pagelist strong{
    background:#3366CC;
    color:#FFF;
    border:1px solid #DBDBDB;
}
.k_pagelist a {
    text-decoration:none;
    color:#3875D7;
    border:1px solid #DBDBDB;
}
.k_pagelist a:hover {
    text-decoration:none;
    background:#3875D7;
    color:#FFF;
}

二、Kingcms文章分页导航修改

打开KingCMS5.1pageArticlefun.asp,将public function pageslist(l1,l2,l3,l4,l5)函数修改为

public function pageslist(l1,l2,l3,l4,l5)'url,当前,总页,artgrade,artid
    if l3=0 then exit function
    dim i,I1,m,n
    l2=int(l2):l3=int(l3)
    if l2>1 then
        I1=I1&("<a href="""&pagepath(l1,l2-1)&""">上一页</a>")
    elseif l2=1 then
        I1=I1&("<a href="""&l1&""">上一页</a>")
    end if
    if l2>7 then
        I1=I1&("<a href="""&l1&""">1</a>")'
    end if
    if (l2+1) Mod 8 then
        i=(l2+1) Mod 8
    else
        i=8
    end if
    m=l2-i
    n=9-i+l2
    if m<0 then m=0
    if n>l3 then n=l3
    for i=m to n
        if cstr(i)=cstr(l2) then
            I1=I1&("<strong>"&i+1&"</strong>")
        else
            if i=0 then
                I1=I1&("<a href="""&l1&""">1</a>")
            elseif i=m and m>0 then
                I1=I1&("<a href="""&pagepath(l1,i)&""">.."&i+1&"</a>")
            elseif i=n and n<l3 then
                I1=I1&("<a href="""&pagepath(l1,i)&""">"&i+1&"..</a>")
            else
                I1=I1&("<a href="""&pagepath(l1,i)&""">"&i+1&"</a>")
            end if
        end if
    next
    if n<l3 then
        I1=I1&("<a href="""&pagepath(l1,l3)&""">"&l3+1&"</a>")
    end if
    if l2<l3 then
        I1=I1&("<a href="""&pagepath(l1,l2+1)&""">下一页</a>")
        i=l2+2
    else
        i=1
    end if
    I1=I1&("<input id=""goPage"" type=""text"" value="""&i&"""/>")
    I1=I1&("<a href=""javascript:pager.Jump();"">GO</a><script type=""text/javascript"" src=""/page/system/inc/pager.js""></script><script type=""text/javascript"">var pager=new iwmsPager("&l2+1&","&l3+1&");</script>")
    pageslist="<span class=""k_pagelist1"">"&I1&"</span><script type=""text/javascript"">iwms.imgCont=$('contentBody');iwms.imgResize();</script>"
end function

zongxiao08 发表于:11-08-16 18:43 沙发 [回复] #Top#
zongxiao08 人气:145 积分:1044 金币:3553
不错的东西啊
iitding 发表于:11-08-17 14:08 板凳 [回复] #Top#
iitding 人气:582 积分:1 金币:18324
最佳新人 灌水狂人
汗了··还以为是列表分页导航,搞半天是评论·······
子壹 发表于:11-08-22 09:19 4楼 [回复] #Top#
子壹 人气:20 积分:105 金币:230
汗了。。。。。。

1Next >

发表回复

帐号 匿名发布 审核后可见 [加载完整在线编辑器]
内容
验证码
KingCMS 内容管理系统

关于我们 联系我们 广告报价 付款方式 站点导航

Copyright © 2004-2015 Focuznet All rights reserved.

广州唯众网络科技有限公司 粤ICP备08008106号

中奖了!