Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

站长推荐显示空白问题临时解决方案

[复制链接]
xiaoz_job 发表于 2010-10-21 11:05:15 | 显示全部楼层 |阅读模式
BUG描述
站长推荐中有未启用的推荐的时候,前台的推荐会显示一片空白。

修复方法
source/function/function_core.php
  1. function getfocus_rand($module) {
  2.         global $_G;

  3.         if(empty($_G['setting']['focus']) || !array_key_exists($module, $_G['setting']['focus'])) {
  4.                 return null;
  5.         }
  6.         do {
  7.                 $focusid = $_G['setting']['focus'][$module][array_rand($_G['setting']['focus'][$module])];
  8.                 if(!empty($_G['cookie']['nofocus_'.$focusid])) {
  9.                         unset($_G['setting']['focus'][$module][$focusid]);
  10.                         $continue = 1;
  11.                 } else {
  12.                         $continue = 0;
  13.                 }
  14.         } while(!empty($_G['setting']['focus'][$module]) && $continue);
  15.         if(!$_G['setting']['focus'][$module]) {
  16.                 return null;
  17.         }
  18.         loadcache('focus');
  19.         if(empty($_G['cache']['focus']['data']) || !is_array($_G['cache']['focus']['data'])) {
  20.                 return null;
  21.         }
  22.         return $focusid;
  23. }
复制代码
改为
  1. function getfocus_rand($module) {
  2.         global $_G;

  3.         if(empty($_G['setting']['focus']) || !array_key_exists($module, $_G['setting']['focus'])) {
  4.                 return null;
  5.         }
  6.         loadcache('focus');
  7.         do {
  8.                 $focusid = $_G['setting']['focus'][$module][array_rand($_G['setting']['focus'][$module])];
  9.                 if(!empty($_G['cookie']['nofocus_'.$focusid])) {
  10.                         unset($_G['setting']['focus'][$module][$focusid]);
  11.                         $continue = 1;
  12.                 } else {
  13.                         if(!$_G['cache']['focus']['data'][$focusid]['available']){
  14.                                 unset($_G['setting']['focus'][$module][$focusid]);
  15.                                 $continue = 1;
  16.                         } else {
  17.                                 $continue = 0;
  18.                         }
  19.                 }
  20.         } while(!empty($_G['setting']['focus'][$module]) && $continue);
  21.         if(!$_G['setting']['focus'][$module]) {
  22.                 return null;
  23.         }
  24.         if(empty($_G['cache']['focus']['data']) || !is_array($_G['cache']['focus']['data'])) {
  25.                 return null;
  26.         }
  27.         return $focusid;
  28. }
复制代码
weixinzhi 发表于 2010-10-21 11:13:06 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

weisong 发表于 2010-10-21 12:21:15 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

白垩纪 发表于 2010-10-21 13:20:55 | 显示全部楼层
唉。。。。补丁刚出,又出新BUG .
回复

使用道具 举报

weixinzhi 发表于 2010-10-21 13:23:59 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

aster8888 发表于 2010-10-21 14:22:21 | 显示全部楼层
回复

使用道具 举报

hh427 发表于 2010-10-21 14:56:15 | 显示全部楼层
回复 xiaoz_job 的帖子

放入补丁包了吗
回复

使用道具 举报

昆山人家 发表于 2010-10-21 18:28:25 | 显示全部楼层
本帖最后由 昆山人家 于 2010-10-21 18:28 编辑

这个一定要定,昆山人家http://ksrj.cn
回复

使用道具 举报

稻草GG 发表于 2010-10-22 21:13:10 | 显示全部楼层
打上这个补丁,网站一片空白,出现502错误!

这个补丁还有问题!
回复

使用道具 举报

xguyuanbo 发表于 2010-10-23 19:31:17 | 显示全部楼层
回复 白垩纪 的帖子

这个是补丁的bug,哈哈
回复

使用道具 举报

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

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-9-23 03:33 , Processed in 0.438337 second(s), 16 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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