:::

16-4 上課範例:include/notification.inc.php

<?php
if (!defined('XOOPS_ROOT_PATH')) {
	die("XOOPS root path not defined");
}

function get_tad_note($category, $item_id)
{
	if ($category=='global') {
		$item['name'] = '';
		$item['url'] = '';
		return $item;
	}

	global $xoopsDB;
	if ($category=='cate') {
		$sql = 'SELECT cate_title FROM ' . $xoopsDB->prefix('tad_note_cate') . ' WHERE cate_sn = '.$item_id;
		$result = $xoopsDB->query($sql); // TODO: error check
		$result_array = $xoopsDB->fetchArray($result);
		$item['name'] = $result_array['cate_title'];
		$item['url'] = XOOPS_URL . '/modules/tad_note/index.php?cate_sn=' . $item_id;
		return $item;
	}
}
?>

:::

搜尋

QR Code 區塊

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

書籍目錄

展開 | 闔起

線上使用者

11人線上 (2人在瀏覽線上書籍)

會員: 0

訪客: 11

更多…