码迷,mamicode.com
首页 > 其他好文 > 详细

destoon发布信息标题重复不能发布信息

时间:2018-10-15 12:18:55      阅读:370      评论:0      收藏:0      [点我收藏+]

标签:content   cti   fun   增加   信息   one   too   condition   class   

destoon发布信息标题重复不能发布信息

 

比如供应

 

重复标题不能让发布

 

1.module/sell/sell.class.php

 

增加这个函数

function title_exists($title) {
  $condition = "title=‘$title‘";
  return $this->db->get_one("SELECT itemid FROM {$this->table} WHERE $condition");
 }

 

 

然后在function pass($post)这个函数中加入以下判断

 if(!$this->itemid && $this->title_exists($post[‘title‘])) return $this->_(‘标题不能重复‘);

加在if($post[‘totime‘])前面

 

修改的时候要是重复不会提示

destoon发布信息标题重复不能发布信息

标签:content   cti   fun   增加   信息   one   too   condition   class   

原文地址:https://www.cnblogs.com/lx0715/p/9723924.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!