wangjie 发表于 2025-9-21 06:25:23

完美去除discuz x2底部版权和去掉头部“powered by discuz!”X2.5X3通用

视频教程:
Discuz! X3.0论坛建设视频教程27、如何删除版权信息及去掉 Powered by Discuz!的方法
http://bbs.piaoxian.net/thread-48030-1-1.html
手机版 去版权需要修改的文件路径是:/template/default/mobile/common/header.htm 和 /template/default/mobile/common/footer.htm 以及/template/default/touch/common/header.htm 和 /template/default/touch/common/footer.htm
一、去除头部版权    在原来的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或者notepad++打开,点击编辑,再点击 查找和替换 powerd by,知道相应的位置把底部版权的相应内容改了就ok了,注意修改下面红色标记部分</div><!--{if empty($topic) || ($topic)}--><!--{eval $focusid = getfocus_rand($_G);}--><!--{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:;" 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}-->      <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<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://bbs.piaoxian.net/" target="_blank">$_G['setting']['icp']</a> )<!--{/if}-->    <!--{hook/global_footerlink}-->    <!--{if $_G['setting']['statcode']}-->$_G['setting']['statcode']<!--{/if}-->   </p>   <p class="xs0">    {lang time_now}    <span id="debuginfo">    <!--{if debuginfo()}-->, Processed in $_G second(s), $_G queries   <!--{if $_G['gzipcompress']}-->, Gzip On<!--{/if}--><!--{if $_G['memory']}-->, <!--{echo ucwords($_G['memory'])}--> On<!--{/if}-->.    <!--{/if}-->    </span>   </p></div><div id="frt">   <p>Powered by <strong><a href="http://www.piaoxian.net/" target="_blank">百度</a></strong> <em>$_G['setting']['version']</em><!--{if !empty($_G['setting']['boardlicensed'])}--> <a href=http://www.baidu.com target="_blank">Licensed</a><!--{/if}--></p>   <p class="xs0">© 2001-2011 <a href=“http://www.piaoxian.net” target="_blank">百度 Inc.</a></p></div><!--{eval updatesession();}--><!--{if $_G['uid'] && $_G['group']['allowinvisible']}--><script type="text/javascript">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" class="tip tip_3" style="display:none;">   <div class="tip_c">    {lang credits} $_G, {lang thread_groupupgrade} $upgradecredit {lang credits}   </div>   <div class="tip_horn"></div></div><!--{/if}--><!--{/if}--><!--{if !$_G['setting']['bbclosed']}--><!--{if $_G && !isset($_G['cookie']['checkpm'])}--><script type="text/javascript" src="home.php?mod=spacecp&ac=pm&op=checknewpm&rand=$_G"></script><!--{/if}--><!--{if !isset($_G['cookie']['sendmail'])}--><script type="text/javascript" src="home.php?mod=misc&ac=sendmail&rand=$_G"></script><!--{/if}--><!--{/if}--><!--{if $_GET['diy'] == 'yes'}--><!--{if (CURMODULE == 'topic' || $_G['group']['allowdiy']) && (empty($do) || $do != 'index') && !empty($_G['style']['tplfile'])}--><script type="text/javascript" src="{$_G}common_diy.js?{VERHASH}"></script><script type="text/javascript" src="{$_G}portal_diy.js?{VERHASH}"></script><!--{/if}--><!--{if $space['self'] && CURMODULE == 'space' && $do == 'index'}--><script type="text/javascript" src="{$_G}common_diy.js?{VERHASH}"></script><script type="text/javascript" src="{$_G}space_diy.js?{VERHASH}"></script><!--{/if}--><!--{/if}--><!--{if $_G['member']['newprompt'] && (empty($_G['cookie']['promptstate_'.$_G]) || $_G['cookie']['promptstate_'.$_G] != $_G['member']['newprompt']) && $_G['gp_do'] != 'notice'}--><script type="text/javascript">noticeTitle();</script><!--{/if}--><!--{eval userappprompt();}--><span id="scrolltop">{lang scrolltop}</span><script type="text/javascript">_attachEvent(window, 'scroll', function(){showTopLink();});</script><!--{eval output();}--></body></html>
页: [1]
查看完整版本: 完美去除discuz x2底部版权和去掉头部“powered by discuz!”X2.5X3通用