JC68程序 禁止同一個會員發(fā)布重復信息
DESTOON介紹:DESTOON® B2B網(wǎng)站管理系統(tǒng)是一套基于PHP+MySQL的開源B2B電子商務行業(yè)門戶網(wǎng)站解決方案。
當前已發(fā)布會員、分站、商城、供應、求購、行情、公司、展會、文章、信息、品牌、團購、圖庫、專題、視頻、下載、人才、知道等模型……
禁止同一個會員發(fā)布重復信息:
已供應為例子:打開文件module/sell/sell.class.php
在代碼function pass($post)前面增加一個title_exists函數(shù):
function title_exists($title) {
$condition = "title='$title'";
return $this->db->get_one("selec itemid from {$this->table} wher $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'] = '標題重復請重新填寫';
DESTOON介紹:DESTOON® B2B網(wǎng)站管理系統(tǒng)是一套基于PHP+MySQL的開源B2B電子商務行業(yè)門戶網(wǎng)站解決方案。
當前已發(fā)布會員、分站、商城、供應、求購、行情、公司、展會、文章、信息、品牌、團購、圖庫、專題、視頻、下載、人才、知道等模型……
禁止同一個會員發(fā)布重復信息:
已供應為例子:打開文件module/sell/sell.class.php
在代碼function pass($post)前面增加一個title_exists函數(shù):
function title_exists($title) {
$condition = "title='$title'";
return $this->db->get_one("selec itemid from {$this->table} wher $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'] = '標題重復請重新填寫';