kingcms默认是文章路径是:文章标题/index.htm,一篇文章对应一个文件夹,不利于seo和网站管理,如果想修改成百度空间的文章路径:Item/文章标题.html,修改方法如下:

修改网页扩展名为html

打开KingCMS5.1\page\system\config.asp

将const king_ext = "index.htm"

修改为const king_ext = "index.html"

修改文章生成路径

打开KingCMS5.1\page\Article\fun.asp,将public sub createpage(l1)函数中的

artpath=pagepath("http://www.cnblogs.com/"&datalist(1,0)&"/"&data(9,i),j)

替换为artpath=pagepath("http://www.cnblogs.com/"&"Item/"&data(9,i)&"."&split(king_ext,".")(1),j)

将if king.isfile(data(9,i))=false then artpath=artpath&king_ext这句用单引号注释掉

‘if king.isfile(data(9,i))=false then artpath=artpath&king_ext

修改首页文章超链接

经过以上修改虽然文章生成路径变了,但首页的文章链接还是系统默认的生成路径,打开KingCMS5.1\page\Article\fun.asp,将function king_tag_article(tag,invalue)函数中的

king.value "path",encode(t_art.getpath(data(0,i),data(10,i),king.inst&datalist(1,0)&"/"&data(8,i)))

修改为king.value "path",encode(t_art.getpath(data(0,i),data(10,i),king.inst&"Item/"&data(8,i)&"."&split(king_ext,".")(1)))

修改文章分页生成路径

打开KingCMS5.1\page\Article\fun.asp,将public function pagepath(l1,l2)函数中的

pagepath=I2(1)&"/"&l2&I2(0)

修改为pagepath=I2(1)&"_"&l2+1&I2(0)

修改文章分页导航链接

修改文章分页生成路径后,分页导航链接还是默认的生成路径,打开KingCMS5.1\page\Article\fun.asp,将public sub createpage(l1)函数中的

king.value "pagelist",encode(pageslist(king.inst&datalist(1,0)&"/"&data(9,i),j,ubound(contents),data(12,i),data(0,i)))

修改为king.value "pagelist",encode(pageslist(king.inst&"Item/"&data(9,i)&"."&split(king_ext,".")(1),j,ubound(contents),data(12,i),data(0,i)))

修改文章页“上一页”标签链接

打开KingCMS5.1\page\Article\fun.asp,将public sub createpage(l1)函数中的

king.value "nextpage",encode(nextpage(data(0,i),data(11,i),data(1,i),datalist(1,0),tmphtm))

修改为king.value "nextpage",encode(nextpage(data(0,i),data(11,i),data(1,i),datalist(1,0),tmphtm,datalist(0,0)))

将private function nextpage(l1,l2,l3,l4,l5)函数修改为private function nextpage(l1,l2,l3,l4,l5,l6),同时将本函数中的

I1="<a href="""&getpath(rs(3),rs(1),king.inst&l4&"/"&rs(2))&""">"&htmlencode(rs(0))&"</a>"

修改为I1="<a href="""&getpath(rs(3),rs(1),king.inst&"Item/"&rs(2)&"."&split(king_ext,".")(1))&""">"&htmlencode(rs(0))&"</a><span class=""date"">("&formatdate(rs(4),"yyyy-MM-dd")&"</span>"

将I1="<script type=""text/javascript"">posthtm('"&king.page&"article/page.asp?action=nextpage','k_nextpage','artid="&l1&"');</script>"

修改为I1="<a href="""&king.inst&l4&"/"">["&htmlencode(l6)&"]</a>"

将nextpage="<span id=""k_nextpage"">"&I1&"</span>"

修改为nextpage=I1

修改文章页“下一页”标签链接

打开KingCMS5.1\page\Article\fun.asp,将private function lastpage(l1,l2,l3,l4,l5,l6)函数中的

I1="<a href="""&getpath(rs(3),rs(1),king.inst&l4&"/"&rs(2))&""">"&htmlencode(rs(0))&"</a>"

修改为I1="<a href="""&getpath(rs(3),rs(1),king.inst&"Item/"&rs(2)&"."&split(king_ext,".")(1))&""">"&htmlencode(rs(0))&"</a><span class=""date"">("&formatdate(rs(4),"yyyy-MM-dd")&"</span>"

将lastpage="<span id=""k_lastpage"">"&I1&"</span>"

修改为lastpage=I1

交换文章页“上一页”、“下一页”标签

可能是和开发者的理解不同,“上一页”应该是比当前文章发布时间迟一点的那篇文章,“下一页”应该是比当前文章发布时间早一点的那篇文章,而在kingcms中恰恰相反。打开KingCMS5.1\template\inside\article[page]\default.htm,将{king:lastpage/}和{king:nextpage/}互换即可。

修改列表页的文章链接

打开KingCMS5.1\page\Article\fun.asp,将public sub createlist1(l1,l2)函数中的

king.value "path",encode(getpath(dp.data(0,i),dp.data(10,i),king.inst&listpath&"/"&dp.data(8,i)))

修改为king.value "path",encode(getpath(dp.data(0,i),dp.data(10,i),king.inst&"Item/"&dp.data(8,i)&"."&split(king_ext,".")(1)))

修改列表页分页生成路径

打开KingCMS5.1\page\Article\fun.asp,将public sub createlist1(l1,l2)函数中的

king.savetofile "http://www.cnblogs.com/"&datalist(2,0)&"/"&pid&"/"&king_ext,outhtm

修改为king.savetofile "http://www.cnblogs.com/"&datalist(2,0)&"/"&pid&"."&split(king_ext,".")(1),outhtm

修改列表页导航链接

打开KingCMS5.1\page\system\fun.asp,将function pagelist(l1,l2,l3,l5)函数中的

l4=l4&("<a href="""&replace(l1,"$",l2-1)&""">&lsaquo;&lsaquo;</a>")

修改为l4=l4&("<a href="""&replace(l1,"$/",l2-1)&"."&split(king_ext,".")(1)&""">上一页</a>")

将l4=l4&("<a href="""&replace(l1,"$","")&""">&lsaquo;&lsaquo;</a>")

修改为l4=l4&("<a href="""&replace(l1,"$/","")&""">上一页</a>")

将l4=l4&("<a href="""&replace(l1,"$",k)&""">"&k&"</a>")

修改为l4=l4&("<a href="""&replace(l1,"$/",k)&"."&split(king_ext,".")(1)&""">"&k&"</a>")

将l4=l4&("<a href="""&replace(l1,"$",l2+1)&""">&rsaquo;&rsaquo;</a>")

修改为l4=l4&("<a href="""&replace(l1,"$/",l2+1)&"."&split(king_ext,".")(1)&""">下一页</a>")

将l4=l4&("<a href="""&replace(l1,"$",l3)&""">... "&l3&"</a>")

修改为l4=l4&("<a href="""&replace(l1,"$/",l3)&"."&split(king_ext,".")(1)&""">.."&l3&"</a>")

修改文章评论

打开KingCMS5.1\page\comment\language\zh-cn.xml,将<guest>Guest</guest>修改为<guest>匿名用户</guest>

打开KingCMS5.1\page\comment\fun.asp,将public sub create(l1)中的

king.value "username",encode(kc.lang("common/guest"))

修改为king.value "username","<span class=""from"">"&encode(kc.lang("common/guest"))&"</span> <span class=""ip"">ip:"&encode(htmlencode(data(3,i)))&"</span>"

将king.value "quote",encode("<a href=""#k_comment_post""

修改为king.value "quote",encode("&nbsp;<a href=""javascript:;""

进入后台,模块管理->评论管理->评论参数,将“循环体模板”修改为:

{king:comment number="2"}
  <div><span class="postTime">(king:date mode="yyyy-MM-dd hh:mm:ss"/) 发表
</span><strong>(king:floor/)</strong>(king:username/)</div>
  <p>(king:content/)</p>
  <ul class="operations"><li>(king:good/)</li><li>(king:bad/)</li><li>(king:quote/)</li></ul>
  <div class="line"></div>
{/king}

打开KingCMS5.1\template\images\style.css,将/* 评论 */部分的CSS修改为:

/* 评论 */
#k_comment{text-align:left;}
#k_comment div{display:block;clear:both;}
#k_comment .from{color: #1e50a2;}
#k_comment .ip{color: #666;}
#k_comment .postTime { color: #666; float:right;}
#k_comment .operations {color: #1e50a2; float: right; list-style-type: none;}
#k_comment .operations li { float: left; padding-left: 1.2em;}
#k_comment div.line{margin:8px 0;border-top:1px dashed #A6A6A6;}
#k_comment div strong {margin-right:15px; color: #666;}
#k_comment p{line-height:22px;margin:5px 0;}
#k_comment .k_pagelist{clear:both;display:block;}
#k_comment_post{display:block;clear:both;text-align:left;font-size:14px;}

修改文章评论分页生成路径

打开KingCMS5.1\page\comment\fun.asp,将public sub create(l1)中的

plist=kpagelist("javascript:;"" οnclick=""gethtm('"&king.inst&r_path&"/"&I2(0)&"/"&I2(1)&"/$"&"','k_comment')",pid+1,pidcount,length+1)

修改为plist=kpagelist("javascript:;"" οnclick=""gethtm('"&king.inst&r_path&"/"&I2(0)&"_"&I2(1)&"_$"&"','k_comment')",pid+1,pidcount,length+1)

将king.savetofile "http://www.cnblogs.com/"&r_path&"/"&I2(0)&"/"&I2(1)&"/"&king_ext,plist&tmplist&plist

修改为king.savetofile "http://www.cnblogs.com/"&r_path&"/"&I2(0)&"_"&I2(1)&"_"&king_ext,plist&tmplist&plist

将king.savetofile "http://www.cnblogs.com/"&r_path&"/"&I2(0)&"/"&I2(1)&"/"&(pid+1)&"/"&king_ext,plist&tmplist&plist

修改为king.savetofile "http://www.cnblogs.com/"&r_path&"/"&I2(0)&"_"&I2(1)&"_"&(pid+1)&"."&split(king_ext,".")(1),plist&tmplist&plist

将king.savetofile "http://www.cnblogs.com/"&r_path&"/"&I2(0)&"/"&I2(1)&"/"&king_ext,"<p>"&lang("common/notcomment")&"</p>"

修改为king.savetofile "http://www.cnblogs.com/"&r_path&"/"&I2(0)&"_"&I2(1)&"_"&king_ext,"<p>"&lang("common/notcomment")&"</p>"

将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
    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>")'
        l4=("<a href="""&replace(l1,"$",king_ext)&""">1 ...</a>")'
    end if
    if l2>2 then
        'l4=l4&("<a href="""&replace(l1,"$",l2-1)&""">&lsaquo;&lsaquo;</a>")
        l4=l4&("<a href="""&replace(l1,"$",(l2-1)&"."&split(king_ext,".")(1))&""">&lsaquo;&lsaquo;</a>")
    elseif l2=2 then
        'l4=l4&("<a href="""&replace(l1,"$","")&""">&lsaquo;&lsaquo;</a>")
        l4=l4&("<a href="""&replace(l1,"$",king_ext)&""">&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>")
                    l4=l4&("<a href="""&replace(l1,"$",king_ext)&""">"&k&"</a>")
                else
                    'l4=l4&("<a href="""&replace(l1,"$",k)&""">"&k&"</a>")
                    l4=l4&("<a href="""&replace(l1,"$",k&"."&split(king_ext,".")(1))&""">"&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>")
        l4=l4&("<a href="""&replace(l1,"$",(l2+1)&"."&split(king_ext,".")(1))&""">&rsaquo;&rsaquo;</a>")
    end if
    if l2<l3-7 then
        'l4=l4&("<a href="""&replace(l1,"$",l3)&""">... "&l3&"</a>")
        l4=l4&("<a href="""&replace(l1,"$",l3&"."&split(king_ext,".")(1))&""">... "&l3&"</a>")
    end if
    I2=split(l1,"$")
    kpagelist="<span class=""k_pagelist"">"&l4&"</span>"
end function

将function king_tag_comment(tag,invalue)函数中的

I3=t_kc.path&"/"&I2(0)&"/"&I2(1)&"/"&king_ext

修改为I3=t_kc.path&"/"&I2(0)&"_"&I2(1)&"_"&king_ext

打开KingCMS5.1\page\comment\index.asp,将sub king_post()函数中的

I1=I1&"<p><a href=""javascript:;"" οnclick=""gethtm('/"&kc.path&"/"&I2(0)&"/"&I2(1)&"/"&king_ext&"','k_comment')"">"&kc.lang("common/raw")&"</a></p>"

修改为I1=I1&"<p><a href=""javascript:;"" οnclick=""gethtm('/"&kc.path&"/"&I2(0)&"_"&I2(1)&"_"&king_ext&"','k_comment')"">"&kc.lang("common/raw")&"</a></p>"

修正心情投票插件mood.js中的错误

$("moodinfo"+j).innerHTML = "<span style=\'color: #555555;padding-left: 20px;font-size:16px;'>您看完此刻的感受是! 已有<font color='#FF0000'>"+moodzs+"</font>人表态:</span>";

修改为$("moodtitle").innerHTML = "<span style=\'color: #555555;padding-left: 20px;font-size:16px;'>您看完此刻的感受是! 已有<font color='#FF0000'>"+moodzs+"</font>人表态:</span>";

由于这个错误,心情投票只有下面的表情图片,而没有上面的统计数据。

修改位置导航标签{king:guide/}的解析代码

默认生成的代码:<a href="/" class="k_guidename">当前位置</a><a href="栏目路径">栏目名称</a> &gt;&gt; 文章标题

修改后:<a href="/">首页</a> &gt;<a href="栏目路径">栏目名称</a> &gt; 正文

修改方法:打开KingCMS5.1\admin\system\plugin.asp,将function lIll(l1,invalue)函数中的

str="<a href=""/"" class=""k_guidename"">"&l2&"</a>"&str

修改为str="<a href=""/"">"&l2&"</a> &gt; "&str

打开KingCMS5.1\page\Article\fun.asp,将public sub createpage(l1)函数中的

king.value "guide",encode(guide(listid)&" &gt;&gt; "&htmlencode(data(2,i)))

修改为king.value "guide",encode(guide(listid)&" &gt; 正文")

(未完待续)

研究这套系统的人,这里给一些参考资料:

1、http://www.7es.cn/kingcms/kingcms.shtml

2、http://www.s-un.cn/search.asp?q=kingcms

转载于:https://www.cnblogs.com/yk25com/archive/2011/12/28/2304336.html

kingcms修改笔记相关推荐

  1. MTK-展讯修改笔记

    MTK-展讯修改笔记 1.安装图形化界面: sudo apt-get install git-core git-gui 2.最高等级各种流类型的默认音量值frameworks\base\media\j ...

  2. Android Dialer,Mms,Contacts源码修改笔记,移动端混合开发经验

    ②在AndroidManifest.xml中修改相应Activity的theme <activity android:name=".HomeActivity" android ...

  3. 嵌入式arm linux 文件系统登入密码的修改笔记

    1.设置登录时需要用户和用户密码,在/etc/inittab文件中添加: ::respawn:/sbin/getty -L ttyPS0 115200 vt100  或  ::respawn:-/bi ...

  4. CoTNet 修改笔记

    CoTNet 依赖cupy 关于cupy的文章: cupy_jacke121的专栏-CSDN博客_cupy 调用测试代码: import torchfrom models import cotnet5 ...

  5. Discuz修改笔记-Discuz代码的使用

    为什么80%的码农都做不了架构师?>>>    效果预览 素材 后台–编辑器设置–Discuz代码 新建 代码 替换内容为 <div class="bm_w" ...

  6. word涂改涂掉图片_一次性学会笔记的技术(6)修改不涂改,让资讯得以追踪

    继续分享一次性学习会笔记的技术系列第六篇文章,本系列文章摘自<經理人月刊.NO.63期.一次學會,筆記的技術>,战隼的学习探索整理,这个系列的文章是我找到各种使用笔记的技巧中最完整.最实用 ...

  7. 3.2.1 配置构建Angular应用——简单的笔记存储应用——展示功能

    本节我们会通过构建一个简单的笔记存储应用(可以载入并修改一组简单的笔记)来学习如何应用Angular的特性.这个应用用到的特性有: 在JSON文件中存储笔记 展示.创建.修改和删除笔记 在笔记中使用M ...

  8. mobile.php discuz,电脑访问discuz手机版【触屏版跳转标准版的修改方法】

    推荐方法: 以前我们介绍过如何通过修改Chrome浏览器运行参数的方法来模拟手机访问网站,但是在Chrome 32和33版本以后增加了更加便捷的方法,在开发者工具中只需要设置一下就能方便的模拟各种手机 ...

  9. Android笔记树

    更新至笔记72 2018-05-07 目录 入门基础 1.1 四大组建 四大组件之Activity 四大组件之Service 四大组件之BroadcastReceive 四大组件之ContentPro ...

最新文章

  1. 「机器学习速成」训练神经网络:反向传播、梯度爆炸消失Dropout
  2. 如何用纯 CSS 创作一只愤怒小鸟中的黑炮
  3. time datetime 模块
  4. (一)docker run 命令参数
  5. 【python】正则表达式匹配多个模式
  6. LeetCode 题 - 67. 二进制求和 python实现
  7. 软件架构自学笔记---架构分析
  8. 家的N次方 经典台词
  9. 超级玛丽地图java_超级玛丽3全关地图
  10. matplotlib调整子图尺寸,消除大图白边框
  11. PC电脑端社交应用设计灵感
  12. Erlang中一些错误或者异常的标识
  13. FJNU 1196 汪老司机(DP or 建图+最短路)
  14. .NET+Oracle 9i时产生的未在本地计算机上注册“OraOLEDB.Oracle.1”提供程序
  15. 打开多个Excel2010文档在同一个窗口中显示问题如何解决
  16. QT中webkit去掉默认的右键菜单
  17. 创建一个 scrapy 爬虫项目
  18. 横陈的岁月,阡陌的红尘,你闯进了我的世界
  19. 阵列卡直通模式和raid模式_详解磁盘阵列RAID原理、种类及性能优缺点
  20. 耶書制造 CHMmaker 2.85版 增加转换HPJ工程到HHP工程的功能。 (转)

热门文章

  1. oracle 关键词大全,Oracle 常见关键词
  2. Java switch和break用法
  3. 确定性随机数发生器测试向量——DRBG-CTR-AES256
  4. bzoj 4765: 普通计算姬
  5. markdown语法总结
  6. 程序员口中的demo是什么意思_怎样让5分钟的曲子不重样播放450天?程序员:用马尔可夫链...
  7. 中国反垄断第三枪,枪枪致命!涉及阿里、京东、百度、滴滴等被国家顶格处罚!...
  8. linux驱动调试--段错误之栈信息分析
  9. 数据库有哪些类型?如何根据应用场景选择?终于有人讲明白了
  10. C#报错“OS加载程序锁内执行托管代码,不要尝试在DllMain或映像初始化函数内运行托管代码”的解决方法。