:::

14-5 上課範例:view.php

<?php
/*** 引入檔案 ***/
include_once '../../mainfile.php';
include_once XOOPS_ROOT_PATH."/header.php";
include_once 'function.php';

$xoopsOption['template_main'] = "tad_note_view.html";

/*** 函數檔 ***/

//顯示文章列表或單一文章
function show_doc($note_sn=''){
  global $xoopsDB,$xoopsUser,$xoopsModuleConfig,$xoopsTpl;

  $now_uid=($xoopsUser)?$xoopsUser->uid():"";

  $myts =& MyTextSanitizer::getInstance();


  $sql="select * from ".$xoopsDB->prefix("tad_notes")." where `note_sn`='$note_sn' and `note_public`='1'";
  $result=$xoopsDB->query($sql) or redirect_header('index.php', 3, mysql_error());
  $doc=$xoopsDB->fetchArray($result);

  $doc['note_title'] = $myts->htmlSpecialChars($doc['note_title']);
  $doc['note_date'] = $myts->htmlSpecialChars($doc['note_date']);
  $doc['note_content'] = $myts->displayTarea($doc['note_content'], 1, 1, 0, 1, 0);


  $xoopsTpl->assign("note_title",$doc['note_title']);
  $xoopsTpl->assign("note_date", $doc['note_date']);
  $xoopsTpl->assign("note_content",$doc['note_content']);
 
}





/*** 流程判斷 ***/
$op = empty($_REQUEST['op'])? "" : $_REQUEST['op'];
$note_sn = empty($_REQUEST['note_sn'])? "" : intval($_REQUEST['note_sn']);

show_doc($note_sn);

include_once XOOPS_ROOT_PATH.'/include/comment_view.php';
include_once XOOPS_ROOT_PATH.'/footer.php';
?>

:::

搜尋

QR Code 區塊

https%3A%2F%2Fwww.tad0616.net%2Fmodules%2Ftad_book3%2Fpage.php%3Ftbsn%3D22%26tbdsn%3D644

書籍目錄

展開 | 闔起

線上使用者

83人線上 (7人在瀏覽線上書籍)

會員: 0

訪客: 83

更多…