assign('all_focus', $all_focus); } function mk_html($sn) { global $xoopsDB; $myts = MyTextSanitizer::getInstance(); $tbl = $xoopsDB->prefix('snews'); $sql = "SELECT * FROM `$tbl` WHERE `sn` = '{$sn}'"; $result = $xoopsDB->query($sql) or web_error($sql); $snews = $xoopsDB->fetchArray($result); $snews['content'] = $myts->displayTarea($snews['content'], 1, 0, 0, 0, 0); $snews['title'] = $myts->htmlSpecialChars($snews['title']); $snews['username'] = $myts->htmlSpecialChars($snews['username']); $content = "{$snews['title']}"; $content .= "{$snews['content']}"; $html = html5($content); file_put_contents(XOOPS_ROOT_PATH . "/uploads/snews/{$sn}.html", $html); return $html; } function mk_json() { global $xoopsDB, $TadUpFiles; $myts = MyTextSanitizer::getInstance(); $tbl = $xoopsDB->prefix('snews'); $sql = "SELECT * FROM `$tbl` where `focus`=1 ORDER BY `sort`,`update_time` DESC"; $result = $xoopsDB->query($sql) or web_error($sql); $all_focus = array(); while ($snews = $xoopsDB->fetchArray($result)) { $content = str_replace(array("\n", "\r"), '', strip_tags($snews['content'])); $snews['content'] = word_cut($content, 600); $snews['summary'] = word_cut($content, 40); $snews['title'] = $myts->htmlSpecialChars($snews['title']); $TadUpFiles->set_col('sn', $snews['sn']); $snews['cover'] = $TadUpFiles->get_pic_file(); $all_focus[] = $snews; } $json = json_encode($all_focus, JSON_UNESCAPED_UNICODE); file_put_contents(XOOPS_ROOT_PATH . "/uploads/snews/focus.json", $json); return $html; } ```
{$snews['content']}
進階搜尋
554人線上 (208人在瀏覽線上書籍)
會員: 0
訪客: 554