discuz x2自發(fā)布以來很多網(wǎng)友希望能夠去掉discuz版權(quán),其實(shí)做二次開發(fā)代碼也要考慮discuz既然開放給大家使用了,大家也厚道一點(diǎn),起碼保留一下版權(quán),這是尊重知識(shí)產(chǎn)權(quán)的基本原則吧,站在網(wǎng)友的立場上本人放出詳細(xì)去discuz版權(quán)的教程,也可以說是完美去版權(quán)了,最后提醒大家“慎用!”如有網(wǎng)友侵權(quán)引起糾紛,與本人無關(guān),我只是站在技術(shù)角度去二次開發(fā),謝謝配合!
一、去除頭部版權(quán)
在原來的discuz X2版本中,標(biāo)題中去掉“Powered by Discuz!”版權(quán)標(biāo)識(shí)很容易,只需要修改模板文件的頭部公用文件,將“Powered by Discuz!”這一行字去掉即可。
但是discuz X2 似乎對這點(diǎn)有所防備,把-Powered by Discuz!中的-放在了變量里,所以刪除后,標(biāo)題一句話結(jié)束后會(huì)有一個(gè)小-尾巴,對搜索引擎很不友好,所以也有一個(gè)好的辦法完美解決,即:
打開/template/default/common/header_common.htm文件,找到<title><!–{if !empty($navtitle)}–>$navtitle – <!–{/if}–><!–{if empty($nobbname)}–> $_G['setting']['bbname']-<!–{/if}–>Powered by Discuz!</title>
將其中的“Powered By Discuz!”字串改為“{lang secondtitle}”。
再打開source/language/lang_template.php?!≡谧兞康淖詈?,也就是整個(gè)數(shù)組的目錄后按以前的格式,加上“‘secondtitle’ => ‘你的論壇名稱!”,” 。
更新緩存即可。
二、去除底部的版本
打開template/default/common,找到footer.htm文件,用deamweaver打開,點(diǎn)擊編輯,再點(diǎn)擊查找和替換powerd by,知道相應(yīng)的位置把底部版權(quán)的相應(yīng)內(nèi)容改了就ok了,注意修改下面紅色標(biāo)記部分
</div>
<!--{if empty($topic) || ($topic[usefooter])}-->
<!--{eval $focusid = getfocus_rand($_G[basescript]);}-->
<!--{if $focusid !== null}-->
<!--{eval $focus = $_G['cache']['focus']['data'][$focusid];}-->
<div class="focus" id="sitefocus">
<div class="bm">
<div class="bm_h cl">
<a href="javascript:;" onclick="setcookie('nofocus_$focusid', 1, $_G['cache']['focus']['cookie']*3600);$('sitefocus').style.display='none'" class="y" title="{lang close}">{lang close}</a>
<h2><!--{if $_G['cache']['focus']['title']}-->{$_G['cache']['focus']['title']}<!--{else}-->{lang focus_hottopics}<!--{/if}--></h2>
</div>
<div class="bm_c">
<dl class="xld cl bbda">
<dt><a href="{$focus['url']}" class="xi2" target="_blank">$focus['subject']</a></dt>
<!--{if $focus[image]}-->
<dd class="m"><a href="{$focus['url']}" target="_blank"><img src="{$focus['image']}" alt="$focus['subject']" /></a></dd>
<!--{/if}-->
<dd>$focus['summary']</dd>
</dl>
<p class="ptn hm"><a href="{$focus['url']}" class="xi2" target="_blank">{lang focus_show} »</a></p>
</div>
</div>
</div>
<!--{/if}-->
<!--{ad/footerbanner/wp a_f/1}--><!--{ad/footerbanner/wp a_f/2}--><!--{ad/footerbanner/wp a_f/3}-->
<!--{ad/float/a_fl/1}--><!--{ad/float/a_fr/2}-->
<!--{ad/couplebanner/a_fl a_cb/1}--><!--{ad/couplebanner/a_fr a_cb/2}-->
<!--{ad/cornerbanner/a_cn}-->
<!--{hook/global_footer}-->
<div id="ft" class="wp cl">
<div id="flk" class="y">
<p>
<!--{loop $_G['setting']['footernavs'] $nav}--><!--{if $nav['available'] && ($nav['type'] && (!$nav['level'] || ($nav['level'] == 1 && $_G['uid']) || ($nav['level'] == 2 && $_G['adminid'] > 0) || ($nav['level'] == 3 && $_G['adminid'] == 1)) ||
!$nav['type'] && ($nav['id'] == 'stat' && $_G['group']['allowstatdata'] || $nav['id'] == 'report' && $_G['uid'] || $nav['id'] == 'archiver' || $nav['id'] == 'mobile'))}--><!--{if $nav['id'] == 'mobile' && $_G['setting']['mobile']['allowmobile'] != 1}--><!--{eval continue;}--><!--{/if}-->$nav[code]<span class="pipe">|</span><!--{/if}--><!--{/loop}-->
<strong><a href="$_G['setting']['siteurl']" target="_blank">$_G['setting']['sitename']</a></strong>
<!--{if $_G['setting']['icp']}-->( <a href="http://www.survivalescaperooms.com/" target="_blank">$_G['setting']['icp']</a> )<!--{/if}-->