问题解析
destoon8.0程序 禁止同一个会员发布重复信息
2021-02-21 11:01  浏览:1312
 方法可广泛用于商城、供应、求购、行情、公司、展会、文章、信息、品牌、团购、图库、专题、视频、下载、人才、知道等模型……

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

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

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

 

  1. //20200623 S
  2. function title_exists($title) {
  3. $condition = "title='$title'";
  4. if($this->itemid) $condition .= " AND itemid!=$this->itemid";
  5. return DB::get_one("SELECt itemid FROM {$this->table} WHERe {$condition}");
  6. }
  7. //20200623 E

 

2、再搜索 if($post['totime']) { 上面加上

 

  1. if($this->title_exists($post['title'])) return $this->_(lang('message->pass_chongfu')); //20200623

 

总效果图

 

3、最后在找到lang\zh-cn\message.inc.php添加一行

 

  1. $L['pass_chongfu'] = '标题重复请修改'; //20200623

 

效果图:

 

 

总结:其他模块一样的方式,找到对应的  module/**/**.class.php  修改即可

发表评论
0评