15621857753

phpcmsV9想要制作个留言板功能怎么开发

来源:齐鲁建站 栏目:开发教程 阅读: 日期:2021-07-29

本文介绍了phpcmsV9想要制作个留言板功能怎么开发,解决思路:打开这个文件formguide index.php,将46行、79行、97行改为教程给出的代码,然后再在127行后面添加教程给出的代码,就可以了。

下面就由齐鲁建站和大伙儿介绍下phpcmsV9制作个留言板功能的开发方法。

实现教程:

整理后发布,改进了几处,比如表单信息提交后不关闭框架,原文formid值未提示修改,index.html第四处修改地方也不对等等,将 ok.html success.html show_box.html三个文件放在 www\phpcms\templates\default\formguide\

将mymydialog.css放如在 www\statics\css\

打开:www\phpcms\modules\formguide\index.php

修改,最好是注释插入,不要直接修改.

46行 

$_GET['action'] ? exit : showmessage(L('form_expired'), APP_PATH.'index.php?m=formguide&c=index&a=index'); 

改成 

$_GET['action'] ? exit : showmessage(L('form_expired'), APP_PATH.'index.php?m=formguide&c=index&a=ok'); 

79行 

showmessage(L('thanks'), APP_PATH); 

改成 

showmessage(L('thanks'),APP_PATH.'index.php?m=formguide&c=index&a=success'); 

97行 

$_GET['action'] ? exit : showmessage(L('had_participate'), APP_PATH.'index.php?m=formguide&c=index&a=index'); 

改成 

$_GET['action'] ? exit : showmessage(L('had_participate'), APP_PATH.'index.php?m=formguide&c=index&a=ok'); 

在127行后添加 

public function ok() { 

include template('formguide', 'ok'); 

public function success() { 

include template('formguide', 'success'); 

后台创建表单:

添加表单向导时的模版选择改成 show_box.html ,其他的按你的实际情况填,添加字段略,在模版文件中,你想插入的留言板链接的位置前,调加,打开表单向导后,在表单调用里查看src=''引号里formid的值.

留言板的链接就是:

javascript:art.dialog({id:'message',iframe:'? m=formguide&c=index&a=show&formid=20&siteid=1', title:'意见反馈', width:'540', height:'360',drag: false,fixed: true,opacity: .5, lock:true});void(0); 

将其中的formid的值,替换成你刚才查看的值即可.

下载链接:https://pan.baidu.com/s/1EJ0ubNvaz6KAS8gofBgo8A  提取码:e37b

展开