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

kingcms 后台文章评论管理添加前台文章链接与标题

1Next >

dujun0618 发表于:12-04-07 09:07 [添加收藏] 楼主 [回复] #Top#
dujun0618 人气:149 积分:7 金币:26656

后台的文章评论管理显示了一些信息,如评论人IP,时间,评论的文章ID,但是只知道文章ID去打开文章页面是不可能的,而后台查看这些信息时,能马上看当前评论的文章是很需要的。如果是没改进前,只能通过文章ID去找文章。现在改进了,可以查看文章的标题与打开文章页。

实现方法:
先看一下改进后的效果

kingcms 后台文章评论管理添加前台文章链接与标题[图1]

查看文章是一个打开当前评论文章的链接,鼠标移上去时会显示文章标题。

后台/comment/index.asp文件 sub king_list()函数 从set dp=new record开始到set dp=nothing红色代码为添加代码

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><a href=""'+K[8]+'"" target=""_blank"" title=""'+K[9]+'""> 查看文章</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")
  
   '根据文章ID来获取文章的地址
     dim tmpsql,tmprs,tmpurl,tmptitle
     tmpsql ="select '/' + kingart_list.listpath + '/' + kingart.artpath as artpath,arttitle from (SELECT kingart.*,kingart_list.* FROM kingart_list INNER JOIN kingart ON kingart_list.listid = kingart.listid where artid=" & dp.data(7,i) & ");"
     set tmprs=conn.execute(tmpsql)
     if not tmprs.eof then
      tmpurl=tmprs("artpath")
      tmptitle=tmprs("arttitle")
     end if
     tmprs.close
     set tmprs=nothing
 
   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)&",'" & tmpurl & "','" & tmptitle & "');"
  next
  Il "</script>"
  Il dp.close
 set dp=nothing


谢谢您对IT618资讯网的支持!
文章出处:http://www.cnit618.com/html/kyxt/kingcms/2381.htm

张大磊 发表于:12-04-10 23:00 沙发 [回复] #Top#
张大磊 人气:21 积分:32 金币:162
这些代码我的看不懂的啊呵呵

1Next >

发表回复

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

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

Copyright © 2004-2015 Focuznet All rights reserved.

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