用户名 密码 [R] 注册 [F] 忘记密码
设为首页 加入收藏 关于我们

KingCMS后台评论模块中可以直接点击进入被评论文章的修改方法

[ 字号: ] [ 关闭 ] 2008-2-15 19:56:09 来自网络 作者:admin 浏览次数: 发表评论

关键词:KingCMS 评论后台 连接地址 指向评论模块 直接点击进入被评论文章的修改方法

点修改方法从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

保存,覆盖源文件即可!刚刚测试可行,有兴趣的朋友可以试试

 



上一页:king CMS5.0.1.0202广告标签"js"方式调用出现Bad Request问题解决方法
下一页:KingCMS 5.0.1.0202版本sitemap修改方法

评论

发表评论
[ 字号大小: ] [ 加入收藏 ] [ 打印 ] [ 关闭 ]

关于本站 | 网站导航 | 加入收藏 | 联系方式 | 联系站长 | 友情链接 | 免责条款 |

版权所有© 2005-2008 计算机与畜牧业   备案/许可证号:鲁ICP备05043203号