discuz x2自發布以來很多網友希望能夠去掉discuz版權,其實做二次開發代碼也要考慮discuz既然開放給大家使用了,大家也厚道一點,起碼保留一下版權,這是尊重知識產權的基本原則吧,站在網友的立場上本人放出詳細去discuz版權的教程,也可以說是完美去版權了,最后提醒大家“慎用!”如有網友侵權引起糾紛,與本人無關,我只是站在技術角度去二次開發,謝謝配合!
一、去除頭部版權
在原來的discuz X2版本中,標題中去掉“Powered by Discuz!”版權標識很容易,只需要修改模板文件的頭部公用文件,將“Powered by Discuz!”這一行字去掉即可。
但是discuz X2 似乎對這點有所防備,把-Powered by Discuz!中的-放在了變量里,所以刪除后,標題一句話結束后會有一個小-尾巴,對搜索引擎很不友好,所以也有一個好的辦法完美解決,即:
打開/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。 在變量的最后,也就是整個數組的目錄后按以前的格式,加上“‘secondtitle’ => ‘你的論壇名稱!”,” 。
更新緩存即可。
二、去除底部的版本
打開template/default/common,找到footer.htm文件,用deamweaver打開,點擊編輯,再點擊查找和替換powerd by,知道相應的位置把底部版權的相應內容改了就ok了,注意修改下面紅色標記部分
</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.companysz.com/" target="_blank">$_G['setting']['icp']</a> )<!--{/if}-->