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

分类栏目:destoon实战

165

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

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

已供应为例子:打开文件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']) < 3) return $this->_(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'] = '标题重复请重新填写';