最新解决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 = '
}
}
if(!isset($_G['cookie']['checkpatch'])) {
$discuz_patch->check_patch();
}
}
if($_G['uid'] && $_G['member']['allowadmincp'] == 1 && !$shownotice && $_G['setting']['upgrade']) {
$shownotice = '';
}
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 = '';
}
}
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;
}
?>
修改方法就这些,大家可以测试一下。
更多文章请阅读
最后更新:2017-08-13 22:26:14