dedecms去掉访问官网的链接防止被侵权
一、前台
模板里面,一切dede字样替换掉,不用用户中心的话member目录删除掉,不用插件的话plus目录删除掉,后台管理员目录换个名字,不要用dede。
include目录里面customfields.func.php,image.class.php,dedecollection.class.php,dedecollection.func.php,ftp.class.php,common.func.php,charset.func.php等文件
include/helpers里面
validate.helper.php,upload.helper.php,util.helper.php,string.helper.php,time.helper.php,test.helper.php,mda.helper.php,smiley.helper.php,debug.helper.php,charset.helper.php,archive.helper.php,cookie.helper.php,extend.helper.php,channelunit.helper.php,filter.helper.php,file.helper.php等文件
/include/inc里面inc_fun_funAdmin.php文件
if(!defined('DEDEINC')) exit('dedecms');
改为:
if(!defined('DEDEINC')) {header('HTTP/1.1 404 Not Found');exit();}
include/helpers里面cache.helper.php文件里面
$result = str_replace("<?php exit('dedecms');?>\n\r", "", $result);
改为:
$result = str_replace("<?php exit('deny');?>\n\r", "", $result);
include/helpers里面 mda.helper.php文件里面
define('MDA_APIHOST', 'http://ssp.desdev.cn');
改为:
define('MDA_APIHOST', 'http://127.0.01');
/include/inc里面inc_stat.php文件里面
function SpUpdateStat()
{
改为
function SpUpdateStat()
{
return "";
即是在{后面加入一句return "";
/include/dedesql.class.php里面
function DisplayError($msg)
{
$errorTrackFile = dirname(__FILE__).'/../data/mysql_error_trace.inc';
改为:
function DisplayError($msg)
{
$errorTrackFile = dirname(__FILE__).'/../data/mysql_error_trace_piikee.inc'; //这里mysql_error_trace_piikee.inc是错误日志文件名,可以自己随便填,就是别用原来的名字。不想把错误写入日志也可以把这句变成return true;
还有下面:
$emsg .= "<div><h3>DedeCMS Error Warning!</h3>\r\n";
$emsg .= "<div><a href='http://bbs.dedecms.com' target='_blank' style='color:red'>Technical Support: http://bbs.dedecms.com</a></div>";
改为
$emsg .= "<div><h3>Error Warning!</h3>\r\n";
$emsg .= "<div>出错了</div>";
还有:
$GLOBALS[$v1] .= $v2;
改为:
$GLOBALS[$v1] .= "wordpress";//这里面本来$v2放的是dede的版权链接
还有:
$this->DisplayError("DedeCms错误警告:<font color='red'>连接数据库失败,可能数据库密码不对或数据库服务器出错!</font>");
改为:
$this->DisplayError("<font color='red'>连接数据库失败,可能数据库密码不对或数据库服务器出错!</font>");
/include/dedesqli.class.php里面
mysqli_errno($this->linkID) != 0 && $this->DisplayError('DedeCms错误警告: 链接('.$this->pconnect.') 到MySQL发生错误');
改为:
mysqli_errno($this->linkID) != 0 && $this->DisplayError('链接('.$this->pconnect.') 到MySQL发生错误');
还有:
$this->DisplayError("DedeCms错误警告:<font color='red'>连接数据库失败,可能数据库密码不对或数据库服务器出错!</font>");
改为:
$this->DisplayError("<font color='red'>连接数据库失败,可能数据库密码不对或数据库服务器出错!</font>");
还有:
$errorTrackFile = dirname(__FILE__).'/../data/mysqli_error_trace.inc';
改为:
$errorTrackFile = dirname(__FILE__).'/../data/mysqli_error_trace_piikee.inc';//
这里mysqli_error_trace_piikee.inc是错误日志文件名,可以自己随便填,就是别用原来的名字。不想把错误写入日志也可以把这句变成return true;
还有:
$emsg .= "<div><h3>DedeCMS Error Warning!</h3>\r\n";
$emsg .= "<div><a href='http://bbs.dedecms.com' target='_blank' style='color:red'>Technical Support: http://bbs.dedecms.com</a></div>";
改为:
$emsg .= "<div><h3>Error Warning!</h3>\r\n";
$emsg .= "<div>出错了</div>";
plus目录里面qrcode.php文件里面:
$url = "http://2v.dedecms.com";
总共有两个地方,都改为:
$url = $cfg_basehost;
二、后台
管理目录
/dede/templets/index_body.htm里面
去掉
<iframe name="showauth" src="index_body.php?dopost=showauth" width="100%" frameborder="0" scrolling="no" marginwidth="10" marginheight="10" id="showauth"></iframe>
<iframe name="showad" src="index_body.php?dopost=showad" frameborder="0" width="100%" id="showad" frameborder="0" scrolling="no" marginheight="5"></iframe>
echo "<iframe name='stafrm' src='{$offUrl}&uptime={$oktime}' frameborder='0' id='stafrm' width='98%' height='50'></iframe>";
管理目录
/dede/js/indexbody.js里面,删除掉以下内容:
function LoadUpdateInfos(){
$DE('updateinfos').innerHTML = "<div style=\"height:90px;\"><img src='images/loadinglit.gif' /> 正在处理中...</div>";
var myajax = new DedeAjax($DE('updateinfos'));
myajax.SendGet('update_guide.php?dopost=test');
}
function SkipReload(nnum){
if( window.confirm("忽略后以后都不会再提示这个日期前的升级信息,你确定要忽略这些更新吗?") )
{
DedeXHTTP = null;
$DE('updateinfos').innerHTML = "<img src='images/loadinglit.gif' /> 正在处理中...";
var myajax = new DedeAjax($DE('updateinfos'));
myajax.SendGet('update_guide.php?dopost=skip&vtime='+nnum);
}
}
还有删除以下内容:
window.onload = function()
{
var myajax = new DedeAjax($DE('listCount'));
myajax.SendGet('index_body.php?dopost=getRightSide');
};
管理目录
/dede/index_body.php里面,删除掉以下内容:
include('templets/index_body_showad.htm');
include('templets/index_body_showauth.htm');
最后,还要屏蔽模板目录里面的htm模板文件,但又不能禁止css和js,还要data,include两个目录禁止。apache2的网站对应配置文件里面写入如下配置:
<Directory /data/www/gupiao/www.xxx.com/templets/>
<FilesMatch "\.(htm)$">
Deny from all
</FilesMatch>
</Directory>
<Directory /data/www/gupiao/www.xxx.com/data/>
<FilesMatch "\.(php)$">
Deny from all
</FilesMatch>
</Directory>
<Directory /data/www/gupiao/www.xxx.com/include/>
<FilesMatch "\.(php)$">
Deny from all
</FilesMatch>
</Directory>
或者伪静态配置文件.htaccess里面进行屏蔽:
RewriteRule templets/(.*).(htm)$ –[F]
RewriteRule include/(.*).(php)$ –[F]
RewriteRule data/(.*).(php)$ –[F]
未完待更新...