當前已發布會員、分站、商城、供應、求購、行情、公司、展會、文章、信息、品牌、團購、圖庫、專題、視頻、下載、人才、知道等模型……
禁止同一個會員發布重復信息:
已供應為例子:打開文件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'] = '標題重復請重新填寫';
