query($sql) or die($db->error); $all = array(); $i = 0; while ($data = $result->fetch_assoc()) { $all[$i] = $data; $all[$i]['summary'] = mb_substr(strip_tags($data['content']), 0, 90); $i++; } // die(var_export($all)); $smarty->assign('all', $all); $smarty->assign('bar', $bar); $smarty->assign('total', $total); } //讀出所有精選 function list_focus() { global $db, $smarty; $sql = "SELECT * FROM `article` WHERE `focus`='1' ORDER BY `update_time` DESC"; $result = $db->query($sql) or die($db->error); $all = array(); $i = 0; while ($data = $result->fetch_assoc()) { $all[$i] = $data; $all[$i]['summary'] = mb_substr(strip_tags($data['content']), 0, 90); $i++; } // die(var_export($all)); $smarty->assign('allslide', $all); } ```
進階搜尋
43人線上 (18人在瀏覽線上書籍)
會員: 0
訪客: 43