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

来源: https://destoon.cc/ 日期: 2019-03-01 20:01:09 人气: - 评论: 0

当前已发布会员、分站、商城、供应、求购、行情、公司、展会、文章、信息、品牌、团购、图库、专题、视频、下载、人才、知道等模型……

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

已供应为例子:打开文件module/sell/sell.class.php 

在代码function pass($post)前面增加一个title_exists函数:

  1. function title_exists($title) { 
  2.   $condition = "title='$title'"
  3.   return $this->db->get_one("SELECt itemid FROM {$this->table} WHERe $condition"); 

在if($post['totime'])这前面添加:

  1. if(strlen($post['title']) < 3) return $this->_(lang('message->pass_title')); 
  2. if(!$this->itemid && $this->title_exists($post['title'])) return $this->_(lang('message->pass_chongfu')); 

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