宝塔服务器面板,一键全能部署及管理,送你10850元礼包,点我领取

很多destoon做的B2B网站允许免费会员发布信息,但是免费会员会发布大量重复信息,有可能会导致搜索引擎降权,所以我们有必要做一下限制,禁止一个会员发布重复信息,需要修改几处代码:

以供应模块为例

1、打开文件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");}

2.在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'));

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

$L['pass_chongfu'] = '标题重复请重新填写';

其他模块也是同样的道理,快去试试吧