原创Discuz X3 屏蔽升级提醒“您目前使用的 Discuz! 程序有新版本发布,请及时升级”

2012年09月14日 技术资料 3476 views 0
原创Discuz X3 屏蔽升级提醒“您目前使用的 Discuz! 程序有新版本发布,请及时升级” 第1张



解决方法:
1.打开 source/admincp/admincp_main.php


2.从第37行至60行的代码全部删除或者屏蔽

删除如下代码

     if($_G['uid'] && $_G['member']['allowadmincp'] == 1 && ($_G['setting']['showpatchnotice'] == 1 || !isset($_G['cookie']['checkpatch']))) {
        $discuz_patch = new discuz_patch();
        if($_G['setting']['showpatchnotice'] == 1) {
            $notice = $discuz_patch->fetch_patch_notice();
            if($notice['data']) {
                $shownotice = '<div class="notice"><a href="'.$basescript.'?action=patch" id="notice">'.($notice['fixed'] ? $lang['patch_fix_complete'] : $lang['patch_fix_rigth_now']).'</a></div>';
            }
        }
        if(!isset($_G['cookie']['checkpatch'])) {
            $discuz_patch->check_patch();
        }
    }
    if($_G['uid'] && $_G['member']['allowadmincp'] == 1 && !$shownotice && $_G['setting']['upgrade']) {
        $shownotice = '<div class="notice"><a href="'.$basescript.'?action=upgrade" id="notice">'.$lang['upgrade_right_now'].'</a></div>';
    }
    if($_G['uid'] && $_G['member']['allowadmincp'] == 1 && !isset($_G['cookie']['checkupgrade'])) {
        $discuz_upgrade = new discuz_upgrade();
        if($discuz_upgrade->check_upgrade()) {
            if(empty($shownotice)) {
                $shownotice = '<div class="notice"><a href="'.$basescript.'?action=upgrade" id="notice">'.$lang['upgrade_right_now'].'</a></div>';
            }
        }
        dsetcookie('checkupgrade', 1, 7200);
    }

👍好活当赏🧧