|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
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}–>undefinedowered 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 id="sitefocus">
<div >
<div >
<a href="javascript:;" title="{lang close}">{lang close}</a>
<h2><!--{if $_G['cache']['focus']['title']}-->{$_G['cache']['focus']['title']}<!--{else}-->{lang focus_hottopics}<!--{/if}--></h2>
</div>
<div >
<dl >
<dt><a href="{$focus['url']}" target="_blank">$focus['subject']</a></dt>
<!--{if $focus[image]}-->
<dd ><a href="{$focus['url']}" target="_blank"><img src="{$focus['image']}" alt="$focus['subject']" /></a></dd>
<!--{/if}-->
<dd>$focus['summary']</dd>
</dl>
<p ><a href="{$focus['url']}" 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" >
<div id="flk" >
<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 >|</span><!--{/if}--><!--{/loop}-->
<strong><a href="$_G['setting']['siteurl']" target="_blank">$_G['setting']['sitename']</a></strong>
<!--{if $_G['setting']['icp']}-->( <a target="_blank">$_G['setting']['icp']</a> )<!--{/if}-->
<!--{hook/global_footerlink}-->
<!--{if $_G['setting']['statcode']}-->$_G['setting']['statcode']<!--{/if}-->
</p>
<p >
{lang time_now}
<span id="debuginfo">
<!--{if debuginfo()}-->, Processed in $_G[debuginfo][time] second(s), $_G[debuginfo][queries] queries
<!--{if $_G['gzipcompress']}-->, Gzip On<!--{/if}--><!--{if $_G['memory']}-->, <!--{echo ucwords($_G['memory'])}--> On<!--{/if}-->.
<!--{/if}-->
</span>
</p>
</div>
<div id="frt">
<p>undefinedowered by <strong><a target="_blank">fxmyk</a></strong> <em>$_G['setting']['version']</em><!--{if !empty($_G['setting']['boardlicensed'])}--> <a href=http://www.fxmyk.com target="_blank">Licensed</a><!--{/if}--></p>
<p >© 2001-2011 <a target="_blank">fxmyk Inc.</a></p>
</div>
<!--{eval updatesession();}-->
<!--{if $_G['uid'] && $_G['group']['allowinvisible']}-->
<script >
var invisiblestatus = '<!--{if $_G['session']['invisible']}-->{lang login_invisible_mode}<!--{else}-->{lang login_normal_mode}<!--{/if}-->';
var loginstatusobj = $('loginstatusid');
if(loginstatusobj != undefined && loginstatusobj != null) loginstatusobj.innerHTML = invisiblestatus;
<!--{/if}-->
</script>
</div>
<!--{if $upgradecredit !== false}-->
<div id="g_upmine_menu" >
<div >
{lang credits} $_G[member][credits], {lang thread_groupupgrade} $upgradecredit {lang credits}
</div>
<div ></div>
</div>
<!--{/if}-->
<!--{/if}-->
<!--{if !$_G['setting']['bbclosed']}-->
<!--{if $_G[uid] && !isset($_G['cookie']['checkpm'])}-->
<script src="home.php?mod=spacecp&ac=pm&op=checknewpm&rand=$_G[times**p]"></script>
<!--{/if}-->
<!--{if !isset($_G['cookie']['sendmail'])}-->
<script src="home.php?mod=misc&ac=sendmail&rand=$_G[times**p]"></script>
<!--{/if}-->
<!--{/if}-->
<!--{if $_GET['diy'] == 'yes'}-->
<!--{if (CURMODULE == 'topic' || $_G['group']['allowdiy']) && (empty($do) || $do != 'index') && !empty($_G['style']['tplfile'])}-->
<script src="{$_G[setting][jspath]}common_diy.js?{VERHASH}"></script>
<script src="{$_G[setting][jspath]}portal_diy.js?{VERHASH}"></script>
<!--{/if}-->
<!--{if $space['self'] && CURMODULE == 'space' && $do == 'index'}-->
<script src="{$_G[setting][jspath]}common_diy.js?{VERHASH}"></script>
<script src="{$_G[setting][jspath]}space_diy.js?{VERHASH}"></script>
<!--{/if}-->
<!--{/if}-->
<!--{if $_G['member']['newprompt'] && (empty($_G['cookie']['promptstate_'.$_G[uid]]) || $_G['cookie']['promptstate_'.$_G[uid]] != $_G['member']['newprompt']) && $_G['gp_do'] != 'notice'}-->
<script >noticeTitle();</script>
<!--{/if}-->
<!--{eval userappprompt();}-->
<span id="scrolltop">{lang scrolltop}</span>
<script >_attachEvent(window, 'scroll', function(){showTopLink();});</script>
<!--{eval output();}-->
</body>
</html>
|
|
|