bpre.'ecms_news_data_'.$stb; $data = $empire->fetch1("select * from {$table_data} where id=".$id." limit 1"); } } if (is_array($main)) $r = $main; if (is_array($data)) $r = array_merge($r, $data); $title = isset($r['title']) ? (string)$r['title'] : ''; $titlepic = isset($r['titlepic']) ? (string)$r['titlepic'] : ''; $tpjb = isset($r['tpjb']) ? (string)$r['tpjb'] : ''; $newstime = isset($r['newstime']) ? (int)$r['newstime'] : 0; $newstime_fmt = $newstime ? date('Y-m-d H:i:s', $newstime) : ''; $smalltext = isset($r['smalltext']) ? (string)$r['smalltext'] : ''; $onlinepath = isset($r['onlinepath']) ? (string)$r['onlinepath'] : ''; $downpath = isset($r['downpath']) ? (string)$r['downpath'] : ''; $newstext = isset($r['newstext']) ? (string)$r['newstext'] : ''; $cid = isset($r['classid']) ? (int)$r['classid'] : 0; $hasOnline = ($onlinepath !== ''); $hasDown = ($downpath !== ''); // 给后面的 SQL 使用当前栏目ID(猜你喜欢 / 排行榜) $classid = $cid; // tdk=2 -> 读取 play 映射骨架(播放页) $playBase = url('', 'scene=inner|id='.$id.'|classid='.$cid.'|title='.$title.'|tdk=2|source=normal'); // ==== 解析分组(组头=xxx::::::###@@@)==== $groups = array(); $curG = -1; $firstPlayablePathid = 0; if ($hasOnline) { $op = str_replace(array(chr(13).chr(10), chr(13)), chr(10), (string)$onlinepath); $rr = explode(chr(10), $op); $rcount = count($rr); for ($i=0; $i<$rcount; $i++) { $line = trim((string)$rr[$i]); if ($line === '') continue; $fr = explode('::::::', $line); $n0 = isset($fr[0]) ? trim((string)$fr[0]) : ''; $n1 = isset($fr[1]) ? trim((string)$fr[1]) : ''; if ($n1 === '###@@@') { $groups[] = array('name'=>$n0, 'items'=>array(), 'first'=>-1); $curG = count($groups) - 1; continue; } if ($curG < 0) { $groups[] = array('name'=>'默认线路', 'items'=>array(), 'first'=>-1); $curG = 0; } if ($n0 === '') continue; $href = $playBase . '?pathid=' . $i; $groups[$curG]['items'][] = array('name'=>$n0, 'pathid'=>$i, 'href'=>$href); if ($groups[$curG]['first'] < 0) { $groups[$curG]['first'] = $i; if ($firstPlayablePathid === 0) $firstPlayablePathid = $i; } } } $activeG = 0; if (!empty($groups)) { for ($gi=0; $gi
{site} / {main}