点修改方法从freehzw的网站中扒来的,个人认为比较实用,所以发布出来大家共享
先打开:admin/comment/index.asp文件,找到如下代码(第121—177行):
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