閱讀686 返回首頁    go 阿裏雲 go 技術社區[雲棲]


最新解決Discuz!X3.4以下版本前台打開卡慢、後台登陸卡死或504錯誤等問題

  隻針對Discuz!X3.4以下的版本前台打開卡慢、後台登陸卡死或504錯誤的問題。

  形成原因:discuz的補丁升級和版本檢查驗證已經關閉。而x3.4以下仍然在驗證和檢查導致鏈接超時,引起後台打不開。解決辦法有兩個。

解決方法一,升級到x3.4,x3.4版本已經移除了相關代碼。

解決方法二,修改代碼:
後台修改,文件source/admincp/admincp_main.php,刪除以下代碼大概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 = '

'.($notice['fixed'] ? $lang['patch_fix_complete'] : $lang['patch_fix_rigth_now']).'
';
}
}
if(!isset($_G['cookie']['checkpatch'])) {
$discuz_patch->check_patch();
}
}
if($_G['uid'] && $_G['member']['allowadmincp'] == 1 && !$shownotice && $_G['setting']['upgrade']) {
$shownotice = '
'.$lang['upgrade_right_now'].'
';
}
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 = '
'.$lang['upgrade_right_now'].'
';
}
}
dsetcookie('checkupgrade', 1, 7200);
}

前台修改,打開文件source\module\misc\misc_patch.php 將內容替換。

<?php

/**

  • Discuz!2001-2099 https://yq.aliyun.com/articles/Comsenz Inc.
  • This is NOT a freeware, use is subject to license terms *
  • $Id: misc_patch.php 33690 2013-08-02 09:07:22Z nemohou $ */

if(!defined('IN_DIShttps://yq.aliyun.com/articles/CUZ')) {
exit('Access Denied');
}

if($_GET['action'] == 'checkpatch') {

header('https://yq.aliyun.com/articles/Content-Type: text/javascript');
exit;

} elseif($_GET['action'] == 'patchnotice') {
include template('common/header_ajax');
include template('common/footer_ajax');
exit;
} elseif($_GET['action'] == 'pluginnotice') {
include template('common/header_ajax');
include template('common/footer_ajax');
exit;
} elseif($_GET['action'] == 'ipnotice') {
require_once libfile('function/misc');
include template('common/header_ajax');
if($_G['cookie']['lip'] && $_G['cookie']['lip'] != ',' && $_G['uid'] && $_G['setting']['disableipnotice'] != 1) {
$status = https://yq.aliyun.com/articles/C::t('common_member_status')->fetch($_G['uid']);
$lip = explode(',', $_G['cookie']['lip']);
$lastiphttps://yq.aliyun.com/articles/Convert = convertip($lip[0]);
$lastipDate = dgmdate($lip[1]);
$nowiphttps://yq.aliyun.com/articles/Convert = convertip($status['lastip']);

    $lastiphttps://yq.aliyun.com/articles/Convert = process_ipnotice($lastiphttps://yq.aliyun.com/articles/Convert);
    $nowiphttps://yq.aliyun.com/articles/Convert = process_ipnotice($nowiphttps://yq.aliyun.com/articles/Convert);

    if($lastiphttps://yq.aliyun.com/articles/Convert != $nowiphttps://yq.aliyun.com/articles/Convert && stripos($lastiphttps://yq.aliyun.com/articles/Convert, $nowiphttps://yq.aliyun.com/articles/Convert) == false && stripos($nowiphttps://yq.aliyun.com/articles/Convert, $lastiphttps://yq.aliyun.com/articles/Convert) == false) {
        $lang = lang('forum/misc');
        include template('common/ipnotice');
    }
}
include template('common/footer_ajax');
exit;

}
?>

修改方法就這些,大家可以測試一下。

更多文章請閱讀

discuz程序修改

最後更新:2017-08-13 22:26:14

  上一篇:go  智慧醫療新時代能解決2030年的醫護荒?
  下一篇:go  醫改需要正視“社會性失明”智慧醫療作推手!