$z[0]=Array("field","\nglobal \$dsql,\$cfg_basedir,\$cfg_templets_dir,\$cfg_df_style;\nrequire_once ZB_THEME_LIB.'/zb_url.php';\nrequire_once ZB_THEME_LIB.'/zb_cache.php';\n\$catMap=array(10=>'资讯',11=>'视频',12=>'录像',13=>'集锦',14=>'直播',15=>'赛事');\n// 直播(channel=14)文档标题末尾的数字是开赛时间戳(matchdatetime),转成可读 m-d H:i;其余模型无此后缀原样返回\nif(!function_exists('hotCleanTitle')){function hotCleanTitle(\$title,\$ch){ if(intval(\$ch)===14 && preg_match('/^(.*)-(\\d{9,11})\$/s',trim(\$title),\$m)){ \$ts=intval(\$m[2]); if(\$ts>946656000 && \$ts<2051222400){ return trim(\$m[1]).' '.date('m-d H:i',\$ts); } } return \$title; }}\n// 热榜整段缓存60秒(置顶+24h+7天兜底),命中即零SQL\n\$out=zb_cache_get('rank24_html',60);\nif(\$out===null){\n\$out='';\$topAids=array();\n// 1) 手动置顶(自建表 biz_hot_arc_top 必然存在,无需每次 information_schema 探测)\n\$dsql->SetQuery(\"SELECT a.id,a.title,a.channel FROM `#@__hot_arc_top` h JOIN `#@__archives` a ON a.id=h.aid WHERE h.isshow=1 AND a.arcrank>-1 ORDER BY h.sortrank ASC,h.id DESC LIMIT 5\");\n\$dsql->Execute('hatop');\nwhile(\$r=\$dsql->GetArray('hatop')){\n \$topAids[]=intval(\$r['id']);\n \$tt=htmlspecialchars(hotCleanTitle(\$r['title'],\$r['channel']),ENT_QUOTES,'UTF-8');\n \$cc=isset(\$catMap[\$r['channel']])?\$catMap[\$r['channel']]:'';\n \$out.='顶
'.\$tt.'
'.\$cc.'
';\n}\n// 2) 跨模型热榜:直播(按开赛时间)与其他模型(按发布时间)分两条查询后PHP合并排序,\n// 各自走索引、避免OR全表扫描;注意不能用 UNION 关键字(DedeBIZ的CheckSql会拦截union判为注入)\n\$now=time();\$cut24=\$now-86400;\n\$notIn=\$topAids?(' AND a.id NOT IN('.implode(',',array_map('intval',\$topAids)).')'):'';\nfunction zb_rank_rows(\$dsql,\$cut,\$notIn,\$lim){\n \$now=time();\$liveHi=\$now+86400;\$lim=intval(\$lim);\n // 各模型分别取窗口内按点击降序的候选,再轮转交织:保证热榜覆盖多种类型,\n // 避免某类模型(如采集时基础点击偏高的直播/赛事)靠 click 量级霸榜。\n \$order=array(14,10,13,12,15,11); // 轮转顺序:直播→资讯→集锦→录像→赛事→视频\n \$buckets=array();\n foreach(\$order as \$ch){\n \$buf=array();\$ch=intval(\$ch);\n if(\$ch===14){\n \$dsql->SetQuery(\"SELECT a.id id,a.title title,a.channel channel,a.click click FROM `#@__archives` a JOIN `#@__addonlive` l ON l.aid=a.id WHERE a.arcrank>-1 AND a.channel=14 AND l.matchdatetime>=\$cut AND l.matchdatetime<=\$liveHi \$notIn ORDER BY a.click DESC LIMIT \$lim\");\n }else{\n \$dsql->SetQuery(\"SELECT a.id id,a.title title,a.channel channel,a.click click FROM `#@__archives` a WHERE a.arcrank>-1 AND a.channel=\$ch AND a.senddate>=\$cut AND a.senddate<=\$now \$notIn ORDER BY a.click DESC LIMIT \$lim\");\n }\n \$dsql->Execute('zbr');while(\$r=\$dsql->GetArray('zbr')) \$buf[]=\$r;\n if(\$buf) \$buckets[]=\$buf;\n }\n \$out=array();\n while(count(\$out)<\$lim){\n \$moved=false;\n foreach(\$buckets as \$bi=>\$buf){\n if(!empty(\$buckets[\$bi])){ \$out[]=array_shift(\$buckets[\$bi]); \$moved=true; if(count(\$out)>=\$lim) break; }\n }\n if(!\$moved) break;\n }\n return \$out;\n}\n// 严格24小时热榜:各模型只取近24h(直播含未来24h内将赛),轮转混合最多10条;不足按实际条数展示,不再用旧数据兜底\n\$hotRows=zb_rank_rows(\$dsql,\$cut24,\$notIn,10);\n\$ep=0;\nforeach(\$hotRows as \$r){\n \$ep++;\n \$tt=htmlspecialchars(hotCleanTitle(\$r['title'],\$r['channel']),ENT_QUOTES,'UTF-8');\n \$cc=isset(\$catMap[\$r['channel']])?\$catMap[\$r['channel']]:'';\n \$out.=''.\$ep.'
'.\$tt.'
'.\$cc.'
';\n}\nzb_cache_set('rank24_html',\$out);\n}\n\$DedeMeValue=\$out;\n",243,4310); $z[0][4]=array(); $z[0][4]['name']="typeid"; $z[0][4]['runphp']="yes"; $z[1]=Array("field","\nglobal \$dsql;\n\$vs=zb_hot_recent('49,50',11,10,30);\$out='';\nforeach(\$vs as \$vr){\n \$u=zb_u_arc(\$vr['id']);\$t=htmlspecialchars(\$vr['title'],ENT_QUOTES);\$img=zb_block_default_img(\$vr['litpic'],intval(\$vr['id']));\n \$out.='
\"'.\$t.'\"
'.\$vr['title'].'
';\n}\n\$DedeMeValue=\$out;\n",4472,5011); $z[1][4]=array(); $z[1][4]['name']="typeid"; 足球资讯_小狐狸NBA最新新闻资讯_赛事战报动态_24直播网

足球资讯