评论模块中可以直接点击进入被评论文章的修改方法
点修改方法从freehzw的网站中扒来的,个人认为比较实用,所以发布出来大家共享
先打开:admin/comment/index.asp文件,找到如下代码:
sub king_list()
king.head king.path,kc.lang("title")
dim rs,data,i,dp'lpath:linkpath
dim but,sql,p,v,insql,kid,ip,uname
p=quest("p",0)
v=quest("v",2)
kid=quest("kid",2)
ip=quest("ip",0)
if king.instre(kc.plugin,p)=false then king.error king.lang("error/invalid")
select case cstr(v)
case"0",""
if king_dbtype=0 then'ACCESS
insql="now()-kdate<1"
else
insql="getdate()-kdate<1"
end if
case"1"
if king_dbtype=0 then'ACCESS
insql="now()-kdate<3"
else
insql="getdate()-kdate<3"
end if
case"2"
insql="kisview=0"
case"3"
insql="kisview=1"
end select
if validate(ip,12) then insql="kuserip='"&safe(ip)&"'"
if len(kid)>0 then insql="kid="&kid
sql="select cmid,kcontent,kusername,kuserip,kgood,kbad,kdate,kid from king__"&safe(p)&"_comment where "&insql&" order by cmid desc;"
kc.list
set dp=new record
dp.purl="index.asp?pid=$&rn="&dp.rn&"&action=list&p="&p&"&v="&v&"&kid="&kid&"&ip="&ip
dp.value="p="&p
dp.create sql
dp.but=dp.sect("create:"&encode(king.lang("common/create"))&"|-|view1:"&encode(kc.lang("common/v1"))&"|view0:"&encode(kc.lang("common/v0")))&dp.prn & dp.plist
dp.js="cklist(K[0])+'[<a href=""index.asp?action=list&p="&p&"&v="&v&"&kid='+K[7]+'"">"&p&"ID:'+K[7]+'</a>] <strong>'+K[2]+'</strong> <a href=""index.asp?action=list&p="&p&"&ip='+K[3]+'"">'+K[3]+'</a><a href=""http://www.kingcms.cn/ip.asp?ip='+K[3]+'"" target=""_blank"">["&kc.lang("common/soip")&"]</a> "&kc.lang("common/good")&"('+K[4]+') "&kc.lang("common/bad")&"('+K[5]+') @ '+K[6]+'<blockquote>'+K[1]+'</blockquote>'"
Il dp.open
Il "<tr><th>"&kc.lang("list/name")&"</th></tr>"
Il "<script>"
for i=0 to dp.length
if len(dp.data(2,i))>0 then uname=dp.data(2,i) else uname=kc.lang("common/guest")
Il "ll("&dp.data(0,i)&",'"&htm2js(king.ubbencode(dp.data(1,i)))&"','"&htm2js(uname)&"','"&htm2js(dp.data(3,i))&"',"&dp.data(4,i)&","&dp.data(5,i)&",'"&htm2js(dp.data(6,i))&"',"&dp.data(7,i)&");"
next
Il "</script>"
Il dp.close
set dp=nothing
end sub
修改为:
sub king_list()
king.head king.path,kc.lang("title")
dim rs,data,i,dp'lpath:linkpath
dim but,sql,p,v,insql,kid,ip,uname,rs_artpath,rs_listpath
p=quest("p",0)
v=quest("v",2)
kid=quest("kid",2)
ip=quest("ip",0)
if king.instre(kc.plugin,p)=false then king.error king.lang("error/invalid")
select case cstr(v)
case"0",""
if king_dbtype=0 then'ACCESS
insql="now()-kdate<1"
else
insql="getdate()-kdate<1"
end if
case"1"
if king_dbtype=0 then'ACCESS
insql="now()-kdate<3"
else
insql="getdate()-kdate<3"
end if
case"2"
insql="kisview=0"
case"3"
insql="kisview=1"
end select
if validate(ip,12) then insql="kuserip='"&safe(ip)&"'"
if len(kid)>0 then insql="kid="&kid
sql="select cmid,kcontent,kusername,kuserip,kgood,kbad,kdate,kid from king__"&safe(p)&"_comment where "&insql&" order by cmid desc;"
kc.list
set dp=new record
dp.purl="index.asp?pid=$&rn="&dp.rn&"&action=list&p="&p&"&v="&v&"&kid="&kid&"&ip="&ip
dp.value="p="&p
dp.create sql
dp.but=dp.sect("create:"&encode(king.lang("common/create"))&"|-|view1:"&encode(kc.lang("common/v1"))&"|view0:"&encode(kc.lang("common/v0")))&dp.prn & dp.plist
'add by freehzw
Set rs_artpath=Server.createobject ("Adodb.recordset")
Set rs_listpath=Server.createobject ("Adodb.recordset")
If kid<>"" And v<>"" then
set rs_artpath=conn.execute("select artpath,listid from kingart where artid="&CInt(kid)&";")
set rs_listpath=conn.execute("select listpath from kingart_list where listid="&rs_artpath(1)&";")
dp.js="cklist(K[0])+'[<a target=""_blank"" href=""/"&rs_listpath(0)&"/"&rs_artpath(0)&""" >查看文章</a>] <strong>'+K[2]+'</strong> <a href=""index.asp?action=list&p="&p&"&ip='+K[3]+'"">'+K[3]+'</a><a href=""http://www.kingcms.cn/ip.asp?ip='+K[3]+'"" target=""_blank"">["&kc.lang("common/soip")&"]</a> "&kc.lang("common/good")&"('+K[4]+') "&kc.lang("common/bad")&"('+K[5]+') @ '+K[6]+'<blockquote>'+K[1]+'</blockquote>'"
rs_artpath.close
rs_listpath.close
Set rs_listpath=Nothing
Set rs_artpath=Nothing
Else
dp.js="cklist(K[0])+'[<a href=""index.asp?action=list&p="&p&"&v="&v&"&kid='+K[7]+'"">"&p&"ID:'+K[7]+'</a>] <strong>'+K[2]+'</strong> <a href=""index.asp?action=list&p="&p&"&ip='+K[3]+'"">'+K[3]+'</a><a href=""http://www.kingcms.cn/ip.asp?ip='+K[3]+'"" target=""_blank"">["&kc.lang("common/soip")&"]</a> "&kc.lang("common/good")&"('+K[4]+') "&kc.lang("common/bad")&"('+K[5]+') @ '+K[6]+'<blockquote>'+K[1]+'</blockquote>'"
End If
Il dp.open
Il "<tr><th>"&kc.lang("list/name")&"</th></tr>"
Il "<script>"
for i=0 to dp.length
if len(dp.data(2,i))>0 then uname=dp.data(2,i) else uname=kc.lang("common/guest")
Il "ll("&dp.data(0,i)&",'"&htm2js(king.ubbencode(dp.data(1,i)))&"','"&htm2js(uname)&"','"&htm2js(dp.data(3,i))&"',"&dp.data(4,i)&","&dp.data(5,i)&",'"&htm2js(dp.data(6,i))&"',"&dp.data(7,i)&");"
next
Il "</script>"
Il dp.close
set dp=nothing
end sub
保存,覆盖源文件即可!
kingCMS 上传缩略图指定目录的方法
在文章模块—发表文章时候,需要上传缩略图默认指定 up_files 文件夹内,如果你的缩略图放在更细的分文件夹内,那么每次上传都要一层一层的进入目标文件夹,其实只要修改下上传目录就可以解决重复动作的问题。
具体方法:
打开:page/system/config.asp 文件,
修改:
'上传目录
const king_upath = "up_files"
比如: const king_upath = "up_files/image/Article/2008"
这样以后上传缩略图的时候,点击浏览,跳转的目录就是 up_files/image/Article/2008 内了!
KingCMS 5.0.1.0202版本sitemap修改方法
KingCMS 5.0系列版本生成sitemap一直存在错误.现在最新版的KingCMS 5.0.1.0202也出来了,但生成的sitemap还是存在错误,用原程序生成的sitemap提交到GOOGLE管理员工具后,会出现警告,说是时间不正确.原因在于,生成的sitemap的时间格式不正确.
sitemap中正确的时间应该是这样的
年:YYYY(2005)
年和月:YYYY-MM(2005-06)
年月日:YYYY-MM-DD(2005-06-04)
年月日小时分钟:YYYY-MM-DDThh:mmTZD(2005-06-04T10:37+08:00)
年月日小时分钟秒:YYYY-MM-DDThh:mmTZD(2005-06-04T10:37:30+08:00)
这里需注意的是TZD,TZD指定就是本地时间区域标记,像中国就是+08:00了
您可以浏览一下这篇文章来了解一下Google SiteMap的格式:Google SiteMap的协议格式详细解析
原因找到了,解决方法如下:
修改/page/article/fun.asp的第375行
''outmap=outmap&"<lastmod>"&formatdate(data(0,i),1)&"</lastmod>"
改为
'2008-2-13改
outmap=outmap&"<lastmod>"&formatdate(data(0,i),"yyyy-MM-dd")&"</lastmod>"
好了,把修改后的文件传到服务器上,重新生成地图文件,提交
kingCMS文章模块,分页功能默认打勾方法
打开\admin\Article下的 index.asp文件
修改两个地方:
第一个:修改分页字数,默认是2000,查找代码654行:pagelistnumber=2000
修改成你想要的参数: pagelistnumber=300
第二个:修改自动分行默认打勾选:在代码796行
if cstr(form("pagelist"))="1" then checked=" checked=""checked""" else checked=""
修改成:
if cstr(form("pagelist"))="1" or cstr(form("pagelist"))="" then checked=" checked=""checked""" else checked=""
KingCMS乱码解决方案
打开page\system\conn.asp
在顶部加上如下代码,不再会有乱码烦恼!
<%
Session.CodePage=65001
Response.Charset = "utf-8"
%>