POST TIME:2017-11-13 00:31
新版的dedecms 5.7 版本在后臺登陸的時候,以及登陸之后的頁面,都留了廣告的位置。原則上對我們影響不大,但是細想一下,一旦dedecms的廣告服務器被攻陷,廣告位的位置被掛上了馬,后果可想而知。于是想到去掉它。下面開始行動。
一、去除后臺登陸頁面廣告。
1、用記事本打開/dede/templets/login.htm文件,找到以下代碼并刪除。
<div><iframe name="loginad" src="login.php?dopost=showad" frameborder="0" id="loginad" scrolling="no" marginwidth="0" marginheight="0" width="100%"></iframe></div>
以上代碼是后臺登陸框下方的廣告。
<div>Powered by<a href="http://www.dedecms.com" title="DedeCMS官網"><strong>DedeCMS<?php echo $cfg_version; ?></strong></a>© 2004-2011 <a href="http://www.desdev.cn" target="_blank">DesDev</a> Inc.</div> </div>
以上代碼是版權聲明部分,也可以直接刪除的。然后再順手修改標題部分代碼:
<title><?php echo $cfg_softname." ".$cfg_version; ?></title>
修改為:
<title><?php echo $cfg_webname; ?> - 后臺管理登陸</title> 最終效果為:網站名稱 - 后臺管理登陸
2、打開/dede/login.php 文件,找到第42到46行部分代碼,將其去掉即可。
if ($dopost=='showad') { include('templets/login_ad.htm'); exit; }
并且還要刪除對應的”/dede/templets/login_ad.htm”模板文件,這個文件是多余的,官方加的廣告鏈部分。
二、去除后臺登陸后默認首頁廣告
主要去掉的部分為:贊助商鏈接,開發團隊,商業授權查詢
1、打開/dede/index_body.php,在文件最末尾處找到如下代碼:
<?php exit; } else if ($dopost=='showauth') { include('templets/index_body_showauth.htm'); exit; } else if ($dopost=='showad') { include('templets/index_body_showad.htm'); exit; } ?>
修改為:
<?php exit; } ?>
然后,刪除/dede/templets/index_body_showauth.htm 和 /dede/templets/index_body_showad.htm 文件即可。
2、打開/dede/templets/index_body.htm,刪除如下代碼:
<dl class='dbox' id="item8"> <dt class='lside'><div class='l'>贊助商鏈接(<a href="http://ad.dedecms.com/ad/" target="_blank">說明</a>)</div></dt> <dd> <iframe name="showad" src="index_body.php?dopost=showad" frameborder="0" width="100%" id="showad" frameborder="0" scrolling="no" marginheight="5"></iframe> </dd> </dl><!--贊助商鏈接結束-->
以上是 贊助商鏈接的廣告
<dl class='dbox' id="item5"> <dt class='lside'><div class='l'>開發團隊</div></dt> <dd class='intable'> <table width="98%"> <tr> <td width='25%' height='36' class='nline' style="text-align:right"> 主程序開發: </td> <td class='nline' style="text-align:left">天涯、IT柏拉圖、沙羨、藍色隨想、Niap、木匠、cha369</td> </tr> <tr> <td height='36' class='nline' style="text-align:right">界面及交互設計:</td> <td class='nline' style="text-align:left">尐湶細蓅、like、豬頭心宇、方域、小王</td> </tr> <tr> <td height='36' class='nline' style="text-align:right">官方論壇協助:</td> <td class='nline' style="text-align:left">感謝以下站長(排名不分先后):瘋狂的錘子、木木/阿杰</td> </tr> </table> </dd> </dl><!--開發團隊結束-->
以上是開發團隊介紹信息。
<dl class='dbox' id="item2"> <dt class='lside'><span class='l'>商業授權查詢</span></dt> <dd> <iframe name="showauth" src="index_body.php?dopost=showauth" width="100%" frameborder="0" scrolling="no" marginwidth="10" marginheight="10" id="showauth"></iframe> </dd> </dl><!--更新消息結束-->
以上是商業授權查詢模塊。
3、后臺頂部版權信息及鏈接主要修改/dede/templets/index_top2.htm 和 /dede/templets/index2.htm 兩個模板文件。
4、去掉左欄“系統幫助”,修改模板文件為:/dede/inc/inc_menu.php