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']); $TadUpFiles->set_col('sn', $sn); $snews['cover'] = $TadUpFiles->show_files('pic', false, '', true, null, null, null, true); $TadUpFiles->set_col('snews', $sn); $TadUpFiles->set_hash(false); $snews['files'] = $TadUpFiles->show_files(); // die(var_dump($snews)); $xoopsTpl->assign('snews', $snews); } //顯示列表 function snews_list() { global $xoopsTpl, $xoopsDB, $TadUpFiles; $myts = MyTextSanitizer::getInstance(); $tbl = $xoopsDB->prefix('snews'); $sql = "SELECT * FROM `$tbl` ORDER BY `update_time` DESC"; $result = $xoopsDB->query($sql) or web_error($sql); $all = array(); while ($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']); $TadUpFiles->set_col('sn', $snews['sn']); $snews['cover'] = $TadUpFiles->get_pic_file('thumb', null, null, true); $all[] = $snews; } $xoopsTpl->assign('all', $all); } /*-----------執行動作判斷區----------*/ include_once $GLOBALS['xoops']->path('/modules/system/include/functions.php'); $op = system_CleanVars($_REQUEST, 'op', '', 'string'); $sn = system_CleanVars($_REQUEST, 'sn', 0, 'int'); switch ($op) { // case "xxx": // xxx(); // header("location:{$_SERVER['PHP_SELF']}"); // exit; default: if ($sn) { snews_show($sn); $op = "snews_show"; } else { snews_list(); $op = "snews_list"; } break; } /*-----------秀出結果區--------------*/ $xoopsTpl->assign('op', $op); $xoopsTpl->assign("toolbar", toolbar_bootstrap($interface_menu)); include_once XOOPS_ROOT_PATH . '/footer.php'; ```
進階搜尋
581人線上 (198人在瀏覽線上書籍)
會員: 0
訪客: 581