$value) { if ($i >= 6) { break; } $TPL['kw_etc'][$key] = '' . $value['keyword'] . ''; $i++; } # 關鍵字新聞列表 # 頁碼處理 $newsList = array(); $page = ((int)$_GET['p'] < 1) ? 1 : $_GET['p']; $itemPerPage = ($list_style == 'summary') ? 60 : 16; $itemStart = ($page - 1) * $itemPerPage; $incfile = $NEWS_DATA_DIR . 'keyword/' . md5($keyword) . '.inc'; $newsList = LoadRequireFile($incfile); if (is_array($newsList) && !empty($newsList)) { $newsList = assoc_unique($newsList, 'title'); if (!$newsList) { oops('000'); } $totalNews = count($newsList); $tmpItem = array_slice($newsList, $itemStart, $itemPerPage); if ($page > 1 && count($tmpItem) == 0) { oops('000'); } $newsList = array_map('make_newsList', $tmpItem); } else { oops('000'); } # 右欄空氣品質 $rightAir = rightAir(); # 右欄氣象資訊 $rightWeather = right_get_weather(); # 右欄樂透 $rightLottery = rightLottery(); # 右欄星座 $rightConstellation = rightConstellation(); # 右欄合作媒體 $collMediaItem = ($mid > 100) ? rightCollMedia('public') : rightCollMedia(); #20231220 新增結構化資料 $newsItem['cat_cname'] = $keyword; $newsItem['cat_link'] = "/keyword/" . $keyword; $final_BreadcrumbList = BreadcrumbList_schema($newsItem); # 頁面資訊 # $html_description 後台沒有輸入該關鍵字的說明,則套入公式 $html_title = "最新" . $keyword . "推薦新聞-PChome Online新聞"; $html_keywords = $keyword . "," . $keyword . "推薦,新聞,PChome新聞"; if (empty($TPL['kw_sec'][0]['description'])) { $html_description = "最新" . $keyword . "推薦話題新聞!即時更新提供" . $keyword . "新訊:" . $newsList[0]['title'] . ";" . $newsList[1]['title'] . ";"; } else { $html_description = getNewsSummary($TPL['kw_sec'][0]['description']); } $UAD = getUserAD(90, 91, 92, 93, 94); # 時間檢測 PageLoadCostTime(); # 記憶體檢測 PageLoadCostMemory(); # PV 記錄 pv('KW', '', $mid); $pv_js_code = pv_js_code('KW', '', $mid); # 讀入版型 $template = $TEMPLATES . 'base_body.tpl.html'; require_once($template); function make_newsList($v) { return array( 'title' => $v['title'], 'cat_ename' => '', 'cat_cname' => '', 'media_ename' => '', 'media_cname' => $v['media'], 'pubdate' => $v['pubdate'], 'desc' => $v['desc'], 'content' => '', 'link' => $v['link'], 'picsrc' => changPhotoSize($v['pic'], 's'), 'pic' => changPhotoSize($v['pic'], 'p23'), 'piclink' => $v['piclink'], 'keyword' => $v['keyword'], 'pv' => $v['pv'], 'ori_url' => $v['ori_url'], ); }