加入收藏 | 设为首页 | 会员中心 | 我要投稿 PHP编程网 - 黄冈站长网 (http://www.0713zz.com/)- 数据应用、建站、人体识别、智能机器人、语音技术!
当前位置: 首页 > 运营中心 > 建站资源 > 经验 > 正文

织梦 dedecms 文章评论功能的运用

发布时间:2021-12-14 22:29:11 所属栏目:经验 来源:互联网
导读:织梦是个很好的内容管理系统,其模型、频道、缓存功能都是十分的强大的,其文章评论也是很有特色的,因为织梦的文章评论是使用了ajax,这样即使是用的生成静态,也可以调取出最新的文章评论. input type=hidden name=action value=send / input type=hidden nam
织梦是个很好的内容管理系统,其模型、频道、缓存功能都是十分的强大的,其文章评论也是很有特色的,因为织梦的文章评论是使用了ajax,这样即使是用的生成静态,也可以调取出最新的文章评论.
 
 
<input type="hidden" name="action" value="send" />
<input type="hidden" name="comtype" value="comments">
<input type="hidden" name="username" value="youke">
<input type="hidden" name="oldurl" value="http://www.Cuoxin.com">
<input type="hidden" name="aid" value="179" />
<input type="text" name="msg" value="" />
<input type="hidden" name="isconfirm" value="yes" />
他需要几个隐含值,其中action为操纵类型,send代表发布评论,comtype为comments时表示是评论,这个username 和 oldurl为我自己定义的变量,这样的目的是不让其填姓名,只填评论内容,oldurl为评论发布成功后跳转的页面,然后验证码是.
 
验证码:
<input name="validate" type="text" id="validate" size="10" style="height:18px;width:60px;margin-right:6px;text-transform:uppercase;" class="nb" />
<img src='http://local.de.com/include/vdimgck.php' width='60' height='24' style="cursor:pointer" onclick="this.src=this.src+'?'" title="点击我更换图片" alt="点击我更换图片" />
 
<script language='javascript'>
function LoadCommets(page)
{
var taget_obj = document.getElementByIdx_x('commetcontent');
var waithtml = "<div style='line-height:50px'><img src='{dede:global.cfg_cmsurl/}/images/loadinglit.gif' />评论加载中...</div>";
var myajax = new DedeAjax(taget_obj, true, true, '', 'x', waithtml);
myajax.SendGet2("{dede:global.cfg_phpurl /}/feedback_ajax.php?dopost=getlist&aid={dede:field.id/}&page="+page);
DedeXHTTP = null;//开源软件:Cuoxin.com
}
LoadCommets(1);
</script>
这个就是获取评论的js,加在包含文件的后面就可以,然后在plus/feedback_ajax.php中的GetList()函数中定义评论列表的样式,调取的内容就可以了,需要注意的是其helper(‘smiley’);等的一些小助手功能.


织梦 dedecms 文章评论功能的运用

(编辑:PHP编程网 - 黄冈站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    热点阅读