🌓 天气与日历 切换到窄版

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
热搜: 活动 交友 discuz
查看: 53|回复: 0

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

[复制链接]

升级   100%

  • TA的每日心情

    2025-10-14 08:32
  • 签到天数: 19 天

    连续签到: 2 天

    [LV.4]偶尔看看III

    547

    主题

    85

    回帖

    214748万

    积分

    管理员

    积分
    2147483647

    突出贡献荣誉管理论坛元老

    发表于 2025-9-21 06:25:23 | 显示全部楼层 |阅读模式 IP:湖北
    视频教程
    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[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:;" 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} &#187;</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://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[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>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">&#169; 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[member][credits], {lang thread_groupupgrade} $upgradecredit {lang credits}
       </div>
       <div class="tip_horn"></div>
      </div>
    <!--{/if}-->
    <!--{/if}-->
    <!--{if !$_G['setting']['bbclosed']}-->
    <!--{if $_G[uid] && !isset($_G['cookie']['checkpm'])}-->
    <script type="text/javascript" src="home.php?mod=spacecp&ac=pm&op=checknewpm&rand=$_G[times**p]"></script>
    <!--{/if}-->
    <!--{if !isset($_G['cookie']['sendmail'])}-->
    <script type="text/javascript" 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 type="text/javascript" src="{$_G[setting][jspath]}common_diy.js?{VERHASH}"></script>
      <script type="text/javascript" src="{$_G[setting][jspath]}portal_diy.js?{VERHASH}"></script>
    <!--{/if}-->
    <!--{if $space['self'] && CURMODULE == 'space' && $do == 'index'}-->
      <script type="text/javascript" src="{$_G[setting][jspath]}common_diy.js?{VERHASH}"></script>
      <script type="text/javascript" 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 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>

    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    快速回复 返回顶部 返回列表