---
title: "[低调蓝色]DEDECMS：对不起，请不要发布重复文档(已解决+延伸)"
author: "tgxz2000"
date: "2010-12-18T11:08:08Z"
tags: []
categories: ["编程语言"]
slug: "dedecms"
draft: false
lastmod: "2010-12-18T11:08:08Z"
id: 846150
url: "https://php360.iteye.com/blog/846150"
---

在member/inc/archives\_check.php文件中

01. //检测文档是否重复
02. if($cfg\_mb\_cktitle=='Y')
03. {
04. $row = $dsql-&gt;GetOne("Select * From \`#@\_\_archives\` where title like '$title' ");
05. if(is\_array($row))
06. {
07. ShowMsg("对不起，请不要发布重复文档！","-1","0",5000);
08. exit();
09. }
10. }

延伸修改：允许不同会员发布相同的文章，不允许同一会员发布重复的文章

查询语句修改为$row = $dsql-&gt;GetOne("Select * From \`#@\_\_archives\` where title like '$title' and mid = '".$cfg\_ml-&gt;M\_ID."'");即可