zhang6423987 发表于 2013-5-8 16:46:07

禁止同一个会员发布重复信息

已供应为例子:打开文件module/sell/sell.class.php
在代码function pass($post)前面增加一个title_exists函数:
function title_exists($title) {
$condition = "title='$title'";
return $this->db->get_one("SELECT itemid FROM {$this->table} WHERE $condition");
}



在if($post['totime'])这前面添加
if(strlen($post['title']) _(lang('message->pass_title'));
if(!$this->itemid && $this->title_exists($post['title'])) return $this->_(lang('message->pass_chongfu'));


最后在找到lang\zh-cn\message.inc.php添加一行$L['pass_chongfu'] = '标题重复请重新填写';

zhaofucai 发表于 2013-5-9 09:07:07


我修改了怎么不行啊还可以出现重复的标题

allife 发表于 2013-5-9 09:42:36


没有测试过收藏起来

foxcvs 发表于 2013-5-9 11:35:59


http://bbs.destoon.com/thread-47767-1-1.html 试一试这个
页: [1]
查看完整版本: 禁止同一个会员发布重复信息